arithmetic
play

Arithmetic Division Distributed Arithmetic Newton Raphson Newton - PowerPoint PPT Presentation

Advanced Digital IC Design Advanced Digital IC Design Number Representation Addition Multiplication Arithmetic Division Distributed Arithmetic Newton Raphson Newton Raphson CORDIC Unsigned Number Representation Example: Unsigned Number


  1. Advanced Digital IC Design Advanced Digital IC Design Number Representation Addition Multiplication Arithmetic Division Distributed Arithmetic Newton Raphson Newton Raphson CORDIC Unsigned Number Representation Example: Unsigned Number − Fixed radix (base) systems l ∑ i i = { } ∈ 10 a a {0,1, 2, ... 9} in radix 10 = − ∈ − i k i k 1 1 The digits a {0,1, 2, ... r 1} in a radix system : r − − − − = k 1 + k 2 + + 1 l � � − 10 a 10 a 10 a a 10 a 10 a − − − − l k 1 k 2 1 0 1 l ∑ i = × r a i = − i k 1 − − − − − l = k 1 + k 2 1 + 0 + 1 l � � ∑ i i = { } r a r a r a r a r a r a ∈ − − − − 2 a a { 0,1} in radix 2 k 1 k 2 1 0 1 l = − i k 1 described in a fixed point positional num ber system : − − − − = k 1 + k 2 + + 1 l � � 2 a 2 a 2 a a 2 a 2 a − − − − � � k 1 i 2 1 0 1 l a a a a . a a − − − i i 1 1 0 1 l �� � ��� � Fractional part 1

  2. Signed Digit Number Representation Two’s Complement ∈ ∈ − α − − α The digits a {0, 1} in a radix 2 system : … … The digits a { , 0, r 1 } in a radix system : r − − l l − − × + ∑ ∑ × = k k 1 1 i i ∑ i i 2 2 a − 2 2 a × r a k 1 i k = − = i k 2 i k − − − − = − + + + k 1 k 2 � 1 0 1 � l 2 a 2 a 2 a 2 a 2 a 2 a − − − − k 1 k 2 1 0 1 l ∈ − − … … Exam ple Radix 1 0 : a { 4, 3, 0, 4, 5} − = 2 − 1 + + 0 = − + + = × × (3 (3 1 5) 1 5) 10 10 3 3 10 10 1 10 5 1 10 5 300 300 10 10 5 5 295 295 described in a fixed point positional num ber system : described in a fixed point positional num ber system : 10 10 − − � � − = − 1 + 2 = − + = a a a a . a a − − − − × × (3 . 1 5) 3 10 1 10 5 3 0.1 0.05 2.95 k 1 k 2 1 0 1 l ��� � �� � 10 Fractional part Modified Booth’s recoding - a Sign Bits signed digit radix 4 representation Sign Extension in Two’s Complement Addition − − − k 1 + k 2 + � = 2 2 2 a a a a − − k 1 k 2 1 0 Addition is the most common arithmetic − − − + + + k k k k 1 1 k k 2 2 � = 2 2 a 2 2 a 2 2 a 2 2 a a operation in digital processors ti i di it l − − − k 1 k 1 k 2 1 0 + − − − k 1 k + k 1 + k 2 + � + 2 a 2 a 2 a 2 a 2 a a − − − − k 1 k 1 k 1 k 2 1 0 Also the basis of most other arithmetic operations like multiplication Example: division division = = = = � 10010 110010 1110010 11110010 square root … = = = = � 00010 000010 0000010 00000010 2

  3. Addition Addition: Sign Extension Ripple Carry Adder (RCA) A 0 B 0 A 1 B 1 A 2 B 2 A 0 B 0 A 1 B 1 A 2 B 2 A 3 B 3 FA FA FA FA FA FA FA FA FA C i,0 C o,0 C o,1 C o,2 C o,3 S 0 S S 1 S S S 2 S S 3 S S 4 S 0 S 1 S 2 S 3 Critical Path through all adder cells Adding More Numbers Adding More Numbers Carry Ripple Adders in a Chain Carry Ripple Adders in a Tree A 0 B 0 A B A 0 B 0 A B HA FA FA FA HA FA FA FA C 0 C C 0 D 0 C D HA FA FA FA HA FA FA FA D 0 D HA FA FA FA HA FA FA FA S 0 S S 0 S Critical Path through 6 Critical Path through 5 adder cells adder cells 3

  4. Adding More Numbers Pipelining Carry Save Adder (CSA) Ripple Carry Adders in a Chain A 0 B 0 C 0 A 0 B 0 A B FA FA FA FA HA FA FA FA D 0 C 0 C R R R R R HA FA FA FA HA FA FA FA D 0 D R R R R R Vect or Vect or FA FA FA HA FA FA FA Merging Adder S 0 S S 0 Only One Critical Path Critical Path through 4 (through 5 adder cells) adder cells R = Register Pipelining Latency Ripple Carry Adders in a Tree Latency: The number of clock cycles it takes before we se the result A 0 B 0 A B HA FA FA FA Latency time: Latency * cycle time C 0 D 0 C D HA FA FA FA A 0 B 0 A B A 0 B 0 A B R R R R R R R R R R HA FA FA FA HA FA FA FA C 0 C C 0 D 0 C D R R R R R HA FA FA FA HA FA FA FA HA FA FA FA D 0 D R R R R R R R R R R R R R R R HA FA FA FA S HA FA FA FA S 0 S S 0 S S 0 Lower Latency than the Chain Adder R = Register 4

  5. Pipelining Pipelining for fast addition Carry Save Adder (CSA) with Carry Look Ahead (CLA) Carry Save Adder (CSA) A 0 B 0 C 0 A 0 B 0 C 0 FA FA FA FA FA FA FA FA Register for D 0 D 0 R R R R R R R R R R R R R R R R both Sum and Carry HA FA FA FA HA FA FA FA needed R R R R R R R R R R R R R R R R CLA CLA Vector CLA FA FA FA Merging Merging Adder Adder S 0 S 0 Critical Path: 1 cell in CSA Very Short Critical Path and 3 in vector merging R = Register Vector Merging Adder - CLA Generate & Propagate The CLA is done in blocks B C i S C o A A common maximum is 4 bits per block 0 0 0 0 0 0 0 0 0 Delete 0 Delete Larger blocks are to complex 0 0 1 1 0 Delete A B 0 1 0 1 0 Propagate A 0 B 0 A 1 B 1 A 2 B 2 A 3 B 3 A 4 B 4 A 5 B 5 A 6 B 6 A 7 B 7 A 8 B 8 0 1 1 0 1 Propagate FA C i C o 1 0 0 1 0 Propagate CLA CLA CLA C o,2 C o,5 C o,8 1 1 0 0 1 1 0 0 1 Propagate 1 Propagate S C 0 P 0 C 1 P 1 C 2 P 2 C 3 P 3 C 4 P 4 C 5 P 5 C 6 P 6 C 7 P 7 C 8 P 8 1 1 0 0 1 Generate 1 1 1 1 1 Generate S 0 S 1 S 2 S 3 S 4 S 5 S 6 S 7 S 8 5

  6. Generate, Propagate Carry Look Ahead (CLA) = + = C G C P Delete, D A B o,0 0 i,0 0 = + = + + Functions C G C P G G P C P P = ⊕ ⊕ o,1 1 o,0 1 1 0 1 i,0 0 1 Propagate Propagate, P P A A B B of A and B = + = + + + C G C P G G P G P P C P P P o,2 2 o,1 2 2 1 2 0 1 2 i,0 0 1 2 = = + = + + + + Generate, A B A+ B G AB C G C P3 G G P G P P G P P P C P P P P o,3 3 o,2 3 2 3 1 2 3 0 1 2 3 i,0 0 1 2 3 0 0 0 0 1 1 1 0 1 = ⊕ ⊕ = ⊕ S A B C P C 1 1 1 = + + = + + = C AB AC BC AB ( A B C ) o = + + ⊕ = + AB ( AB A B C ) G PC C o,0 C o,1 C o,2 C o,3 Redundant Carry Look Ahead (CLA): Precharged Carry Look Ahead (CLA) = + C G C P o,0 0 i,0 0 = + = + + C G C P G G P C P P o,1 1 o,0 1 1 0 1 i,0 0 1 φ = + = + + + C G C P G G P G P P C P P P o,2 o 2 2 2 o,1 o 1 2 2 2 2 1 1 2 2 0 0 1 1 2 2 i 0 i,0 0 0 1 1 2 2 P 0 P 1 P 2 P 3 = + = + + + + C G C P3 G G P G P P G P P P C P P P P o,3 3 o,2 3 2 3 1 2 3 0 1 2 3 i,0 0 1 2 3 C i G 0 G 1 G 2 G 3 φ φ Alternative P 0 P 1 P 2 P 3 structure structure φ C i G 0 G 1 G 2 G 3 P 0 P 1 P 2 P 3 φ C i G 0 G 1 G 2 G 3 φ 6

  7. Carry Look Ahead (CLA): Manchester Logarithmic Adder Look Ahead = + C G PC = + = + + + + o ,0 0 0 i ,0 C G C P 3 G G P G P P G PP P C P PP P one step Look Ahead o ,3 3 o ,2 3 2 3 1 2 3 0 1 2 3 i ,0 0 1 2 3 two steps V DD G 3 = + = + + = + C G PC G G P PP C G P C � � �� � � o ,1 1 1 o ,0 1 0 1 1 0 i ,0 1:0 1:0 i ,0 G 2 Propagate P ( ) Generate G ( ) 1:0 1:0 G 1 G 0 = + = + + + = + + C G P C G P G ( G P ) P PP C G P G P P C � � �� � � o ,2 2 2 o ,1 2 2 1 0 1 2 1 0 i ,0 2 2 1:0 2 1:0 i ,0 C i ,0 P G C o ,3 1:0 1:0 P 0 = + = + + + = + + C G PC G P G ( G P ) P P P C G PG P P C � � �� � � o ,3 2 3 o ,2 3 3 2 1 2 3 2 1 i ,1 3 3 2:1 3 2:1 o ,0 P 1 G P 2:1 2:1 P 2 P 3 Logarithmic Adder, 4 bit Logarithmic Adder, 16 bit = + A 0 G G G P P&G C o,0 1:0 1 0 1 B 0 Creation + = G PC A 1 One step Look Ahead P PP P&G C o,1 0 0 i ,0 B 1 Creation 1:0 1 0 A 2 P&G A 0 G 0 P 0 C o,2 B 2 Creation P&G = + Two step Look Ahead C G PC A 3 P&G Creation Creation C o 3 o o ,0 0 0 0 0 0 i i ,0 0 B B 0 B B 3 Creation Creation o,3 A 4 P&G C o4 B 4 Creation A 1 G 1 P 1 A 5 P&G C o,5 P&G = + B 5 Creation C G P C Four step Look Ahead Creation o ,1 1:0 1:0 i ,0 A 6 P&G B 1 C o,6 B 6 Creation A 7 P&G C o,7 B 7 Creation An N bit adder A 2 G 2 P 2 A 8 P&G P&G = + + C o,8 B 8 Creation C G PG P P C is computed in Creation o ,2 2 2 1:0 2 1:0 i ,0 B 2 A 9 P&G C o,9 B 9 Creation log ( N ) stages log 2 ( N ) stages A 10 P&G C o,10 Creation B 10 A 3 G 3 P 3 P&G = + + A 11 P&G C o,11 C G PG P P C Creation B 11 Creation o ,3 3 3 2:1 3 2:1 o ,0 Eight step Look Ahead B 3 A 12 P&G C o,12 Creation B 12 A 13 P&G C o,13 Creation = + B 13 G G G P Kogge-Stone = G i:j P i:j creation 2:1 2 1 2 A 14 P&G C o,14 Creation B 14 = P P P adder A 15 2:1 2 1 P&G C o,15 Creation B 15 7

Recommend


More recommend