110 likes | 405 Views
Arithmetic Microoperations. Addition. Subtraction. 1’s Complement. 2’s Complement. Subtraction!. Increment. Decrement. Half Adder. Full Adder. Full Adders and Half Adders. A i B i C i-1 S i C i 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1
E N D
Arithmetic Microoperations Addition Subtraction 1’s Complement 2’s Complement Subtraction! Increment Decrement
Half Adder Full Adder Full Adders and Half Adders
Ai Bi Ci-1 Si Ci 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ai Bi Ci-1 FA Ci Si Half Adder Full Adder Full Adders and Half Adders Ai BiSi Ci 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 Ai Bi HA Ci Si
A1 B1 C0 A2 B2 C1 A0 B0 FA FA HA C1 S1 C2 S2 C0 S0 An n-bit adder An-1 Bn-1 Cn-2 ... FA Cn-1 Sn-1
A1 B1 C0 A2 B2 C1 A0 B0 Cin FA FA FA An-1 Bn-1 Cn-2 ... FA C1 S1 C2 S2 C0 S0 COUT Sn-1 Another n-bit adder 0 v
A0 B0 A1 B1 A2 B2 HA HA HA C0 S0 C1 S1 C2 S2 An n-bit incrementer 5 v An-1 Bn-1 HA ... Cn-1 Sn-1
Block Diagrams How many pins in this chip? 2n A,B +1 CIN + n Sum + 1 COUT + 1 Clock + 1 VCC + 1 Gnd = 3n+5 n-bit adder An-1 Bn-1 ...A1 B1 A0 B0 CIN COUT Sn-1 Sn-2 … S1 S0 How many inputs? How many outputs? 2n+1 n+1
Inside the n-bit clocked adder ... FA FA FA FA n-bit register
Subtraction • A- B = A + 2’s complement of B • 2’s complement of B = ~B +1 • ~B = B “1” B exclusive OR “1” where “1” is n 1’s X Y X Y 0 0 0 0 1 1 1 0 1 1 1 0