Systems Fast Adder Shankar Balachandran* Associate Professor, CSE - - PowerPoint PPT Presentation

systems
SMART_READER_LITE
LIVE PREVIEW

Systems Fast Adder Shankar Balachandran* Associate Professor, CSE - - PowerPoint PPT Presentation

Spring 2015 Week 9 Module 51 Digital Circuits and Systems Fast Adder Shankar Balachandran* Associate Professor, CSE Department Indian Institute of Technology Madras *Currently a Visiting Professor at IIT Bombay Recursive Doubling Technique


slide-1
SLIDE 1

Shankar Balachandran* Associate Professor, CSE Department Indian Institute of Technology Madras

*Currently a Visiting Professor at IIT Bombay

Digital Circuits and Systems

Spring 2015 Week 9 Module 51

Fast Adder

slide-2
SLIDE 2

8 7 6 5 4 3 2 1 0

  • 15

6

  • 8

7 3

  • 2

1

Recursive Doubling Technique

To find the prefix sum of 8 numbers :

Request Data From 8,7 7,6 6,5 5,4 4,3 3,2 2,1 1,0 0 From previous stages if any; This input is assumed to be stable;

27

Next step will have :

slide-3
SLIDE 3

Step 2

8 7 6 5 4 3 2 1 0

  • 9
  • 2
  • 1

10 1

  • 1

1

8,7,6,5 7,6,5,4 6,5,4,3 5,4,3,2 4,3,2,1 3,2,1,0 2,1,0 1,0 0

12

Next step will have :

slide-4
SLIDE 4

Step 3

  • 10

8 9 2

  • 1

1 10

8 7 6 5 4 3 2 1 0

Next step will have : 8->1 7->0 6->0 5->0 4->0 3,2,1,0 2,1,0 1,0 0

slide-5
SLIDE 5

Step 4

  • 8

7 1 9 2

  • 1

1 19

Next step will have : 8->0 7->0 6->0 5->0 4->0 3,2,1,0 2,1,0 1,0 0

slide-6
SLIDE 6

Summary

  • Prefix Sum of n numbers in log n steps
  • Applicable for any semigroup operator like

min , max , add, mul etc. that is associative Reading Assignment : Change the last stage input 0 to 5 and start from Step 1. Check if you get 24 -3 12 6 14 7 4 6

slide-7
SLIDE 7

To Learn

 High speed Addition as a circuit

slide-8
SLIDE 8

n-bit Carry Ripple Addition

A(0) B(0) A(1) B(1) A(2) B(2) A(n-1) B(n-1) S(0) C(1) S(1) C(2) S(2) C(3) S(n-1) C(n) C(n-2)

Requires n steps in the worst case.

FA(0) FA(1) FA(2)

FA(n-1)

C(0)

slide-9
SLIDE 9

There’s Something About Carry

a(j) b(j) c(j) c(j+1) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

If a(j) = b(j) then c(j+1) = a(j) = b(j) If a(j) != b(j) then c(j+1) = c(j)

slide-10
SLIDE 10

Carry Look Ahead – Generate and Propagate

a(j) b(j) c(j+1) Status (x(j+1)) Kill (k) 1 c(j) Propagate (p) 1 c(j) Propagate (p) 1 1 1 Generate (g)

slide-11
SLIDE 11

CLA – Operation (*)

(*)

k p g k k k g p k p g g k g g

x(j) x(j+1)

y(j) = x(0) (*) x(1) (*) … x(j) x(0) = k If y(j) = k then c(j) = 0 If y(j) = g then c(j) = 1 Note that y(j) != p

New (j+1)th carry status as influenced by x(j) (*) is associative

slide-12
SLIDE 12

Carry Calculation

 A prefix computation

 y(0) = x(0) = k  y(1) = x(0) (*) x(1)  y(2) = x(0) (*) x(1) (*) x(2)  …….  y(n) = x(0) (*) x(1) (*) …. x(n)

slide-13
SLIDE 13

An 8-node Carry Look Ahead Adder

slide-14
SLIDE 14

Parallel Prefix circuit

  • Input x(1), … x(n) – for an n-bit CLA
  • Let x(0) = k if there is no carry in
  • If carry is available x(0) = g
  • Each x(i) is a 2-bit vector
  • We use the Recursive Doubling Technique

described earlier

slide-15
SLIDE 15

Example

  • Add two binary numbers

1 0 1 0 1 1 0 1 0 1 1 1 0 1 Expected 1 0 1 1 0 0 1 1

slide-16
SLIDE 16

Example

  • Generate sums in parallel

1 0 1 0 1 1 0 1 0 1 1 1 0 1 Expected 1 0 1 1 0 0 1 1 Sum 0 0 0 1 0 1 1 Ignore carries for now

slide-17
SLIDE 17

Example

  • Generate carries in parallel

1 0 1 0 1 1 0 1 0 1 1 1 0 1 Expected 1 0 1 1 0 0 1 1 Sum 0 0 0 1 0 1 1 Carry 1 0 1 0 1 0 0 Generate carries in parallel

slide-18
SLIDE 18

Example

  • Add sum and carry now (ignoring any carries that

are generated in this process 1 0 1 0 1 1 0 1 0 1 1 1 0 1 Expected 1 0 1 1 0 0 1 1 Sum 0 0 0 1 0 1 1 Carry 1 0 1 0 1 0 0 Add 1 0 1 0 0 0 1 1

Wrong in this position

slide-19
SLIDE 19

Prefix Idea for Carry

  • Generate sum in parallel – keep aside
  • Generate k, p or g also in parallel
  • Do parallel prefix carry computation
slide-20
SLIDE 20

g k g p g p p k

(Decimal example in first few slides is for 8 nodes, this example is for 7 bits ) Stable Carry In

7-Bit Carry Generation

1 0 1 0 1 1 0 1 0 1 1 1 0 1

slide-21
SLIDE 21

g k g p g p p k g k g g g p k g k g g g k k g k g g g k k

Stable Carry In

7-Bit Carry Generation

slide-22
SLIDE 22

g k g p g p p k g k g g g p k g k g g g k k g k g g g k k

Stable Carry In

Finally assign bits

1 0 1 1 1 0 0

slide-23
SLIDE 23

Getting back to addition

  • Add sum and carry now (ignoring any carries that

are generated in this process) 1 0 1 0 1 1 0 1 0 1 1 1 0 1 Expected 1 0 1 1 0 0 1 1 Sum 0 0 0 1 0 1 1 Carry 1 0 1 1 1 0 0 Add 1 0 1 1 0 0 1 1

Ignore carries now

slide-24
SLIDE 24

End of Week 9: Module 51

Thank You

Fast Adders 24