4-bit ripple-carry: 1011 + 0110 — adders

corecarry out of the top bit

Answer

10001

Why this example is worth doing

Four full adders chained, each waiting for the carry below it. The result needs five bits, so in a fixed four-bit register this is an overflow — and whether that matters depends on whether the operands are signed, which the two's complement page takes up. The page shows the carry propagating stage by stage and gives the delay as four gate-pair delays, which is the motivation for everything that follows it.

Try your own input in the Half adder & full adder. Truth tables, K-maps and circuits for both adders, and the ripple-carry chain.

How the answer is reached

01011 + 00110 (5-bit, unsigned)

01011 + 00110 (5-bit, unsigned) — columns operand, bits, hex, unsigned, signed
operandbitshexunsignedsigned
A010110x0B1111
B001100x0666
The digit above column i is the carry or borrow into column i. Bit 0 is the least significant column. — 01011 + 00110
row43210
carry in11100
A01011
+ B00110
result10001

C = 0 · V = 1 · N = 1 · Z = 0

unsigned11 + 6 = 17, kept as 17fits in the width

signed11 + 6 = 17, kept as -15V = 1: the signed answer is wrong

Warning:

C is carry-out (unsigned overflow); V is carry-into-MSB XOR carry-out-of-MSB (signed overflow). They are independent: either, both or neither can be set.

Compare with

Open the Half adder & full adder

This input is entered in the tool itself — it is too rich for a link to carry.

Note:

Notation this page assumes

  • Symbols: · is AND, + is OR, ⊕ is XOR, a prime or an overline is NOT. The field also takes ∧ ∨ ¬ ~ ! & | and the words.
  • Operator precedence, tightest first: NOT, then AND (including juxtaposition), then XOR/XNOR, then NAND/NOR, then OR, then IMPLIES, then IFF.
  • Gate symbols follow whichever standard the header toggle is set to: ANSI/IEEE Std 91-1984 distinctive shapes, or IEC 60617-12 rectangles.

Sources

  • Shannon, “A Symbolic Analysis of Relay and Switching Circuits” (1938)
  • ANSI/IEEE Std 91-1984, Graphic Symbols for Logic Functions