Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of...

39
1 1 Electrical and Computer Engineering CPE/EE 422/522 Chapter 1 - Review of Logic Design Fundamentals Dr. Rhonda Kay Gaede UAH Electrical and Computer Engineering Page 2 of 77 UAH CPE/EE 422/522 Chapter 1 Combinational Logic has no control inputs. When the inputs to a combinational network change, the output changes ____________________________. 1.1 Combinational Logic x 1 x 2 x n z 1 z 2 z m X = x 1 x 2 ... x n Z = z 1 z 2 ... z m

Transcript of Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of...

Page 1: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

1

1Electrical and Computer Engineering

CPE/EE 422/522

Chapter 1 - Review of Logic Design Fundamentals

Dr. Rhonda Kay Gaede

UAH

Electrical and Computer EngineeringPage 2 of 77

UAH CPE/EE 422/522Chapter 1

• Combinational Logic has no control inputs. When the inputs to a combinational network change, the output changes ____________________________.

1.1 Combinational Logic

x1x2

xn

z1z2

zm

X = x1 x2... xn

Z = z1 z2... zm

Page 2: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

2

Electrical and Computer EngineeringPage 3 of 77

UAH CPE/EE 422/522Chapter 11.1 Combinational Logic -

Basic Logic Gates

Electrical and Computer EngineeringPage 4 of 77

UAH CPE/EE 422/522Chapter 11.1 Combinational Logic -Full Adder (Minterm Form)

Module Truth tableX Y Cin Cout Sum0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1

m-form

Sum =

Cout =

Sum =

Cout =

Page 3: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

3

Electrical and Computer EngineeringPage 5 of 77

UAH CPE/EE 422/522Chapter 11.1 Combinational Logic -

Full Adder (Maxterm Form)

Module Truth tableX Y Cin Cout Sum0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1

Sum =

Sum =

Cout =

Cout =

m-form

Sum =

Cout =

Electrical and Computer EngineeringPage 6 of 77

UAH CPE/EE 422/522Chapter 11.2 Boolean Algebra and Algebraic Simplification

• Some routines are widely used and been pooled into subroutine libraries.

• Operating systems are programs that manage the resources of a computer for the benefit of the programs that run on that machine

• Software Categories– Systems - OS, compilers, assemblers, etc.– Applications - spreadsheets, text editors, etc.

Page 4: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

4

Electrical and Computer EngineeringPage 7 of 77

UAH CPE/EE 422/522Chapter 11.3 More Boolean Algebra and

Algebraic Simplification

Electrical and Computer EngineeringPage 8 of 77

UAH CPE/EE 422/522Chapter 1

1.2 Boolean Algebra with Exclusive OR

X0X =⊕'X1X =⊕

0XX =⊕1'XX =⊕

XYYX ⊕=⊕ (Commutative law)

)ZY(XZ)YX( ⊕⊕=⊕⊕

XZXY)ZY(X ⊕=⊕ (Distributive law)

'Y'XXYY'X'YX)'YX( +=⊕=⊕=⊕

Page 5: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

5

Electrical and Computer EngineeringPage 9 of 77

UAH CPE/EE 422/522Chapter 1

1.3 Karnaugh Maps

• Convenient way to simplify logic functions of 3, 4, 5, (6) variables

• Four-variable K-map– Each square

____________________________• 1 ________________________________ • 0______________________________ • d ____________________________

– ------------------------------------------– --------------------------------------

– adjacent cells ____________________________

Electrical and Computer EngineeringPage 10 of 77

UAH CPE/EE 422/522Chapter 1

1.3 Karnaugh Maps - Examples

A

D

C

B

A

D

C

B

Page 6: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

6

Electrical and Computer EngineeringPage 11 of 77

UAH CPE/EE 422/522Chapter 1

1.3 Karnaugh Maps - Sum of Products

• Function consists of a sum of _________________• Prime implicant

______________________________________________

______________________________________________

• Prime implicant is ______________ if it contains a 1 that is not contained in any other prime implicant

Electrical and Computer EngineeringPage 12 of 77

UAH CPE/EE 422/522Chapter 11.3 Karnaugh Maps -

Prime Implicant Selection

• Two minimum forms

f =

f =

A

D

C

B

Page 7: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

7

Electrical and Computer EngineeringPage 13 of 77

UAH CPE/EE 422/522Chapter 11.3 Karnaugh Maps -Selection Procedure

1. Choose a 1 (_______) that has not been covered yet2. Find all _s and __s adjacent to that minterm. (Check

the n adjacent squares on an n-variable map.)3. If a single term covers the minterm and all the

adjacent 1s and ds, then that term is an ________ prime implicant, so select that term.

4. Repeat steps 1, 2, 3 until all essential primeimplicants have been chosen

5. Find a ________ set of prime implicants that cover the remaining 1s on the map. If there is more than one such set, choose a set with a ______________ ______________

Electrical and Computer EngineeringPage 14 of 77

UAH CPE/EE 422/522Chapter 11.4 Designing with NAND

and NOR Gates

• Implementation of NAND and NOR gates is easier than that of AND and OR gates (e.g., CMOS)

Page 8: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

8

Electrical and Computer EngineeringPage 15 of 77

UAH CPE/EE 422/522Chapter 11.4 Designing with NAND

and NOR Gates (continued)

• Any logic function can be realized using only NAND or NOR gates -___________________________________ – 1:– 0: – a’:– ab: – a+b:

Electrical and Computer EngineeringPage 16 of 77

UAH CPE/EE 422/522Chapter 11.4 Designing with NAND and NOR Gates -

Conversion to NOR Gates

• Start with POS (_____________)– circle 0s in K-maps

• Find network of OR and AND gates

Page 9: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

9

Electrical and Computer EngineeringPage 17 of 77

UAH CPE/EE 422/522Chapter 11.4 Designing with NANDand NOR Gates -

Conversion to NAND Gates

• Start with SOP (Sum of Products)– circle 1s in K-maps

• Find network of OR and AND gates

Electrical and Computer EngineeringPage 18 of 77

UAH CPE/EE 422/522Chapter 1

1.13 Tristate Logic and Busses

•Four kinds of tristate buffersB is a control input used to enable and disable the output

Page 10: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

10

Electrical and Computer EngineeringPage 19 of 77

UAH CPE/EE 422/522Chapter 11.13 Tristate Logic and Busses -

Data Transfer

Electrical and Computer EngineeringPage 20 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

Sequential Networks

• Have memory (state)– Present state depends not only on the ______________,

but also on all previous inputs (history)– Future state depends on the ___________ and _______

))t(Q),t(X(F)t(Z =

))t(Q),t(X(G)t(Q =+

Flip-flops are commonly used as storage devices:D-FF, JK-FF, T-FF

x1x2

xn

z1z2

zm

Q

Page 11: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

11

Electrical and Computer EngineeringPage 21 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches - Clocked D Flip-

Flop with Rising-edge Trigger

Next state

The next state in response to the ________ of the clock is equal to the ______ input before the rising edge

Electrical and Computer EngineeringPage 22 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

Clocked JK Flip-Flop

Next stateJK = 00 =>JK = 10 =>JK = 01 => JK = 11 =>

Page 12: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

12

Electrical and Computer EngineeringPage 23 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

Clocked T Flip-Flop

Next state

T = 1 => T = 0 =>

Electrical and Computer EngineeringPage 24 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

S-R Latch

Page 13: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

13

Electrical and Computer EngineeringPage 25 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

Transparent D Latch

Electrical and Computer EngineeringPage 26 of 77

UAH CPE/EE 422/522Chapter 11.6 Flip-Flops and Latches –

Transparent D Latch

Page 14: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

14

Electrical and Computer EngineeringPage 27 of 77

UAH CPE/EE 422/522Chapter 11.7 Mealy Sequential Network Design –

General Model of Mealy Sequential Machine

(1) X inputs are changed to a new value(2) After a delay, the Z outputs and next state appear at the output of CN(3) The next state is clocked into the state register and the state changes

Electrical and Computer EngineeringPage 28 of 77

UAH CPE/EE 422/522Chapter 11.7 Mealy Sequential Network Design - 8421

BCD to Excess3 BCD Code Converter Example

x zQ

00111001110100010101111010010110000110101110001001101100101001000010100011000000t0t1t2t3t0t1t2t3

Z (outputs)X (inputs)

Page 15: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

15

Electrical and Computer EngineeringPage 29 of 77

UAH CPE/EE 422/522Chapter 11.7 Mealy Sequential Network Design –

State Graph and Table for Code Converter

Electrical and Computer EngineeringPage 30 of 77

UAH CPE/EE 422/522Chapter 11.9 Equivalent States and Reduction of State

Tables – Code Converter Example

Page 16: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

16

Electrical and Computer EngineeringPage 31 of 77

UAH CPE/EE 422/522Chapter 11.9 Equivalent States and Reduction of State

Tables – Code Converter Transition Table

NS Z

PS X = 0 X = 1 X= 0 X = 1

S0

S1

S2

S3

S4

S5

S6

Q1+Q2+Q3+ Z

Q1Q2Q3 X = 0 X = 1 X= 0 X = 1

Electrical and Computer EngineeringPage 32 of 77

UAH CPE/EE 422/522Chapter 11.9 Equivalent States and Reduction of State

Tables – Code Converter K-maps

X

Q3

Q2

Q1

X

Q3

Q2

Q1

X

Q3

Q2

Q1

X

Q3

Q2

Q1

Page 17: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

17

Electrical and Computer EngineeringPage 33 of 77

UAH CPE/EE 422/522Chapter 11.9 Equivalent States and Reduction of State

Tables – Code Converter Realization

Electrical and Computer EngineeringPage 34 of 77

UAH CPE/EE 422/522Chapter 11.10 Sequential Network Timing –

Code Converter

• Code converter– X = 0010_1001 => Z = 1110_0011

Page 18: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

18

Electrical and Computer EngineeringPage 35 of 77

UAH CPE/EE 422/522Chapter 11.10 Sequential Network Timing –

Timing Diagram for Code Converter

Timing diagram assuming a propagation delay of 10 ns for each flip-flop and gate(State has been replaced with the state of three flip-flops)

Electrical and Computer EngineeringPage 36 of 77

UAH CPE/EE 422/522Chapter 11.11 Setup and Hold Times –

D Flip-Flop

• For a real D-FF– D input must be stable for a certain amount of time

before the active edge of clock cycle => __________– D input must be stable for a certain amount of time

after the active edge of the clock => __________• Propagation time: from the time the clock changes to the time the output

changes

Manufacturers provide minimum tsu, th, and maximum tplh, tphl

Page 19: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

19

Electrical and Computer EngineeringPage 37 of 77

UAH CPE/EE 422/522Chapter 11.11 Setup and Hold Times –

Maximum Clock Frequency Calculationmaxct - Max propagation delay through the combinational network

maxpt - Max propagation delay from the time the clock changes to the flip-flop output changes { = max(tplh, tphl)}

ckt - Clock period

suckmaxpmaxc tttt −≤+

sumaxpmaxcck tttt ++≥

Example:

MHzns

f

ns*t

nst

,nst,nst

max

ck

gate

sumaxp

2050

150515152

15

515

==

=++=

=

==

Electrical and Computer EngineeringPage 38 of 77

UAH CPE/EE 422/522Chapter 11.11 Setup and Hold Times –

Hold Time Violations (from Q)

• Occurs if the change in Q that is fed back through the combinational network causes input D to change too soon after the clock edge

hmincminp ttt ≥+

Hold time is satisfied if:

-Min propagation delay through- the combinational network

- Min propagation delay from - the time the clock changes to - the flip-flop output changes - { = min(tplh, tphl)}

minpt

minct

Page 20: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

20

Electrical and Computer EngineeringPage 39 of 77

UAH CPE/EE 422/522Chapter 11.11 Setup and Hold Times –

Setup Time Violations (from X)

• Occurs if the change in X that is fed back through the combinational network causes input D to change too soon after the clock edge

sumaxcxx ttt +≥

-Max propagation delay through -the combinational network from - input X (or any other input) to -the flip-flop input D

maxcxt

Electrical and Computer EngineeringPage 40 of 77

UAH CPE/EE 422/522Chapter 11.11 Setup and Hold Times –Hold Time Violations (from X)

• Occurs if the change in X that is fed back through the combinational network causes input D to change too soon after the clock edge

Make sure that X does not changetoo soon after the clock.

If X changes at time ty after the active edge, hold time is satisfied if

mincxhy ttt −≥

-Min propagation delay -through the combinational -network from input X (or any -other input) to the flip-flop input D

mincxt

Page 21: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

21

Electrical and Computer EngineeringPage 41 of 77

UAH CPE/EE 422/522Chapter 1

Synchronous Design

• Use a clock to synchronize the operation of all flip-flops, registers, and counters in the system– all changes occur immediately following the active clock edge– clock period must be long enough so that all changes flip-flops,

registers, counters will have time to stabilize before the next active clock edge

• Typical design: Control section + Data Section

Electrical and Computer EngineeringPage 42 of 77

UAH CPE/EE 422/522Chapter 1

Synchronous Design Example

• Data section // s= n*(n+a) // R1=n, R2=a // R1=s

• Design flowchart for SMUL operation

• Design Control section• S0 S1 F

0 0 B0 1 B – C01 0 B + C01 1 A + B

R2 rdld LD(R2)

RD(R2)

16

L1clldLD(L1)

CL(L1)

16

16

16

ALUS0

S1C0

LD(A) RD(A)

16

16

ACL(A)

ld rd

cl

F

A B

16

R1rdldLD(R1)

RD(R1)

BRLD(BR)

F15..0

DEC(BR)RD(BR)

16

rdlddec

+

BR0

16

C16

Page 22: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

22

Electrical and Computer EngineeringPage 43 of 77

UAH CPE/EE 422/522Chapter 1

Moore Sequential Networks

Outputs depend only on present state!

))t(Q(F)t(Z =

x1x2

xn

z1z2

zm

Z = z1 z2... zm

X = x1 x2... xnQ = Q1 Q2... Qk

))t(Q),t(X(G)t(Q =+

Q

Electrical and Computer EngineeringPage 44 of 77

UAH CPE/EE 422/522Chapter 1General Model of

Moore Sequential Machine

))t(Q(F)t(Z =

Inputs(X)

Clock

Z = z1 z2... zm

X = x1 x2... xnQ = Q1 Q2... Qk

))t(Q),t(X(G)t(Q =+

Combinational Network

State Register

Next State

Outputs depend only on present state!

Outputs(Z)

State(Q)

Combinational Network

Page 23: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

23

Electrical and Computer EngineeringPage 45 of 77

UAH CPE/EE 422/522Chapter 1

Code Converter: Moore Machine

Electrical and Computer EngineeringPage 46 of 77

UAH CPE/EE 422/522Chapter 1

Moore Machine: State Table

S00

S11

S20

S31

S40

S51

S80

S71

S60

S90

S101

0

NC

C

1

0

NC

1

C C

0 1

NC

NC

C

NC

NC

Start

011

0

0 1 0 1 01

01 0 1 0

1S2S1S100S2S1S90-S10S81S10S9S70S10S9S61S8S7S50S8S7S41S7S6S30S5S4S21S4S3S10S2S1S0

X=1X=0ZNS PS

Page 24: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

24

Electrical and Computer EngineeringPage 47 of 77

UAH CPE/EE 422/522Chapter 1

Moore Machine Timing

• X = 0010_1001 => Z = 1110_0011

Moore

Mealy

Electrical and Computer EngineeringPage 48 of 77

UAH CPE/EE 422/522Chapter 1

State Assignments

1S2S1S10

0S2S1S9

0-S10S8

1S10S9S7

0S10S9S6

1S8S7S5

0S8S7S4

1S7S6S3

0S5S4S2

1S4S3S1

0S2S1S0

X=1X=0

ZNS PS

Rule I: (S0, S9, S10), (S4, S5), (S6, S7)Rule II: (S1, S2), (S3, S4), (S4, S5), (S6, S7), (S7, S8), (S9, S10)Rule III: (S0, S2, S4, S6, S8, S9)(S1, S3, S5, S7, S10)

S0 – 0010S1 - 0111….S10 - 0100

Page 25: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

25

Electrical and Computer EngineeringPage 49 of 77

UAH CPE/EE 422/522Chapter 1

11 1 1 01 0 1 01 1 1 110 1 0 00 0 0 01 1 1 0-- - - -- - - -1 1 0 10- - - -0 1 0 01 1 0 001 1 0 01 1 1 01 0 1 100 1 0 00 0 0 01 0 1 011 1 0 01 1 1 01 0 0 1-- - - -- - - -1 0 0 011 0 1 11 1 1 10 1 1 101 0 0 11 0 1 10 1 1 0-- - - -- - - -0 1 0 110 1 1 00 1 1 10 1 0 0-- - - -- - - -0 0 1 100 1 1 00 1 1 10 0 1 0-- - - -- - - -0 0 0 100 1 1 00 1 1 10 0 0 0

X=1QAQBQCQD

X=0QAQBQCQDQAQBQCQD

ZNS PS

State Assignments

Electrical and Computer EngineeringPage 50 of 77

UAH CPE/EE 422/522Chapter 1

00 01 11 10

00

01

11

10

QAQBQCQD

X 0\1

------

----

----

-- ----

--1

1

1111

11

11

QA+ = QD + QA’QBQC

Logic Reduction

QB+ = QC’ + QB’QD +X’QA’ QD+QA’QB’+ XQA

11

1

1

----

--

00 01 11 10

00

01

11

10

QAQBQCQD

X 0\1

1

1

1

11

11

11

--

--

----

----

----

11

Page 26: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

26

Electrical and Computer EngineeringPage 51 of 77

UAH CPE/EE 422/522Chapter 1

Logic Reduction

QC+ = X’QD + X’QA’+QA’QC’+ QA’QB’+QBQD

00 01 11 10

00

01

11

10

QAQBQCQD

X 0\1

1

11

11

1

111

11

11

----

----

------

-- --

----

----

---- 1

00 01 11 10

00

01

11

10

QAQBQCQD

X 0\1

1111

11

--------

------

QD+ = X’QA’ + QA’QBQC

Electrical and Computer EngineeringPage 52 of 77

UAH CPE/EE 422/522Chapter 1

QAQB

--

1

1

1

1

1

00 01 11 10

00

01

11

10

QCQD

----

--

--

Z = QA’QBQC’+ QAQBQC + QC’QD + QBQD

Logic Reduction

Page 27: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

27

Electrical and Computer EngineeringPage 53 of 77

UAH CPE/EE 422/522Chapter 1

Altera Logic Implementation

Electrical and Computer EngineeringPage 54 of 77

UAH CPE/EE 422/522Chapter 1

1 1 1 0 0 0 1 1

0 000 01 11

•X = 0010_1001 => Z = 1110_0011

Reset Portion

Altera Simulation

Page 28: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

28

Electrical and Computer EngineeringPage 55 of 77

UAH CPE/EE 422/522Chapter 1Moore Machine: Another Example –

NRZ to Manchester Converter• Coding schemes for serial data transmission

– NRZ: ______________– NRZI: ______________________

• 0 in input sequence – _____________________________________________________________• 1 in input sequence – _______________________________________

– RZ: return-to-zero• 0 – ___________; 1 – ______________________________________

– Manchester

Electrical and Computer EngineeringPage 56 of 77

UAH CPE/EE 422/522Chapter 1

NRZ-to-Manchester Converter: Timing

Page 29: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

29

Electrical and Computer EngineeringPage 57 of 77

UAH CPE/EE 422/522Chapter 1NRZ-to-Manchester:

State Diagram and Table

Electrical and Computer EngineeringPage 58 of 77

UAH CPE/EE 422/522Chapter 11.12 Synchronous Design:

Control Signal Timing Issues

• Change in state of the flip-flops in control section determined by the propagation delay

• Time control signals change depend upon this FF propagation delay and combinational network delay

• Glitches and spikes may occur in the control signals due to hazards in the network

• Noise may be introduced on the control signals by changing signals in another part of the circuit

• THIS MEANS THAT THERE IS A TIME INTERVAL AFTER THE ACTIVE EDGE OF THE CLOCK WHERE THE STATE OF THE CONTROL SIGNAL IS NOT KNOWN AND MAY NOT BE STABLE

Page 30: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

30

Electrical and Computer EngineeringPage 59 of 77

UAH CPE/EE 422/522Chapter 11.12 Synchronous Design: Timing Chart for System with Falling-edge Devices

Electrical and Computer EngineeringPage 60 of 77

UAH CPE/EE 422/522Chapter 11.12 Synchronous Design: Timing Chart

for System with Rising-edge Devices

Page 31: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

31

Electrical and Computer EngineeringPage 61 of 77

UAH CPE/EE 422/522Chapter 1

Principles of Synchronous Design

• Method– All clock inputs to flip-flops, registers, counters, etc.,

are driven directly from the system clock or from the clock ANDed with a control signal

• Result– All state changes occur immediately following the

active edge of the clock signal• Advantage

– All switching transients, switching noise, etc., occur between the clock pulses and have no effect on system performance

Electrical and Computer EngineeringPage 62 of 77

UAH CPE/EE 422/522Chapter 1

Asynchronous Design

• Disadvantage - More difficult– Problems

• Race conditions: __________________________________________________________________• Hazards

– Special design techniques are needed to cope with races and hazards

• Advantages = Disadvantages of Synchronous Design– In high-speed synchronous design propagation delay in

wiring is significant => clock signal must be carefully routed so that it reaches all devices at essentially same time

– Inputs are not synchronous with the clock –need for synchronizers

– Clock cycle is determined by the worst-case delay

Page 32: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

32

Electrical and Computer EngineeringPage 63 of 77

UAH CPE/EE 422/522Chapter 1

Equivalent States

• Two state are equivalent if we cannot tell them apart by observing input and output sequences

Definition: Two states are equivalent si==sj if and only if, for every input sequence X, the output sequences Z1 and Z2 are the same.

Electrical and Computer EngineeringPage 64 of 77

UAH CPE/EE 422/522Chapter 1

Equivalent States

• Two state are equivalent Si == Sj if and only if for every single input X, the outputs are the same and the next states are equivalent

State Equivalence Theorem

Page 33: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

33

Electrical and Computer EngineeringPage 65 of 77

UAH CPE/EE 422/522Chapter 1

Implication Table Method

1. Construct a chart that contains a square for each pair of states.

2. Compare each pair in the state table. If the outputs associated with states i and j are different, place an X in square i-j to indicate that i!=j.If outputs are the same, place the implied pairs in square i-j. If outputs and next states are the same (or i-j implies only itself), i==j.

3. Go through the implication table square by square. If square i-j contains the implied pair m-n, and square m-n contains X, then i!=j, and place X in square i-j.

4. If any Xs were added in step 3, repeat step 3 until no more Xs are added.

5. For each square i-j that does not contain an X, i==j.

Electrical and Computer EngineeringPage 66 of 77

UAH CPE/EE 422/522Chapter 1

State Table Reduction

1) States a and h have the same next states and outputs (when X=0 and X=1)

2) Eliminate h from the table and replace with a3) States a and b have the same output =>

they are same iff c==d and f==e. We say c-d and e-f are implied pairs for a-b.To keep track of the implied pairs we make an implication chart.

Page 34: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

34

Electrical and Computer EngineeringPage 67 of 77

UAH CPE/EE 422/522Chapter 1

State Table Reduction

4) Make another pass through the chart.E-g cell contains c-e and b-g; since c-e cell contains x, c!=e => e!=g (put X).

5) Repeat the step 4 until no additional squares are X-ed. {Put X in f-g, a-c, a-d, b-c, b-d squares}.

6) The remaining squares indicate equivalent state pairs => a==b, c==d, e==f.

Electrical and Computer EngineeringPage 68 of 77

UAH CPE/EE 422/522Chapter 1

Hazards in Combinational Networks

• What are hazards in Combinational Networks?– Unwanted switching transients at the output (glitches)

• Example– ABC = 111, B changes to 0– Assume each gate has propagation delay of 10ns

Page 35: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

35

Electrical and Computer EngineeringPage 69 of 77

UAH CPE/EE 422/522Chapter 1

Hazards in Combinational Networks

• Occur when different paths from input to output have different propagation delays

• Static 1-hazard– a network output momentarily go to 0 when it should remain a

constant 1

• Static 0-hazard– a network output momentarily go to 1 when it should remain a

constant 0• Dynamic hazard

– if an output change three or more times, when the output is supposed to change from 0 to 1 (1 to 0)

Electrical and Computer EngineeringPage 70 of 77

UAH CPE/EE 422/522Chapter 1

Hazards in Combinational Circuits

Why do we care about hazards?• Combinational networks

– don’t care – the network will function correctly• Synchronous sequential networks

– don’t care - the input signals must be stable within setup and hold time of flip-flops

• Asynchronous sequential networks– hazards can cause the network to enter an incorrect state– circuitry that generates the next-state variables must be

hazard-free• Power consumption is proportional to

the number of transitions

Page 36: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

36

Electrical and Computer EngineeringPage 71 of 77

UAH CPE/EE 422/522Chapter 1

Detection of Static 1 and 0 Hazards

Electrical and Computer EngineeringPage 72 of 77

UAH CPE/EE 422/522Chapter 1

Hazards in Combinational Circuits

1

1 1 1

00 01 11 10

0

1

ABC

BC'ABf +=

1

1 1 1

00 01 11 10

0

1

ABC

ACBC'ABf ++=

To avoid hazards: every pair of adjacent 1s should be covered by a 1-term

Page 37: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

37

Electrical and Computer EngineeringPage 73 of 77

UAH CPE/EE 422/522Chapter 1

Detection of Static 1 Hazards

Each product term of Ft is called a 1-term.

The 1-terms of Ft are plotted on a Karnaugh map

If two 1’s in adjacent squares on the map of Ft are covered by the same 1-term, changing the input to the network between the corresponding two input states cannot cause a hazard.

If two 1’s in adjacent squares on the map are not covered by a single 1-term, a hazard is present.

Electrical and Computer EngineeringPage 74 of 77

UAH CPE/EE 422/522Chapter 1

Detection of Static 1 Hazards

Page 38: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

38

Electrical and Computer EngineeringPage 75 of 77

UAH CPE/EE 422/522Chapter 1

Detection of Static 0 Hazards

Electrical and Computer EngineeringPage 76 of 77

UAH CPE/EE 422/522Chapter 1

Detection of Static 0 Hazards

Page 39: Review of Logic Design Fundamentals - UAHgaede/cpe422/05s_cpe422_chap1.pdf · Chapter 1 - Review of Logic ... 1.1 Combinational Logic - Basic Logic Gates ... •Four kinds of tristate

39

Electrical and Computer EngineeringPage 77 of 77

UAH CPE/EE 422/522Chapter 1

Design of Hazard Free Networks