Docsity

Digital Logic Design Outline, Summaries of Logic

Toggle sidebar
bg1
1
Week3 1
Digital Logic Design
Week 4
Combinational Design
Week3 2
Outline
• Combinational Circuits
• Analysis Procedure
• Design Procedure
• Adders and multipliers
• Comparators
• Decoders and Encoders
• Multiplexers
• HDL For Combinational Circuits
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Digital Logic Design Outline and more Summaries Logic in PDF only on Docsity!

Week3 1

Digital Logic Design

Week 4

Combinational Design

Week3 2

Outline

• Combinational Circuits

• Analysis Procedure

• Design Procedure

• Adders and multipliers

• Comparators

• Decoders and Encoders

• Multiplexers

• HDL For Combinational Circuits

Week3 3

Combinational Circuits

• What is a combinational circuit?

• What is the difference between

combinational and sequential circuits

• Implementation MSI and standard cells in

ASIC

Week3 4

Analysis Procedure

1. Label all gate outputs that are a function of

input variables with arbitrary symbols. Find the

Boolean function of these gates

2. Label all the gates that are functions of input

variables and previously labeled gates with

arbitrary symbols. Find the Boolean function of

these gates.

3. Repeat step 3 until the outputs of all the gates

are labeled

4. By repeated substitution of previously defined

functions, obtain the output Boolean functions

in terms of input variables (or truth table)

Week3 7

Binary Adder-Subtractor

• Half adder: S=x’y+xy’, C=xy

Week3 8

Full Adder

1 1 1 1 1

1 1 0 1 0

1 0 1 1 0

1 0 0 0 1

0 1 1 1 0

0 1 0 0 1

0 0 1 0 1

0 0 0 0 0

x y z s c

Week3 9

x

yz 00 01 11 10

y

Z

X 1 1 1

x

yz 00 01 11 10

y

Z

X

Week3 10

Full Adder

Week3 13

Carry Propagation

Pi

G (^) i

Ai Bi

Ci

Si Ci+

Pi=Ai ⊕ Bi G (^) i=AiBi G is called the carry Generator

Si=Pi ⊕ Ci Ci+1 =G (^) i+PiCi Carry if either Gi or on of A,B and C

Gi=1 if Ai and Bi=

Week3 14

Carry Lookahead

• G i is called the carry Generator, and Pi is

the carry propagate.

• We can calculate the carry at every stage

by recursively substituting Ci

C 0 =input carry

C 1 =G 0 +P 0 C 0

C 2 =G 1 +P 1 C 1 = G 1 + P 1 G 0 + P 1 P 0 C 0

C 3 =G 2 +P 2 C 2 = G 2 + P 2 G 1 + P 2 P 1 G 0 + P 2 P 1 P 0 C 0

Circuit in Figure 4-

Week3 15

4-Bit adder with Carry Lookahead

P 3

G 3 C 3

P 2

G 2 C 2

P

G 1 C 1

P

G 0 C 1

AiBi P 3

C 4

S 3

P 2

P 1

P 0

Week3 16

Adder/Subtractor

FA

S 0

B 0 A

0

FA

S 3

FA

S 2

FA

S 1

C 4

V

Week3 19

Decimal Adder

Binary Sum K 0 Z8 0 Z4 0 Z2 0 Z1 0 (^00 00 00 01 ) (^00 00 01 10 ) 0 0 1 0 1 (^00 00 11 11 ) (^00 11 00 00 ) 0 1 0 1 0 (^00 11 01 10 ) (^00 11 11 01 ) (^01 10 10 10 ) (^11 00 00 01 ) 1 0 0 1 1

BCD Sum K 0 Z8 0 Z4 0 Z2 0 Z1 0 (^00 00 00 01 ) (^00 00 01 10 ) 0 0 1 0 1 (^00 00 11 11 ) (^00 11 00 00 ) 1 0 0 0 0 (^11 00 00 01 ) (^11 00 01 10 ) (^11 00 11 01 ) (^11 01 10 10 ) 1 1 0 0 1

Decimal (^01) (^23) (^45) (^67) 8 (^910) (^1112) (^1314) (^1516) (^1718) 19

Week3 20

Decimal Adder

  • The output of the BCD could be anything between 0

and 19 (9+9+carry).

  • From the truth table, it is clear that there is a carry

(BCD carry) if any one of the following occurs

1. K =1 1 (if the number is greater than 16).

2. Z 8 =1 and Z 4 =

3. If Z 8 =1 and Z 2 =

  • If there is a carry, we must add 6 to the binary number

to get the BCD code.

  • That leads to the following circuit

Week3 21

Decimal Adder

4-bit binary adder

(^0) 4-bit binary adder

Cout

Z 8 Z 4 Z 2 Z 1

Cin

Week3 22

Binary Multiplier

• First, consider 2 bit multiplier

B 1 B 0

A 1 A 0

A 0 B 1 A 0 B 0

A 1 B 1 A 1 B 0

C 3 C 2 C 1 C 0

HA HA

C 3 C 2 C 1 C 0

A 0

A 1

B 1 B 0

B 1

B 0

Week3 25

Magnitude Comparator

• The two numbers are equal iff all the bits in the 2

numbers are equal. That leads to a design of

4EX-OR followed by inverter (actually ex-nor)

and an or gate.

• For A to be greater than B, we must have A i > Bi

and Aj=B i j>i.

• So, we start at digit 3, compare A 3 and B 3 , either

one is greater or they are equal we move to A 2

and B 2 and so on.

• If we define x i to be the ex-nor of Ai and Bi i.e. x i

is 1 if Ai=Bi

Week3 26

Magnitude Comparator

• In this case,

• (A=B)=x 3 x 2 x 1 x 0

• (A>B)=A 3 B’ 3 +x 3 A 2 B’ 2 + x 3 x 2 A 1 B’ 1 +x 3 x 2 x 1 A 0 B’ 0

• (A>B) replace the prime from B to A.

• Circuit is shown in Figure 4-

Week3 27

Decoders

• A decoder is a combinational circuit that

converts binary information from n inputs

to a maximum of 2 n^ outputs.

• A decode is called n -to- m decoder, where

m ≤ 2 n

• Consider 3-8 decoder, truth table with 3

inputs x,y,z and 8 outputs D 7 .. D 0 the

circuit is shown in Figure 4-

Week3 28

Decoders

  • From truth table, circuit for 2x4 decoder is:
  • Note: Each output is a 2-variable minterm ( X'Y', X'Y, XY' or XY )

X Y F 0 F 1 F 2 F (^3) 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1

F 0 = X'Y'

F 1 = X'Y

F 2 = XY'

F 3 = XY

2-to-4 X^ Y Decoder

X Y

F F F F

Week3 31

Decoders

Week3 32

Decoders

• A decoder with an Enable input can function as

a de multiplexer

• A demultiplexer is a circuits that receives data

from a single line, and direct it to a possible of 2 n

lines (example sharing a communication line).

• The decoder in the previous slide can function

as a demultiplexer if we consider E to be the

data and A, and B to be the input selection.

• Verify this by assuming selection 10 and

determine the output (always equal to E).

Week3 33

Decoders

• Decoders with enable

can be connected

together to form a

larger decoder

3 x 8 decoder E

3 x 8 decoder E

D 0 to D 7

D 8 to D 15

X Y z w

Week3 34

Decoders

• Any n-variable logic function can be implemented

using a single n-to-2 n^ decoder to generate the

minterms

  • OR gate forms the sum.
  • The output lines of the decoder corresponding to the

minterms of the function are used as inputs to the or

gate.

• Any combinational circuit with n inputs and m

outputs can be implemented with an n-to-2 n^ decoder

with m OR gates.

• Suitable when a circuit has many outputs, and each

output function is expressed with few minterms.

Week3 37

Encoders

• Encoders perform the reverse operation of a

decoder.

• An encoder has up to 2 n^ input lines, and n output

lines.

• The encoder generates the binary code

corresponding to the active input line.

• Truth table with 8 variables and three outputs,

only need 1 in every row

• x=D 1 +D 3 +D 5 +D 7 ; y = D 2 +D 3 +D 6 +D 7 ;

Z=D 4 +D 5 +D 5 +D 7

Week3 38

Encoders Inputs Outputs

I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 y 2 y 1 y (^0) 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 I^0 0 0 0 0 0 0 1 1 1 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 y^0 = I^1 + I^3 + I^5 + I^7

y 1 = I 2 + I 3 + I 6 + I (^7)

y 2 = I 4 + I 5 + I 6 + I (^7)

Week3 39

Priority Encoders

• Priority encoders are encoders with a certain

priority scheme.

• If more than one input is active, the one with the

higher priority is encoded.

• The following figure shows the truth table for a

priority encoder.

• Note than there is a valid bit. The valid bit

indicates if the output is valid or not, if non of the

input is active, the V bit is 0, means nothing is

active

Week3 40

Priority Encoders

  • What if more than one input line has a value of 1?
  • Ignore “lower priority” inputs.
  • Idle indicates that no input is a 1.
  • Note that polarity of Idle is opposite from Table 4-8 in Mano Inputs Outputs I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 y 2 y 1 y 0 Idle 0 0 0 0 0 0 0 0 x x x 1 1 0 0 0 0 0 0 0 0 0 0 0 X 1 0 0 0 0 0 0 0 0 1 0 X X 1 0 0 0 0 0 0 1 0 0 X X X 1 0 0 0 0 0 1 1 0 X X X^ X 1 0 0 0 1 0 0 0 X X X X X 1 0 0 1 0 1 0 X X X X X X 1 0 1 1 0 0 X X X X X X X 1 1 1 1 0