You are on page 1of 10

COEN 312

Fall 2009; Section: X
Lecture – 11

Binary Sub-tractor

Dr Shah Jahinuzzaman
Dr.
Soft copies of lectures are available at

the addition time in an n-bit n bit RCA: tadder = (n-1) tcarry + tsum • With increasingg n ((16. ) RCA becomes very y slow COEN 312 © Shah Jahinuzzaman. Ripple Carry Adder (RCA) • Simple to construct. etc. Canada 2 .). 32. but has a long circuit delay • If carry generation time per stage is tcarry and sum generation time per stage is tsum. Concordia University.

Cout=xy+Cin(x ⊕ y) We define two intermediate signals. Canada 3 . which Truth table: full adder x y C in outC S are only functions of x and y: x P 0 0 0 0 0 G = generate = xy y 0 0 1 0 1 0 1 0 0 1 P = propagate = x⊕y G 0 1 1 1 0 If G G=11 in a stage stage. a carry is generated in 1 0 0 0 1 that stage. Concordia University. Carry Look Ahead Adder • “Carry look-ahead” logic removes the rippling effect of carry and generates carry signals directly from the addend bits • For a full adder: S=Cin⊕x⊕y. an incoming carry is 1 0 1 1 0 propagated through that stage to the next 1 1 0 1 0 1 1 1 1 1 stage COEN 312 © Shah Jahinuzzaman. if P=1.

Canada 4 ... Carry Look-ahead Logic • The sum and carry out signals can be expressed in terms of P and G S=Cin⊕P and Cout=G+PCin In a generic way: Si=Ci⊕Pi and Cii+11=Gi+PiCi where i represents a bit position such that i=0.. .. xi yi Si Gi Pi Ci For carry logic COEN 312 © Shah Jahinuzzaman. 3. 2. 1. Concordia University.

Concordia University. 4-bit Carry Look-ahead Logic • For a 4-bit adder the carry generation circuit would be: C1=G0+P0C0 C2=G1+P1C1= G1+P1(G0+P0C0)= G1+P1G0+P1P0C0 C3=G2+P2C2= G2+P2(G1+P1G0+P1P0C0) = G2+P P2G1+P P2P1G0+P P2P1P0C0 C4=G3+P3C3= G3+P3(G2+P2G1+P2P1G0+P2P1P0C0) = G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0 COEN 312 © Shah Jahinuzzaman. Canada 5 .

4-bit Carry Look-ahead Tree C4 Only two gate delays for the carry signals COEN 312 © Shah Jahinuzzaman. Canada 6 . Concordia University.

Binary Subtractor • Subtracts one binary number from another: 1 1 Minuend 1100 Borrow 1 0 Subtrahend 101 Minuend ----. Canada 7 . 111 Subtrahend 0 1 Difference -------- 1110 Difference Borrow out • Called a half subtractor if performs subtraction of only two bits • Called a full subtractor if performs subtraction of three bits (two significant bits and a previous borrow) COEN 312 © Shah Jahinuzzaman. Concordia University.

Half Subtractor • Two operands (x. B=1 and the difference is in 2’s complement form Truth table: half subtractor D = x’y + xy’ = x ⊕ y x y B D B = x’y 0 0 0 0 0 1 1 1 Two implementations: 1 0 0 1 1 1 0 0 D B COEN 312 © Shah Jahinuzzaman. Canada 8 . if x<y. Concordia University. two outputs: difference (D) & borrow (B) – D= x-y.y).

Concordia University. Canada 9 . and one input borrow (Bin) • Two outputs: difference (D) and output borrow (Bout) – Difference. Full Subtractor • Three inputs: minuend (x). subtrahend (y). D = x-y-Bin Truth table: full adder x y Bin Bout D 0 0 0 0 0 K-map for D K-map for Bout 0 0 1 1 1 yBin yBin x 00 01 11 10 x 00 01 11 10 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 0 D = x ⊕ y ⊕ Bin Bout = yBin+x’Bin+x’y 1 1 0 0 0 1 1 1 1 1 COEN 312 © Shah Jahinuzzaman.

. Bout Using 2-level NOR • Method-1: implement Bout = yBin+x’Bin+x’y using AND-OR gates then replace the gates using equivalent NOR gates. x 00 01 11 10 0 0 1 1 1 Bout = (y+Bin)(x’+Bin)(x’+y) 1 0 0 1 0 y Bin x’ Bout = yBin+x’Bin+x’y Bout Bin xx’ y COEN 312 © Shah Jahinuzzaman. then implement using NOR gates – Grouping 0’s in the K-map: Bout’ = y’Bin’+xBin’+xy’ yBin Using g DeMorgan’s g theorem. Canada 10 . Concordia University. gates • Method-2: find Bout in terms of POS.