Skip to main content

Gray→BCD, decimal→Excess-3 and 2's complement addition

Short answer

Gray 1110 → binary 1011 (11₁₀) → BCD 0001 0001. (1430)₁₀ = 0100 0111 0110 0011 in Excess‑3 (add 3 to each digit). In 8‑bit 2’s complement, –28 (1110 0100) + 17 (0001 0001) = 1111 0101, which is –11₁₀.

Perform the following: (i) (1110)gray = ( )BCD (ii) (1430)₁₀ = ( )excess-3 (iii) Use 2's complement method to perform the addition (-28 +17).

(i) (1110)Gray(1110)_{Gray} to BCD

Gray to binary: MSB is copied; each next binary bit = previous binary bit XOR current Gray bit.

StepGray bitBinary bit
MSB11
211 ⊕ 1 = 0
310 ⊕ 1 = 1
LSB01 ⊕ 0 = 1

(1110)Gray=(1011)2=(11)10(1110)_{Gray} = (1011)_2 = (11)_{10}. Each decimal digit in BCD: 1 → 0001, 1 → 0001.

Answer: (1110)Gray=(0001 0001)BCD(1110)_{Gray} = (0001\ 0001)_{BCD}

(ii) (1430)10(1430)_{10} to Excess-3

Add 3 to each digit and write in 4 bits:

Digit+3XS-3
140100
470111
360110
030011

Answer: (1430)10=(0100 0111 0110 0011)XS−3(1430)_{10} = (0100\ 0111\ 0110\ 0011)_{XS-3}

(iii) (−28) + 17 using 2's complement (8 bits)

  • +28=0001 1100+28 = 0001\ 1100
  • 1's complement =1110 0011= 1110\ 0011; add 1: −28=1110 0100-28 = 1110\ 0100
  • +17=0001 0001+17 = 0001\ 0001
    1110 0100   (-28)
  + 0001 0001   (+17)
  -----------
    1111 0101   (no end carry)

The MSB is 1 and there is no end carry, so the result is negative in 2's complement form. Magnitude: 2's complement of 1111 01011111\ 0101 = 0000 1010+1=0000 1011=110000\ 1010 + 1 = 0000\ 1011 = 11.

Check: −28+17=−11-28 + 17 = -11.

Answer: 1111 01012=(−11)101111\ 0101_2 = (-11)_{10}

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 1 questions →