1 / 17

Fast Arithmetics

Fast Arithmetics. Full Adder. B i. A i. Cin. Cout. S i. Note: MSB is rightmost. Carry Ripple Adder. A 0. B 0. A 1. B 1. A 2. B 2. A 3. B 3. C 0 =0. C 1. C 2. C 3. C 4. S 0. S 1. S 2. S 3. Reduction. Changing the goal to: Calculate the Carry vector

ashton
Télécharger la présentation

Fast Arithmetics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fast Arithmetics

  2. Full Adder Bi Ai Cin Cout Si

  3. Note: MSB is rightmost Carry Ripple Adder A0 B0 A1 B1 A2 B2 A3 B3 C0=0 C1 C2 C3 C4 S0 S1 S2 S3

  4. Reduction • Changing the goal to: Calculate the Carry vector • In one time unit we can calculate S out of A,B,C • No effect on complexity

  5. Note: MSB is rightmost A3 A1 A2 A0 B0 B3 B1 B2 C0 C1 C2 C3 S0 S1 S2 S3

  6. Note: MSB is rightmost Current problem A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 C0=0 C1 C2 C3 C4 C5 C6 C7

  7. 1 1 ? 0 0 ? 1 0 ? Three Cases Generate: Cout = 1 Kill : Cout = 0 Propagate: Cout = Cin

  8. G/P gate Ai Bi G = A∙B P = A xor B G P

  9. Note: MSB is rightmost A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 C1 C2 C3 C4 C5 C6 C7 C8 C0=0 1+O(N) !

  10. Note: MSB is rightmost C2 C4 C6 C8 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 If we could have calculated every 2nd Carry C0=0 C1 C3 C5 C7

  11. Note: MSB is rightmost Calculate every 2nd Gi Pi Gi+1 Pi+1 Ci+2=1 iff Gi+1 or (Gi and Pi+1) Ci+2=0 iff Gi+1=0 and Pi+1=0 Ci+2=Ci iff Pi and Pi+1 Ci+2 Ci Ci+1 Gi Pi Gi+1 Pi+1 G’ = Gi+1 + Gi∙Pi+1 P’ = Pi∙Pi+1 G’ P’

  12. Note: MSB is rightmost G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 C2 C4 C3 C6 C0=0 C8 A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 C8 C1 C2 C3 C4 C5 C6 C7 C0=0 2+O(N/2)+1 !

  13. Note: MSB is rightmost A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 C1 C2 C3 C4 C5 C6 C7 C8 C0=0 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 C2 C4 C3 C6 C8 C0=0 C0=0 C4 C8 log(n) +log(n) = 2log(n) = O(log(n))

  14. Note: MSB is rightmost C0 A3 A1 A2 A0 B2 B3 B0 B1 C1 C2 C3 S0 S1 S2 S3 Final stage Overall complexity: O(log(n))+1=O(log(n))

  15. Note: MSB is rightmost Comparator A==B, A>B A0 B0 A1 B1 A2 B2 A3 B3 EQ1 EQ2 EQ3 EQ4 EQ0=1 GR1 GR2 GR3 GR4 GR0=0

  16. Note: MSB is rightmost Comparator A==B, A>B A0 B0 A1 B1 ALL-EQ1 iff A0A1==B0B1 ALL-EQ1 = EQ1∙EQ0 ALL-GR1 iffA0A1 > B0B1 ALL-GR1 = GR1 + GR0∙EQ1 GR0 EQ0 ALL-EQ1 ALL-GR1

  17. Note: MSB is rightmost A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 log(n) + 1 = O(log(n))

More Related