arithmetic circuitsbwrcs.eecs.berkeley.edu/classes/icdesign/ee141_f02/... · 2002-10-21 · 3 ee141...

18
1 EE141 Adders EE141- Fall 2002 Lecture 17 EE141 Announcements l Homework 7 due next Tuesday l No lab this week l Project launch today: 32-bit ALU

Upload: others

Post on 18-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

1

EE141

Adders

EE141- Fall 2002Lecture 17

EE141

Announcements

l Homework 7 due next Tuesdayl No lab this weekl Project launch today: 32-bit ALU

Page 2: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

2

EE141

Today’s lecture

l Adder design

EE141

Arithmetic Circuits

Page 3: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

3

EE141

A Generic Digital Processor

MEMORY

DATAPATH

CONTROL

INP

UT

-OU

TPU

T

EE141

Building Blocks for Digital Architectures

Arithmetic unit

- Bit-sliced datapath (adder , multiplier, shifter, comparator, etc.)

Memory

- RAM, ROM, Buffers, Shift registers

Control

- Finite state machine (PLA, random logic.)

- Counters

Interconnect

- Switches

- Arbiters

- Bus

Page 4: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

4

EE141

An Intel Microprocessor

9-1

Mux

9-1

Mux

5-1

Mux

2-1

Mux

ck1

CARRYGEN

SUMGEN+ LU

1000um

b

s0

s1

g64

sum sumb

LU : LogicalUnit

SUM

SEL

a

to Cache

node1

REG

Itanium has 6 integer execution units like this

EE141

Bit-Sliced Design

Bit 3

Bit 2

Bit 1

Bit 0

Reg

iste

r

Add

er

Shif

ter

Mul

tiple

xer

Control

Dat

a-In

Dat

a-O

ut

Tile identical processing elements

Page 5: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

5

EE141

Bit-Sliced Datapath

Adder stage 1

Wiring

Adder stage 2

Wiring

Adder stage 3

Bit slice 0

Bit slice 2

Bit slice 1

Bit slice 63

Sum Select

Shifter

Multiplexers

Loopback Bus

From register files / Cache / Bypass

To register files / CacheLoopback B

us

Loopback Bus

EE141

Itanium Integer Datapath

Fetzer, Orton, ISSCC’02

Page 6: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

6

EE141

Full-Adder

A B

Cout

Sum

Cin Fulladder

EE141

The Binary Adder

S A B Ci⊕ ⊕=

A= BCi ABCi ABCi ABCi+ + +

Co AB BCi ACi+ +=

A B

Cout

Sum

Cin Fulladder

Page 7: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

7

EE141

Express Sum and Carry as a function of P, G, D

Define 3 new variable which ONLY depend on A, B

Generate (G) = AB

Propagate (P) = A ⊕ B

Delete = A B

Can also derive expressions for S and Co based on Dand P

EE141

The Ripple-Carry Adder

A0 B0

S0

Co,0Ci,0

A1 B1

S1

Co,1

A2 B2

S2

Co,2

A3 B3

S3

Co,3

(= Ci,1)FA FA FA FA

Worst case delay linear with the number of bits

tadder N 1–( )tcarry tsum+≈

td = O(N)

Goal: Make the fastest possible carry path circuit

Page 8: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

8

EE141

Complimentary Static CMOS Full Adder

VDD

VDD

VDD

VDD

A B

Ci

S

Co

X

B

A

Ci A

BBA

Ci

A B Ci

Ci

B

A

Ci

A

B

BA

28 Transistors

EE141

Inversion Property

A B

S

CoCi FA

A B

S

CoCi FA

Page 9: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

9

EE141

Minimize Critical Path by Reducing Inverting Stages

A0 B0

S0

Co,0Ci,0

A1 B1

S1

Co,1

A2 B2

S2

Co,2 Co,3FA’ FA’ FA’ FA’

A3 B3

S3

Odd CellEven Cell

Exploit Inversion Property

EE141

The better structure: the Mirror Adder

VDD

Ci

A

BBA

B

A

A BKill

Generate"1"-Propagate

"0"-Propagate

VDD

Ci

A B Ci

Ci

B

A

Ci

A

BBA

VDD

SCo

24 transistors

Page 10: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

10

EE141

The Mirror Adder

• The NMOS and PMOS chains are completely symmetrical. This guarantees identical rising and falling transitions if the NMOS and PMOS devices are properly sized. A maximum of two series transistors can be observed in the carry-generation circuitry.

• When laying out the cell, the most critical issue is the minimization of the capacitance at node Co. The reduction of the diffusion capacitances is particularly important.

• The capacitance at node Co is composed of four diffusion capacitances, two internal gate capacitances, and six gate capacitances in the connecting adder cell .

• The transistors connected to Ci are placed closest to the output.

• Only the transistors in the carry stage have to be optimized for optimal speed. All transistors in the sum stage can be minimal size.

EE141

Transmission Gate Full Adder

A

B

P

Ci

VDDA

A A

VDD

Ci

A

P

AB

VDD

VDD

Ci

Ci

Co

S

Ci

P

P

P

P

P

Sum Generation

Carry Generation

Setup

Page 11: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

11

EE141

Manchester Carry Chain

CoCi

Gi

Di

Pi

Pi

VDD

CoCi

Gi

Pi

VDD

φ

φ

EE141

Manchester Carry Chain

G2

φ

C3

G3

Ci,0

P0

G1

VDD

φ

G0

P1 P2 P3

C3C2C1C0

Page 12: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

12

EE141

Manchester Carry Chain

Pi + 1 Gi + 1 φ

Ci

Inverter/Sum Row

Propagate/Generate Row

Pi Gi φ

Ci - 1Ci + 1

VDD

GND

Stick Diagram

EE141

Carry-Bypass Adder

FA FA FA FA

P0 G1 P0 G1 P2 G2 P3 G3

Co,3Co,2Co,1Co,0Ci,0

FA FA FA FA

P0 G1 P0 G1 P2 G2 P3 G3

Co,2Co,1Co,0Ci,0

Co,3

Mul

tiple

xer

BP=PoP1P2P3

Idea: If (P0 and P1 and P2 and P3 = 1)then Co3 = C0, else “kill” or “generate”.

Also called Carry-Skip

Page 13: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

13

EE141

Carry-Bypass Adder (cont.)

Setup

CarryPropagation

Sum

Setup

CarryPropagation

Sum

Setup

CarryPropagation

Sum

Setup

CarryPropagation

Sum

Bit 0-3 Bit 4-7 Bit 8-11 Bit 12-15

Ci,0

EE141

Carry Ripple versus Carry Bypass

N

tp

ripple adder

bypass adder

4..8

Page 14: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

14

EE141

Carry-Select Adder

Setup

"0" Carry Propagation

"1" Carry Propagation

Multiplexer

Sum Generation

Co,k-1 Co,k+3

"0"

"1"

P,G

Carry Vector

EE141

Carry Select Adder: Critical Path

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Bit 0-3 Bit 4-7 Bit 8-11 Bit 12-15

S0-3 S4-7 S8-11 S12-15

Co,15Co,11Co,7Co,3Ci,0

Page 15: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

15

EE141

Linear Carry Select

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Bit 0-3 Bit 4-7 Bit 8-11 Bit 12-15

S0-3 S4-7 S8-11 S12-15

Ci,0

(1)

(1)

(5)(6) (7) (8)

(9)

(10)

(5) (5) (5)(5)

EE141

Square Root Carry Select

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Setup

"0" Carry

"1" Carry

Multiplexer

Sum Generation

"0"

"1"

Bit 0-1 Bit 2-4 Bit 5-8 Bit 9-13

S0-1 S2-4 S5-8 S9-13

Ci,0

(4) (5) (6) (7)

(1)

(1)

(3) (4) (5) (6)

Mux

Sum

S14-19

(7)

(8)

Bit 14-19

(9)

(3)

Page 16: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

16

EE141

Adder Delays - Comparison

0.0 20.0 40.0 60.0N

0.0

10.0

20.0

30.0

40.0

50.0tp

ripple adder

linear select

square root select

EE141

LookAhead - Basic Idea

A0,B0 A1,B1 AN-1,BN-1...

Ci,0 P0 Ci,1 P1Ci,N-1 PN-1

...

Co k, f Ak Bk Co k, 1–, ,( ) Gk P kCo k 1–,+= =

Page 17: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

17

EE141

Look-Ahead: Topology

VDD

P3

P2

P1

P0

G3

G2

G1

G0

Ci,0

Co,3

Co k, Gk Pk Gk 1– Pk 1– Co k 2–,+( )+=

Co k, Gk Pk Gk 1– P k 1– … P1 G0 P0 Ci 0,+( )+( )+( )+=

Expanding Lookahead equations:

All the way:

EE141

Logarithmic Look-Ahead Adder

A7

F

A6A5A4A3A2A1

A0

A0

A1

A2A3

A4A5

A6

A7

F

tp∼ log2(N)

tp∼ N

Page 18: Arithmetic Circuitsbwrcs.eecs.berkeley.edu/Classes/icdesign/ee141_f02/... · 2002-10-21 · 3 EE141 A Generic Digital Processor MEMORY DATAPATH CONTROL I N P U T-O U T P U T EE141

18

EE141

Carry Lookahead Trees

Co 0, G0 P0Ci 0,+=

Co 1, G1 P1 G0 P1P0 Ci 0,+ +=

Co 2, G2 P2G1 P2 P1G0 P+ 2 P1P0C i 0,+ +=

G2 P2G1+( )= P2P1( ) G0 P0Ci 0,+( )+ G 2:1 P2:1Co 0,+=

Can continue building the tree hierarchically.

EE141

Tree Adders

Radix-2 Kogge-Stone Tree

(A0,

B0)

(A1,

B1)

(A2,

B2)

(A3,

B3)

(A4,

B4)

(A5,

B5)

(A6,

B6)

(A7,

B7)

(A8,

B8)

(A9,

B9)

(A10

, B10

)

(A11

, B11

)

(A12

, B12

)

(A13

, B13

)

(A14

, B14

)

(A15

, B15

)

S0

S1

S2

S3

S4

S5

S6

S7

S8

S9

S10

S11

S12

S13

S14

S15