Skip to content
Tactiverge

Carries ripple, numbers wrap

07Multi-bit arithmetic

  1. Stage 1
  2. Stage 2
  3. Stage 3
  4. Stage 4
  5. Stage 5
  6. Stage 6
  7. Stage 7 (this one)
  8. Stage 8
  9. Stage 9
  10. Stage 10
  11. Stage 11
  12. Stage 12
  13. Stage 13
  14. Stage 14
  15. Stage 15

Explanation

Chain eight full adders, carry out of each into the next, and you have an 8-bit ripple-carry adder. The carry may have to ripple through every column, so the worst case takes 8 full-adder delays.

A byte cannot hold 256, so 200 + 100 wraps to 44 and the final carry falls off: that is unsigned overflow, signalled by the carry flag. Read as two's complement, 100 + 100 = 200 shows as −56: that is signed overflow, which happens when two numbers of the same sign give a result of the other sign. Subtraction reuses the adder: A − B = A + NOT B + 1.

Eight full adders in a chain

A = 200 (signed -56)

B = 100 (signed 100)

Column by column, carries rippling right to left (computed by the gate circuit)
bit76543210
carry in10000000
A11001000
B01100100
sum00101100
Result
44 (signed 44)
Carry out
1
Unsigned overflow
yes
Signed overflow
no

Longest carry chain this time: 2 columns. Try 255 + 1 for the worst case. Built from 40 gates.

Result 44, carry 1, signed overflow no

Check yourself

Marked instantly in your browser. Use the interactive above to work it out.

  1. 1. An 8-bit adder adds 200 + 100. What value does the result register hold?
  2. 2. Read as signed bytes, 100 + 100 gives which?