Binary 1011 → Gray — Gray code
introXOR each bit with the one above it
Answer
1110
Why this example is worth doing
The conversion rule in one line: keep the most significant bit, then XOR each remaining bit with its left-hand neighbour. The tool draws the XOR arrows between bit positions so the dependency chain is visible, and gives the algebraic form G = B ⊕ (B >> 1), which is how it is implemented in hardware — a row of XOR gates with no carry chain, so the conversion takes one gate delay regardless of width.
Try your own input in the Gray code. Convert binary to reflected Gray code and back, and build the sequence by reflection.
How the answer is reached
Binary 1011 to Gray code
Each Gray bit is the XOR of the binary bit and the binary bit above it.
| bit i | b_i | b_(i+1) | g_i = b_i XOR b_(i+1) |
|---|---|---|---|
| 3 | 1 | 0 (nothing above the MSB) | 1 |
| 2 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
binary1011
Gray1110
whole-word formG = B XOR (B >> 1) = 1011 XOR 0101 = 1110
This is the binary reflected Gray code. It is one Gray code among many: any single-bit-change ordering of the codewords is a Gray code, and other constructions give different tables.
Source: Frank Gray, US Patent 2,632,058, "Pulse Code Communication" (filed 1947, granted 1953)