Docsity

Logic Gates and Adders: Understanding Parallel and Full Adders - Prof. Marie-Christine Bru, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 110 M.-C. Brunet
Adders, and 7-segment Display Handout 13
Logic Gates
Logic Blocks
(Label)
Inputs Outputs
Given or Known:
Truth Table
Given or Known: A description of its functioning.
The labels inside are explicit enough to produce a
function table (summary of the device functioning)
M.-C. BRUNET ECE 110 UIUC 13.1
G
Inputs Output
A Combinational Circuit
M.-C. BRUNET ECE 110 UIUC 13.2
Number of levels? It is the maximum
number of gates encountered on all paths
from inputs to output.
A
B
C
D
E
F
G
HI
J
F
pf3
pf4
pf5
pf8

Partial preview of the text

Download Logic Gates and Adders: Understanding Parallel and Full Adders - Prof. Marie-Christine Bru and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Logic Gates Logic Blocks

(Label)

Inputs

Outputs

Given or Known:Truth Table

Given or Known: A description of its functioning.The labels inside are explicit enough to produce afunction table (summary of the device functioning)

M.-C. BRUNET

ECE 110

UIUC

G

Inputs

Output

A Combinational Circuit

M.-C. BRUNET

ECE 110

UIUC

Number of levels? It is the maximumnumber of gates encountered on all pathsfrom inputs to output.

A BC DEFG H

IJ

F

A First Useful Circuit: for adding numbersRecall the notation for binary numbers:A = (a

n-

……a

a 1

)^02

ai^

is a binary digit (or ‘BIT’) = 0 or 1 The

decimal

value for A is: (

)^10

a^ n-

x^

n-1 2

+... + a

x 1

1 + a

x 0

Example 1:

M.-C. BRUNET

ECE 110

UIUC

)^10

)^10

Knowing your powers of 2 is useful……^ =^2

Example 2:

)^10

)^2

)^10

)^2

)^10

)^2

)^10

)^2

M.-C. BRUNET

ECE 110

UIUC

A^

J

B^

J

S^

J

In decimal:A = (

)^10

B = (

)^10

S = (

)^10

an-

b n-^

...... a

1

b^1

a^0

b^0

S^ n-

S^1

S^0

Parallel Adder: adding two n-bit numbers Example 3: Add A=(1101) and B=(0111)

carry

Parallel Adder

A = (a

n-

……a

a 1

)^02

and B = (b

n-

……b

b 1

)^02

Their sum is Sum(A,B) = S = (S

n-

……S

S 1

)^02

Using Gates Using Blocks

M.-C. BRUNET

ECE 110

UIUC

a^

b

c c

b

a

FAsum

carry

a b c0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

sum

carry

Full Adder: Implementation

Half Adder: Adding 2 bits together Using Gates

a^

b

HAsum

carry

a + b = (carry sum)^ Half Adder: Implementation

M.-C. BRUNET

ECE 110

UIUC

Example 6:

HA

carry sum

a b0 00 11 01 1

sum

carry

Overflow:Binary numbers are stored in registers:

a fixed number of bits.There is overflow if the result of the additioncannot be stored back in the destination register. Example 7: 4-bit registers.Numbers A and B are from example 3.

M.-C. BRUNET

ECE 110

UIUC

Parallel Adder

A

B

S^

(DestinationRegister)

Seven-segment display device

Functioning

M.-C. BRUNET

ECE 110

UIUC

f e

d

b c

a

a b c d e f g

g

LEDs, LCDs. Displays letters, numbers, symbols.

One segment is ON when thecorresponding input is equal to:

M.-C. BRUNET

ECE 110

UIUC

Displays g f e d c b a

Blank

abc de fg

7 outputs

Inputshow many?

(^

)^2

= (number displayed )

10

Decimal Number Display

Example 10: Design a Combinational Circuit, anumber display to display all decimal numbersChoice:

M.-C. BRUNET

ECE 110

UIUC

Example 11: What is displayed for:1) A = (011)

2

B = (101)

2

2) A = (001)

2

B = (001)

2

3) A = (101)

2

B = (111)

2

Decimal Number Display

Displays: Displays: Displays:

b^0

FA

a^2 b^2

FA

a^1 b^1 a^0

WXYZ

FA

How can we know what isdisplayed without lookingat the bits on all the wires?

M.-C. BRUNET

ECE 110

UIUC

SOLUTIONS:

G

F

Q

P^

F = sum (P, Q, 1)G = carry (P, Q, 1)

Give the truth table for F(P, Q) & G(P, Q)

FAcarry

sum

P Q

G

F

a = d = e = A + B

b = A + B

c = f = A + B

g = 1

A B

?

abcdef g

Design the combinational circuit such thatwhen AB = 00 (resp 01, 10, 11) it displays2 (resp.4, 6, 8)

c

b

a

M.-C. BRUNET

ECE 110

UIUC

Prove that the implementation below iscorrect (correctly producing the outputs fora Full Adder). Labels were added to help!

sum

carry

carry sum carrysum HA S1 HAS C C

Solution: let’s look at all the wires in the circuit; (C1, S1) = HA (a,b);(C2, S2) = HA (S1, c); check if indeed S2 is the sum of (a,b,c) andThe OR of (C1, C2) the corresponding carry. Complete solution belowHA(a,b)

HA(S1,c)

FA(a,b,c)

a b C1 S1 c C2 S2 OR(C1, C2) Carry Sum0 0

0

0

0

0

0

0

0

0

0 0

0

0

1

0

1

0

0

1

0 1

0

1

0

0

1

0

0

1

0 1

0

1

1

1

0

1

1

0

1 0

0

1

0

0

1

0

0

1

1 0

0

1

1

1

0

1

1

0

1 1

1

0

0

0

0

1

1

0

1 1

1

0

1

0

1

1

1

1

equal!