retagged by
3,053 views
8 votes
8 votes

If $ABCD$ is a $4$-bit binary number, then what is the code generated by the following circuit?

  1. BCD code
  2. Gray code
  3. $8421$ code
  4. Excess-$3$ code
retagged by

3 Answers

9 votes
9 votes

$\textbf{Output:}\:W = A,\:X=A\oplus B,\:Y=B\oplus C,Z=C\oplus D$

$\text{Decimal Numbers}$ $\text{Binary Code}$ $\text{Gray Code}$
$0$ $0000$ $0000$
$1$ $0001$ $0001$
$2$ $0010$ $0011$
$3$ $0011$ $0010$
$4$ $0100$ $0110$
$5$ $0101$ $0111$
$6$ $0110$ $0101$
$7$ $0111$ $0100$
$8$ $1000$ $1100$
$9$ $1001$ $1101$
$10$ $1010$ $1111$
$11$ $1011$ $1110$
$12$ $1100$ $1010$
$13$ $1101$ $1011$
$14$ $1110$ $1001$
$15$ $1111$ $1000$

$\text{Convert Binary to Gray Code}:$ 

  • The MSB (Most Significant Bit) of the gray code will be exactly equal to the first bit of the given binary number.
  • The second bit of the code will be exclusive-or (XOR) of the first and second bit of the given binary number, i.e if both the bits are same the result will be $0$ and if they are different the result will be $1.$
  • The third bit of gray code will be equal to the exclusive-or (XOR) of the second and third bit of the given binary number. Thus the binary to gray code conversion goes on. An example is given below to illustrate these steps.

Reference:

So, the correct answer is $(b).$

edited by
2 votes
2 votes

Option C

Gray code is written like this:

$\ A\ \ \ \ A\oplus B \ \ \ \ B\oplus C \ \ \ \ C\oplus D$
$\ \downarrow\ \ \ \ \ \ \downarrow \ \ \ \ \ \ \ \ \ \ \ \downarrow \ \ \ \ \ \ \ \ \ \ \ \downarrow$
$\ W\ \ \ \ \ \ X\ \ \ \ \ \ \ \ \ \ \ \ \ Y\ \ \ \ \ \ \ \ \ \ \ \ Z$

1 votes
1 votes

In a Gray code, two successive values differ in only one bit.
The given circuit takes ABCD as input and produce WXYZ as its corresponding gray code.
W = A,
X = A ⊕ B,
Y = B ⊕ C,
Z = C ⊕ D.

Answer:

Related questions

6 votes
6 votes
2 answers
1
Satbir asked Jan 13, 2020
5,271 views
Minimum number of NAND gates required to implement the following binary equation$Y = (\overline{A}+\overline{B})(C+D)$$4$$5$$3$$6$
4 votes
4 votes
3 answers
2
Satbir asked Jan 13, 2020
2,766 views
Consider the following circuitThe function by the network above is$\overline{AB}E+EF+\overline{CD}F$$(\overline{E}+AB\overline{F})(C+D+\overline{F})$$(\overline{AB}+E)(\o...
6 votes
6 votes
3 answers
3
Satbir asked Jan 13, 2020
3,850 views
The following circuit compares two $2$-bit binary numbers, $X$ and $Y$ represented by $X_1X_0$ and $Y_1Y_0$ respectively. ($X_0$ and $Y_0$ represent Least Significant Bit...
3 votes
3 votes
2 answers
4
Satbir asked Jan 13, 2020
2,678 views
Following Multiplexer circuit is equivalent toSum equation of full adderCarry equation of full adderBorrow equation for full subtractorDifference equation of a full subtr...