CPE 626 CPU Resources Adders Multipliers Aleksandar Milenkovic

  • Slides: 30
Download presentation
CPE 626 CPU Resources: Adders & Multipliers Aleksandar Milenkovic E-mail: Web: milenka@ece. uah. edu

CPE 626 CPU Resources: Adders & Multipliers Aleksandar Milenkovic E-mail: Web: milenka@ece. uah. edu http: //www. ece. uah. edu/~milenka

Outline Ø Ø Ø Ø Full Adder Ripple Carry Adder Carry-Look-Ahead Adder Manchester Adders

Outline Ø Ø Ø Ø Full Adder Ripple Carry Adder Carry-Look-Ahead Adder Manchester Adders Carry Select Adder Carry Skip Adder Conditional Sum Adder Hybrid Designs 2

Full Adder Ø Inputs § data inputs A, B § carry in Cin Ø

Full Adder Ø Inputs § data inputs A, B § carry in Cin Ø Outputs § sum S § carry out Cout 3

Full Adder 4

Full Adder 4

Full Adder 5

Full Adder 5

Transmission-Gate Adder (1) Ø A = 1 => -A = 0 => TG is

Transmission-Gate Adder (1) Ø A = 1 => -A = 0 => TG is open => out = -B Ø A = 0 => -A = 1 => TG is closed => out = B TG XOR Ø A = 1 => -A = 0 => TG is closed => out = B Ø A = 0 => -A = 1 => TG is open => out = -B TG XNOR 6

Transmission-Gate Adder (2) 7

Transmission-Gate Adder (2) 7

Ripple Carry Adder - RCA (1) Ø Method 1 § § G[i] = A[i]*B[i]

Ripple Carry Adder - RCA (1) Ø Method 1 § § G[i] = A[i]*B[i] P[i] = A[i] B[i] C[i] = G[i] + P[i]*C[i-1] S[i] = P[i] C[i-1] Ø Method 2 § § G[i] = A[i]*B[i] P[i] = A[i] + B[i] C[i] = G[i] + P[i]*C[i-1] S[i] = A[i] B[i] C[i-1] 8

Ripple Carry Adder - RCA (2) Ø Replace AND-OR pair with fast 2 -inputs

Ripple Carry Adder - RCA (2) Ø Replace AND-OR pair with fast 2 -inputs NAND gates RCA delay is proportional to n and is limited by the propagation of the carry signal through all of the stages 9

Ripple Carry Adder - RCA (3) Used in odd stages! Used in even stages!

Ripple Carry Adder - RCA (3) Used in odd stages! Used in even stages! 10

Ripple Carry Adder - RCA (4) Ø Carry equations § C[i+1] = A[i]*B[i] +

Ripple Carry Adder - RCA (4) Ø Carry equations § C[i+1] = A[i]*B[i] + P[i]*C[i] or C[i+1] = (A[i] + B[i])*(P[i]’ + C[i]) P[i]’ = NOT(P[i]) Ø Even stages § C 1[i+1]’ = P[i]*C 3[i]*C 4[i] § C 2[i+1] = A[i] + B[i] § C[i+1] = C 1[i]*C 2[i] Ø Odd stages § C 3[i+1]’ = P[i]*C 1[i]*C 2[i] § C 4[i+1]’ = A[i]*B[i] § C[i+1] = C 3[i]’ + C 4[i]’ Ø Inputs to stage zero: C 3[0] = C 4[0] = ‘ 0’ 11

Carry-Look-Ahead Adder – CLA (1) Ø Idea: speed up carry computation – Ci+1 =

Carry-Look-Ahead Adder – CLA (1) Ø Idea: speed up carry computation – Ci+1 = Gi + Pi*Ci Ø Propagate: Pi = Ai + Bi § if Pi = 1, then carry from (i-1)th stage is propagated Ø Generate: Gi = Ai*Bi § if Gi = 1 there is carry out 12

Carry-Look-Ahead Adder – CLA (2) 13

Carry-Look-Ahead Adder – CLA (2) 13

Carry-Look-Ahead Adder – CLA (3) Domino implementation (Dynamic Carry Gates) 14

Carry-Look-Ahead Adder – CLA (3) Domino implementation (Dynamic Carry Gates) 14

Carry-Look-Ahead Adder – CLA (4) 15

Carry-Look-Ahead Adder – CLA (4) 15

Carry-Look-Ahead Adder – CLA (5) 16

Carry-Look-Ahead Adder – CLA (5) 16

Brent-Kung CLA Ø a) lookahead terms Ø b) CLG cell Ø c) cells can

Brent-Kung CLA Ø a) lookahead terms Ø b) CLG cell Ø c) cells can be rearranged into tree Ø d) simplified representations for part a) Ø e) simplified representation for part c) Ø f) lookahead logic for 8 -bit adder Ø g) Brent-Kung adder Reduces delay, increases the regularity, reduces the number of unnecessary switching events (power) 17

Manchester Adder Circuits (1) 18

Manchester Adder Circuits (1) 18

Manchester Adder Circuits (2) Dynamic Stage Static Stage MUX stage 19

Manchester Adder Circuits (2) Dynamic Stage Static Stage MUX stage 19

4 -bit Manchester Adder 20

4 -bit Manchester Adder 20

Carry Bypass 21

Carry Bypass 21

Carry Select Adder (1) Compute 2 versions of the addition with different carry-ins, one

Carry Select Adder (1) Compute 2 versions of the addition with different carry-ins, one assuming that the carry-in is 0 and another assuming that it is 1 22

Carry Select Adder (2) 23

Carry Select Adder (2) 23

Carry Skip Adder: Motivation Computing P 3 -0 is much simpler than computing G

Carry Skip Adder: Motivation Computing P 3 -0 is much simpler than computing G 0 -3 Let’s compute only P 3 -0! 24

Carry Skip Adder Practical only if the carry-in signals can be easily cleared at

Carry Skip Adder Practical only if the carry-in signals can be easily cleared at the start of each operation – e. g. precharging CMOS Carries begin rippling simultaneously through each block; If any block generates a carry, then the carry out will be true, even the carry-in may not be not true yet. If at the start of each add operation the carry-in to each block is 0, then correct carry-outs will be generated – carry-out can be thought of as if it is the G signal 25

Carry Skip Adder: Analysis Ø Assume § it takes 1 time unit for signal

Carry Skip Adder: Analysis Ø Assume § it takes 1 time unit for signal to propagate through two logic level § n bits wide adder § blocks of size k Ø It will take k units for a carry to ripple through a block of size k Ø Critical path § k units for the first block § n/k – 2 units to skip the blocks § k units to ripple through the last block Ø Increase the efficiency by varying the blocks size § 20 bits (4, 4, 4, ): Delay = 4 + 3 + 4 = 11 § 20 bits (2, 5, 6, 5, 2): Delay = 9 26

Conditional Sum Adder (1) 27

Conditional Sum Adder (1) 27

Conditional Sum Adder (2) 28

Conditional Sum Adder (2) 28

Conditional Sum Adder (3) 0 1 2 3 A 0 0 1 1 0

Conditional Sum Adder (3) 0 1 2 3 A 0 0 1 1 0 1 B 1 0 1 1 0 Si 0 1 0 0 1 1 Ci 0 0 0 1 0 0 Si 1 0 1 1 0 0 Ci 1 1 0 1 1 1 Si 0 1 0 0 1 1 0 Ci 0 0 Si 1 1 0 1 Ci 1 0 Si 0 1 Ci 0 0 Si 1 1 Ci 1 0 S 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 S 1 1 0 29

Hybrid Designs: An Example Ø Combine CLA (Carry Look-Ahead) with RCA 30

Hybrid Designs: An Example Ø Combine CLA (Carry Look-Ahead) with RCA 30