Lecture Adders Half adder CH 1 Full Adder

  • Slides: 10
Download presentation
Lecture Adders • Half adder C-H 1

Lecture Adders • Half adder C-H 1

Full Adder si is the modulo 2 sum of ci, xi, yi. C-H 2

Full Adder si is the modulo 2 sum of ci, xi, yi. C-H 2

An n-bit Ripple Adder Xn-1 Yn-1 X 0 Y 0 ……… Cn FA Sn-1

An n-bit Ripple Adder Xn-1 Yn-1 X 0 Y 0 ……… Cn FA Sn-1 MSB Cn-1 C 1 FA C 0 S 0 LSB C-H 3

Adder/subtractor • - = add 2’s complement of the subtrahend • y xor 0

Adder/subtractor • - = add 2’s complement of the subtrahend • y xor 0 = y; y xor 1 = ~y yn– 1 y 0 Add¤ Sub control xn– 1 x 0 cn c 0 n-bit adder sn– 1 s 0 C-H 4

Overflow v. s. Carry-out • n-bit signed number: -2 n-1 to 2 n-1 -1

Overflow v. s. Carry-out • n-bit signed number: -2 n-1 to 2 n-1 -1 Detect overflow for signed number: Overflow = Cn-1 ⊕ Cn Overflow = Xn-1 Yn-1 ~Sn-1 (110) + ~Xn-1 ~Yn-1 Sn-1 (001) where X and Y represent the 2’s complement numbers, S = X+Y. (sign bits 0, 0 ≠ 1 ) 0111 1111 Carry-out: for unsigned number C-H 5

Propagate and Generate ripple carry • ci+1 = xiyi + (xi+yi)ci = gi +

Propagate and Generate ripple carry • ci+1 = xiyi + (xi+yi)ci = gi + pici • A ripple-carry adder: critical path = 2 n + 1 x 1 g 1 y 1 p 1 x 0 c 1 c 2 Stage 1 g 0 y 0 p 0 c 0 Stage 0 s 1 s 0 C-H 6

Propagate and Generate Carry-Lookahead ci+1 = xiyi + (xi+yi)ci = gi + pi (gi-1

Propagate and Generate Carry-Lookahead ci+1 = xiyi + (xi+yi)ci = gi + pi (gi-1 + pi-1 ci-1) = gi + pigi-1 + pipi-1 gi-2 + …+ pipi-1 …p 2 p 1 g 0 + pipi-1…p 1 p 0 c 0 For instance, c 1 = g 0 + p 0 c 0 c 2 = g 1 + p 1 g 0 + p 1 p 0 c 0 C-H 7

Propagate and Generate Carry-Lookahead c 1 = g 0 + p 0 c 0

Propagate and Generate Carry-Lookahead c 1 = g 0 + p 0 c 0 c 2 = g 1 + p 1 g 0 + p 1 p 0 c 0 3 gate delays x 1 y 1 x 0 g 1 p 1 D 1 y 0 g 0 p 0 c 2 c 1 D 2 D 3 s 1 s 0 C-H 8

A Multiplier Array and adder C-H 9

A Multiplier Array and adder C-H 9

Array of Adders for Unsigned Multiplication 4 -bit example C-H 10

Array of Adders for Unsigned Multiplication 4 -bit example C-H 10