Adders Module M8.1 Section 6.2
Adders Half Adder Full Adder TTL Adder
Half Adder CABS 0001 A 0 B 0 S 0 C Dec Binary
Multiple-bit Addition A B A 3 A 2 A 1 A A B 3 B 2 B 1 B 0 B A i +B i +C i SiSi C i+1
Full Adder C i A i B i S i C i CiCi AiBiAiBi SiSi
Full Adder C i A i B i S i C i+1 S i = !C i & !A i & B i # !C i & A i & !B i # C i & !A i & !B i # C i & A i & B i
Full Adder S i = !C i & !A i & B i # !C i & A i & !B i # C i & !A i & !B i # C i & A i & B i S i = !C i & (!A i & B i # A i & !B i ) # C i & (!A i & !B i # A i & B i ) S i = !C i & (A i $ B i ) # C i & !(A i $ B i ) S i = C i $ (A i $ B i )
Full Adder C i A i B i S i C i CiCi AiBiAiBi C i+1
Full Adder C i A i B i S i C i+1 CiCi AiBiAiBi C i+1 C i+1 = A i & B i # C i & B i # C i & A i
Full Adder C i A i B i S i C i+1 CiCi AiBiAiBi C i+1 C i+1 = A i & B i # C i & !A i & B i # C i & A i & !B i
Full Adder C i+1 = A i & B i # C i !A i & B i # C i & A i & !B i C i+1 = A i & B i # C i & (!A i & B i # A i & !B i ) C i+1 = A i & B i # C i & (A i $ B i ) Recall: S i = C i $ (A i $ B i ) C i+1 = A i & B i # C i & (A i $ B i )
Full Adder S i = C i $ (A i $ B i ) Half-adder C i+1 = A i & B i # C i & (A i $ B i )
Full Adder A full adder can be made from two half adders (plus an OR gate).
Full Adder Block Diagram
4-Bit Adder C A B S
adder.abl MODULE adder TITLE 'Adder, R. Haskell, 10/6/02' DECLARATIONS " INPUT PINS " A3..A0 PIN 6, 7, 11, 5; " Switch 1..4 A = [A3..A0]; " 4-bit operand B3..B0 PIN 72, 71, 66, 70; " Switch 5..8 B = [B3..B0]; " 4-bit addend " OUTPUT PINS " S3..S0 PIN 39, 37, 36, 35 ISTYPE 'com'; " LED 5..8 S = [S3..S0]; " 4-bit sum CF PIN 40 ISTYPE 'com'; " LED 4; carry flag OVF PIN 44 ISTYPE 'com'; " LED 1; overflow flag
adder.abl (cont’d) " INTERMEDIATE NODES " C4..C0 NODE ISTYPE 'com'; " internal carry vector Cin = [C3..C0]; " carry input vector Cout = [C4..C1]; " carry output vector Intermediate Carry bits
adder.abl (cont’d) S i = C i $ (A i $ B i ) C i+1 = A i & B i # C i & (A i $ B i ) EQUATIONS C0 = 0; " zero carry in S = A $ B $ Cin; " sum output Cout = A & B # (A $ B) & Cin; " carry output vector CF = C4; " carry flag OVF = C4 $ C3; " overflow flag END adder4
TTL Adder GND Vcc B3 S1 B1 C4 S4 B4 C0 A3 S3 A4 A2 B2 S2 A1 74LS283
Question Add the following 4-bit binary numbers What is the answer in hex? Was there a net carry?