Docsity

Lecture Notes on Binary Adders: From Half-Adders to Carry-Look-Ahead Adders in ECE 410, Study Guides, Projects, Research of Logic

Toggle sidebar
bg1
ECE 410, Prof. A. Mason Lecture Notes 12.1
Binary Adder
• Binary Addition
– single bit addition
– sum of 2 binary numbers can be larger than either number
– need a “carry-out” to store the overflow
• Half-Adder
– 2 inputs (x and y) and 2 outputs (sum and carry)
x y x + y (binary sum)
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (binary, i.e. 2 in base-10)
x y s c
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
s = x ⊕y
c = x • y XOR
AND
HA
xy
c
s
half-adder symbol
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download Lecture Notes on Binary Adders: From Half-Adders to Carry-Look-Ahead Adders in ECE 410 and more Study Guides, Projects, Research Logic in PDF only on Docsity!

ECE 410, Prof. A. Mason

Lecture Notes 12.

Binary Adder

• Binary Addition

– single bit addition–^

sum of 2 binary numbers can be larger than either number

-^

need a “carry-out” to store the overflow

• Half-Adder

– 2 inputs (x and y) and 2 outputs (sum and carry)

x^

y^

x + y (binary sum)

0 + 0 = 00 + 1 = 11 + 0 = 11 + 1 = 10 (binary, i.e. 2 in base-10)

x^

y^

s^

c

s = x

y

c = x • y

XORAND

HA

x^

y

c

s

half-adder symbol

ECE 410, Prof. A. Mason

Lecture Notes 12.

Half-Adder Circuits

• Simple Logic

– using XOR gate

• Most Basic Logic

– NAND and NOR only circuits

x^

y^

s^

c

s = x

y

c = x • y

Take-home Questions: Which of these 3 half-adders will be fastest? slowest? why??Which has fewest transistors? Which transition has the critical delay?

ECE 410, Prof. A. Mason

Lecture Notes 12.

Full-Adder Circuits

• XOR-based FA • Other FA Circuits

– a few others options are covered in the textbook

•^

HA-based FA

Full-Adder Equations:

s

= ai

⊕i

b

⊕i

c

i^

and c

i+

= a

  • bi
  • ci
  • (ai

⊕i

b

)i

ECE 410, Prof. A. Mason

Lecture Notes 12.

Full Adder Circuits

• AOI Structure FA

– implements following SOP

equations

– sum delayed from carry

• Transmission Gate FA

– sum and carry have about

the same delay

AND

OR

INV

c^ i+

= a

  • bi
  • ci
  • (ai^

+i b

)i

s^ i

= (a

  • bi

  • ci

) • ci

i+

  • (a
  • bi

•ci

)i

ECE 410, Prof. A. Mason

Lecture Notes 12.

FA Using 2:1 MUX

• If we re-arrange the FA truth table

– can simplify the output (sum, carry) expressions

• Implementation

– use an XOR to make the decision (

a

b=0?

– use a 2:1 MUX to select which equation/value of sum

and carry to pass to the output

a^ i

b^ i

c i^

a^

⊕^

b s

c^ i+

0

0

0

0

0

0

1

1

0

0

0

1

0

0

1

0

1

0

1

1

1

0

1

1

0

1

0

1

1

0

1

0

0

1

1

0

0

1

1

1

0

1

1

0

1

1

0

1

If (A

⊕^

B = 0), SUM=Cin;

Cout=A;

Else,

SUM=Cin_bar;

Cout=Cin;

A B CinCin_bar

A Cin

Sum Cout A^

⊕

B

Partial Schematiccan you figure out

the details?

ECE 410, Prof. A. Mason

Lecture Notes 12.

Binary Word Adders

•^

Adding 2 binary (multi-bit) words^ –

adding 2 n-bit word produces an n-bit sum and a carry

-^

example: 4b addition

•^

Carry Bits^ –

binary adding of n-bits will produce an n+1 carry

-^

can be used as carry-in for next stage or as an overflow flag

•^

Cascading Multi-bit Adders^ –

carry-out from a binary word adder can be passed to next cellto add larger words

-^

example: 3 cascaded 4b binary adders for 12b addition

a

3

a

2

a

1

a

0

+ b

3

b

2

b

1

b

0

c

s

s

s

s

4b input a

  • 4b input b = carry-out, 4b sum

a^

b carry-out

a^

b^ carry-out

a^

b

carry-in

carry-out

carry-in

ECE 410, Prof. A. Mason

Lecture Notes 12.

Adder/Subtractor using R-C Adders

•^

Subtraction using 2’s complements–

2’s complement of X: X

2s

= X+

-^

invert and add 1

–^

Subtraction via addition: Y - X = Y + X

2s

•^

R-C Adder/Subtactor Cell–

control line, add_sub: 0 = add, 1 = subtract

-^

XOR used to pass (add_sub=1) or invert (add_sub=0)

-^

set first carry-in, c

, to 1 will add 1 for 2’s complement 0

b b

a = add_sub

ECE 410, Prof. A. Mason

Lecture Notes 12.

Ripple-Carry Adders in CMOS

•^

Simple to implement and connect for multi-bit addition–

but, they are very slow

•^

Worse-case delays in R-C Adders–

each bit in the cascade requires carry-out from the previous bit

-^

major speed limitation of R-C Adders

–^

delay depends somewhat on the type of FA implemented

-^

general assumptions

-^

worst delay in an FA is the sum

-^

but carry is more important due to cascade structure

-^

total delay is sum of delays to pass carry to final stage

-^

total delay for n-input R-C adder

tn

= t

(ad

,b 0

⇒ 0

c

) + (n-2) t 1

(cd

in^

⇒

c

out

) + t

(cd

in^

⇒

s

n-

)

first stage delay: inputs to carry-outmiddle stage (n-2) delay: carry-in to carry-outlast stage delay: carry-in to sum

basic FAcircuit

ECE 410, Prof. A. Mason

Lecture Notes 12.

Logic Circuits for a 4b CLA Adder

•Carry-out expressions for 4b CLA

  • c

= g 1

0

  • c

p^0

,^

c^2

= g

1

  • c

p^1

,^

c^3

= g

2

  • c

p^2

,^

c^4

= g

3

  • c

p^3

• Expressed only in terms of known inputs

  • c

2

= g

1

  • p

g^0

  • c

p^0

  • c

3

= g

2

  • p

2

• [

g^1

  • p

g^0

  • c

p^0

)]

  • c

4

= g

3

  • p

3

g^2

  • p

2

• [

g^1

  • p

g^0

  • c

p^0

)]

  • nested Sum-of-Products expressions– gets more complex for higher bit adders

• Sums obtained by an XOR with carries g^ i

= a

i^

- b

i

pi

= a

i^

b

i

simple complex

ECE 410, Prof. A. Mason

Lecture Notes 12.

CLA Carry Generation in Reduced CMOS

•^

Reduce logic by constructing a CMOS push-pull networkfor each carry term–

expanded carry terms

-^

c^1

= g

0

+ c

- 0 p^0 -^

c^2

= g

1

+ g

- 0 p^1

+ c

- 0 p^0 - p

1

-^

c^3

= g

2

+ g

- 1 p^2

+ g

- 0 p^1 - p

2

+ c

- 0 p^0 **- p

  • 1 p**^2 -^

c^4

= g

3

+ g

- 2 p^3

+ g

- 1 p^2 - p

3

+ g

- 0 p^1 **- p

  • 2 p**^3

+ c

- 0 p^0 **- p

  • 1 p**^2 - p

3

•^

nFETs network for each carry term–

pFET pull-up not shown

-^

notice nested structure

ECE 410, Prof. A. Mason

Lecture Notes 12.

Dynamic Logic –Quick Look

• Advantages: fewer transistors & less power consumption• General dynamic logic gate

  • nFET logic evaluation network– clocked “precharge” pull up pFET– clocked disabling nFET

• Precharge stage

  • clock-gated pull-up precharges output high– logic array disabled

• Evaluation stage

  • precharge pull-up disabled– logic array enabled & if true, discharges output

• Dynamic operation: output not always valid

generic dynamic

logic gate

ECE 410, Prof. A. Mason

Lecture Notes 12.

Manchester Carry Generation Concept

• Alternative structure for

carry evaluation

  • define

carry in terms of control signals such that

  • only one control is active at a given time
    • implement in

switch-logic

• Consider single bit FA truth table

p^

OR

g^

is high in 6 of 8 logic states

p^

and

g^

are not high at the same time

  • introduce carry-kill,

k

  • on/high when neither p or g is high • carry_out always 0 when

k=

  • only one control signal (p, g, k) is active for each state

a^ i

b^ i

c i^

ci+

0

0

0

0

0

1

0

0

1

0

0

0

1

1

0

1

0

0

1

0

0

1

1

1

1

0

1

1

1

1

1

1

p^ i

g^ i

k i

0

0

1

1

0

0

1

0

0

0

1

0

0

0

1

1

0

0

1

0

0

0

1

0

generate

gi

= a

  • i^

b

i

propagate

pi

= a

⊕i^

b

i

carry-kill

ki

= a

+i^

b

i

ECE 410, Prof. A. Mason

Lecture Notes 12.

Static CMOS Manchester Implementation • Manchester carry generation circuit• Static CMOS

  • modify for inverting logic
    • input

Æ

c

_bar & outputi

Æ

c

i+

_bar

• New truth table• Possible implementation

  • c

i+

= 1 if g

=0i

  • c

i+

= 0 if g

=1 AND pi

=0i

  • c

i+

c

i^

if p

=1i

  • but g

=0 here. problem?i

  • carry-kill is not needed

ai

bi

c i^

c^ i+

pi

gi 0

ECE 410, Prof. A. Mason

Lecture Notes 12.

Static CMOS Manchester Implementation • Textbook Circuit Implementation

  • c

i+

= 1 if g

=0i

  • c

i+

= 0 if g

=1 AND pi

=0i

  • c

i+

c

i^

if p

=1i

  • error
    • when g

=0, pi

=1, ci

=0, ci

i+

Æ

0

  • pulled low through M1• but M4 pulls it high

• Possible Correction?

  • insert switch in pull-up path to disable when c

=0i

  • solves error when g

=0, pi

=1, ci^

=0i

Æ

c

i+

  • but introduces error when g

=0, pi

=1, ci^

=0i^

Æ

c

i+

  • M4 can not pull high since new nMOS cuts off path

static CMOS from textbook

ci

ai

bi^

c^ i^

c^ i+

0

0

1

1

0

1

1

1

1

0

1

1

1

1

1

0

0

0

0

1

0

1

0

0

1

0

0

0

1

1

0

0

pi

gi 0

0 1

0 1

0 0

1 0

0 1

0 1

0 0

1