- 2079 Bhadra · 2+2+2 marks
Gray vs binary code, convert (10110)₂ to Gray
Short answer
Gray code is unweighted; consecutive numbers differ in exactly one bit, unlike weighted binary where many bits can change. To convert (10110)₂ to Gray: keep MSB 1, then G₃=1⊕0=1, G₂=0⊕1=1, G₁=1⊕1=0, G₀=1⊕0=1 → (11101)Gray.
What is a Gray code? How is it different than binary code? Convert (10110)₂ to Gray code?
Gray code
Gray code is an unweighted binary code in which two successive values differ in only one bit. It is also called the reflected binary code. Example sequence: 000, 001, 011, 010, 110, 111, 101, 100.
Difference from binary code
| Point | Binary code | Gray code |
|---|---|---|
| Weights | Weighted (1, 2, 4, 8…) | Unweighted |
| Bit change between successive numbers | One or more (011 → 100 changes 3 bits) | Exactly one |
| Arithmetic | Easy | Not suitable |
| Switching errors | Possible at transitions | Minimal |
| Uses | Computation, storage | Encoders, K-maps, ADCs |
Convert to Gray
Keep the MSB; each following Gray bit is the XOR of two adjacent binary bits.
Binary: 1 0 1 1 0
| \ | \ | \ | \ |
Gray : 1 1 1 0 1
Answer:
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Gray code, (11101)Gray to binary, FFH AND CAH · Digital Logic, chapter 1
- BCD code and 3-bit binary-to-Gray converter · Digital Logic, chapter 1
- Gray code and 3-bit binary-to-Gray converter · Digital Logic, chapter 1
- Gray code compared with binary numbers · Digital Logic, chapter 1
- Convert (110111)gray to binary · Digital Logic, chapter 1
- Convert (01010111)gray to binary · Digital Logic, chapter 1
- 5-bit R-2R DAC output for 10110 · Advanced Electronics, chapter 3
- Convolutional vs block codes; (7,4) cyclic code for 1011 · Communication Systems, chapter 8 · asked 2×
- Convolutional vs block coder; (7,4) cyclic code for 1010 · Communication Systems, chapter 8 · asked 2×