To convert a Gray Code to its binary equivalent, which technique is commonly…
2023
To convert a Gray Code to its binary equivalent, which technique is commonly used?
Answer: C. Exclusive OR (XOR) operation — ConceptGray-to-binary conversion uses a prefix Exclusive-OR recurrence. The most significant binary bit is copied from the most significant Gray bit, and…
- A.
Subtraction method
- B.
Addition method
- C.
Exclusive OR (XOR) operation
- D.
Division method
Attempted by 384 students.
Show answer & explanation
Correct answer: C
Concept
Gray-to-binary conversion uses a prefix Exclusive-OR recurrence. The most significant binary bit is copied from the most significant Gray bit, and every later binary bit depends on the binary bit just obtained and the current Gray bit.
Exclusive OR produces 1 when its two input bits differ and 0 when they are equal. This left-to-right recurrence preserves the Gray-code transition information while recovering the positional binary bits.
Application
Apply the recurrence to Gray code 1011 from the most significant bit to the least significant bit:
Copy the most significant bit: B3 = G3 = 1.
Use the previous binary bit with the next Gray bit: B2 = B3 ⊕ G2 = 1 ⊕ 0 = 1.
Continue the recurrence: B1 = B2 ⊕ G1 = 1 ⊕ 1 = 0.
For the least significant bit: B0 = B1 ⊕ G0 = 0 ⊕ 1 = 1.
Cross-check and contrast
Convert binary 1101 back to Gray code: keep the leading 1, then XOR adjacent binary bits to obtain 1, 0, and 1. This reproduces 1011.
Subtraction method: It propagates borrows between digit positions; it is not the prefix-bit recurrence used here.
Addition method: It propagates carries between digit positions. Carry-free addition modulo 2 describes XOR, not ordinary binary addition.
Exclusive OR (XOR) operation: It supplies the required prefix recurrence and can be implemented as a cascade of XOR gates.
Division method: Repeated division generates remainders for radix conversion; Gray-code conversion is a code transformation rather than a change of radix.
Result: The commonly used technique is the Exclusive OR (XOR) operation.
Explore the full course: Bihar Stet Paper Ii Computer Science