Skip to main content

Convert (01010111)gray to binary

Short answer

MSB of binary equals MSB of Gray (0). Each next binary bit = previous binary bit XOR current Gray bit: 0⊕1=1, 1⊕0=1, 1⊕1=0, 0⊕0=0, 0⊕1=1, 1⊕1=0, 0⊕1=1. Result: (01100101)₂.

Convert (01010111)gray = (?)₂.

Rule (Gray to binary): the MSB of binary equals the MSB of Gray. Each next binary bit = previous binary bit XOR current Gray bit, Bi=Bi+1⊕GiB_i = B_{i+1} \oplus G_i.

Gray bit GiG_iOperationBinary bit BiB_i
0copy MSB0
10⊕10 \oplus 11
01⊕01 \oplus 01
11⊕11 \oplus 10
00⊕00 \oplus 00
10⊕10 \oplus 11
11⊕11 \oplus 10
10⊕10 \oplus 11

Check: converting 01100101 back to Gray (Gi=Bi+1⊕BiG_i = B_{i+1} \oplus B_i) gives 01010111 again.

Answer: (01010111)gray=(01100101)2(01010111)_{gray} = (01100101)_2 (= 10110101_{10}).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 1 questions →