- 2080 Bhadra · 2+3+1 marks
Gray code and 3-bit binary-to-Gray converter
Short answer
Gray code: successive numbers differ by one bit. A 3-bit binary to Gray converter: truth table gives G2=B2, G1=B2⊕B1, G0=B1⊕B0. Circuit uses two XOR gates. Example: binary 010 yields Gray 011.
Define Gray Code. Design 3-bit binary to gray code converter circuit with necessary truth table and circuit diagram.
Gray code
Gray code is an unweighted, reflected binary code in which successive numbers differ in only one bit position. Examples: 0 = 000, 1 = 001, 2 = 011, 3 = 010. It is used in shaft encoders and K-maps because only one bit changes at each step, avoiding false intermediate values.
3-bit binary to Gray code converter
Inputs: (binary, = MSB). Outputs: .
Truth table (3-bit binary to Gray)
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Simplification (K-maps)
K-map for (rows , columns ):
B1B0
B2 00 01 11 10
0 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 0 | 0 |
Logic circuit
B2 ---+------------------------ G2
| +-------+
+--->| |
| XOR |----------- G1
B1 ---+--->| |
| +-------+
| +-------+
+--->| |
| XOR |----------- G0
B0 ------->| |
+-------+
The converter needs only two XOR gates: the MSB passes straight through and each other Gray bit is the XOR of two neighbouring binary bits.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- BCD code and 3-bit binary-to-Gray converter · Digital Logic, chapter 1
- 3-bit Gray code synchronous counter · Digital Logic, chapter 8 · asked 2×
- ASCII code and binary-to-Excess-3 converter · Digital Logic, chapter 1 · asked 2×
- Excess-3 code and binary-to-Excess-3 converter · Digital Logic, chapter 1 · asked 2×
- Sync vs async; 3-bit Gray code counter · Digital Logic, chapter 8
- Gray vs binary code, convert (10110)₂ to Gray · Digital Logic, chapter 1
- JK flip-flop operation and truth table · Basic Electronics Engineering, chapter 6
- Bit error probability for binary ASK · Communication Systems, chapter 9