chapter5 synchronous sequential logic

24
Synchronous Sequential Logic MEC5 20 디지공학 Jee-Hwan Ryu School of Mechanical Engineering Korea University of Technology and Education Korea University of Technology and Education  Outputs are function of inputs and present states Present states are supplied by memory elements Sequential Circuits

Upload: z45e

Post on 06-Apr-2018

235 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 1/24

Synchronous Sequential

Logic

MEC520 디지털 공학

Jee-Hwan Ryu

School of Mechanical Engineering

Korea University of Technology and Education

Korea University of Technology and Education 

Outputs are function of inputs and present states

Present states are supplied by memory elements

Sequential Circuits

Page 2: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 2/24

Korea University of Technology and Education 

Two types of sequential circuit

Synchronous : behavior depends on the signals affectingstorage elements at discrete time

Asynchronous : behavior depends on inputs at any instanceof time, many difficulties on designers

Flip-flop: The storage elements used in clocked sequentialcircuits.

Sequential Circuits

Korea University of Technology and Education 

Latches

The most basic types of flip-flops operate with signallevels

The latches introduced here are the basic circuitsfrom which all flip-flops are constructed

Useful for Storing binary information

For the design of asynchronous sequential circuits

Not practical for use in synchronous sequentialcircuits

Page 3: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 3/24

Korea University of Technology and Education 

SR Latch

Consist of two cross-coupled NOR gates

S=1,R=0 then Q=1(set)

S=0,R=1 then Q=0(reset) S=0,R=0 then no change (keep condition)

S=1,R=1 Q=Q′=0 (undefined)

Korea University of Technology and Education 

Require the complement value of NOR latch

S′R′ Latch with NAND Gates

Page 4: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 4/24

Korea University of Technology and Education 

Add two NAND gate and control signal

C=0(no action), C=1(act as SR latch)

SR Latch with Control Input

Korea University of Technology and Education 

SR Latch as a Debouncing Switch

Page 5: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 5/24

Korea University of Technology and Education 

Eliminate indeterminate state in SR latch

C=1, output value is equal to D (transparent )

D Latch

Korea University of Technology and Education 

Application of D Latch

Output Q is retained until the clock is enabled again,even though the data input is changed

Page 6: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 6/24

Korea University of Technology and Education 

Graphic Symbols for Latches

S

 R

SR

S

 R

SR

 D

 D

Korea University of Technology and Education 

Latch : output changes as input changes while theclock pulse is in the logic 1, case (a)

Unpredictable situation due to continuous state changing

Flip-flop : output only changes at clock edge

Flip-Flops

Page 7: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 7/24

Korea University of Technology and Education 

Negative edge triggered D flip-flop

CLK=0 : master disable, slave enable

CLK=1 : master enable, slave disable

Positive edge triggered D flip-flop Attach inverter on the other way

Master-Slave D Flip-Flop

Korea University of Technology and Education 

Negative Edge Triggered M-S D Flip-Flop

Page 8: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 8/24

Korea University of Technology and Education 

Consist of 3 SR-latches

When CLK=0, S=R=1 -> state is maintained

Q changes only when CLK becomes 0 to 1, no change when 1->0

If D=0 when CLK->1, R->0 (Reset state, Q=0)

If D->1 while CLK=1, R remains at 0

CLK->0, R->1, State is maintained

If D=1 when CLK->1, S->0 (Set state, Q=1)

D-type Positive Edge Triggered Flip-Flop

Dynamic

Korea University of Technology and Education 

CLK

D

Q

Q’

Figure: Positive edge triggered D flip-flop timing diagram

D-type Positive Edge Triggered Flip Flop

Page 9: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 9/24

Korea University of Technology and Education 

CLK

D

Q

Q’

Q

Q’

Figure: Negetive edge triggered D flip-flop timing diagram

D-type Negative Edge Triggered Flip Flop

Korea University of Technology and Education 

Performs three operations

Set(J=1,K=0), Reset(J=0,K=1), Complement(J=K=1)

D=JQ′+K′Q

J=1,K=0: D=Q’+Q=1->Sets Q=1 at the next clock edge

J=0,K=1: D=0 -> Resets Q=0 at the next clock edge

J=K=1: D=Q’ (Complement), J=K=0: D=Q (Unchanged)

JK Flip-Flop

Page 10: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 10/24

Korea University of Technology and Education 

Complementing flip-flop

From D flip-flop

D=TQ′+T′Q

T Flip-Flop

Korea University of Technology and Education 

CLK

T

Q

Q’

Figure: Positive edge triggered T flip-flop timing diagram

T Flip-Flop Positive Edge Triggered

Page 11: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 11/24

Korea University of Technology and Education 

Flip-flop characteristic tables

Q(t): present state prior to the application of a clock edge

Q(t+1): next state one clock period later

Characteristic Tables

Korea University of Technology and Education 

D-flip flop

Q(t+1)=D

J-K flip flop Q(t+1)=JQ’+K’Q

T flip flop Q(t+1)=TQ’+T’Q

Characteristic Equations

Page 12: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 12/24

Korea University of Technology and Education 

Direct Inputs

For bringing all flip-flops in the systemto a known starting

state prior to theclocked operation

Q

Q

S

 R

CL K 

 Reset 

 D

(a) Circuit diagram

 D Q

Q R

(b) G raphic symbol

Data

CLK

Reset

 R

0

1

1

X

 D

X

0

1

Q

0

0

1

Q

1

1

0

(b) Function table

Korea University of Technology and Education 

Behavior of clocked sequential circuit is determinedfrom input, output and present state

Output and next state are a function of input andpresent state

In this section, we introduce an algebraicrepresentation for specifying the next-state conditionin terms of the present state and inputs

Analysis Of Clocked Sequential Circuits

Page 13: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 13/24

Korea University of Technology and Education 

Specifies the next state and output as a function ofthe present state and inputs

A(t+1)=A(t)x(t) + B(t)x(t)

B(t+1)=A′ (t)x(t)

y(t)=(A(t)+B(t))x′ (t)

t+1: one clock edge later 

State Equations (Transition Equations)

Korea University of Technology and Education 

Time sequence of inputs, outputs, and flip-flop states

Two types of state table exist

One form may be preferable over the other,depending on the application

State Table (Transition Table)

Page 14: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 14/24

Korea University of Technology and Education 

A kind of flow diagram

Can be derived from state table

State-circle, transition-line, I/O

State Diagram

Korea University of Technology and Education 

Analysis with D Flip-Flops

Input equation :

D flip-flop with output A

State equation is equal to input equation

( ) y x At  A ⊕⊕=+1

No output, slash is not needed

Page 15: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 15/24

Korea University of Technology and Education 

Analysis with JK Flip-Flops

State equation is not the same as the input equation

Have to refer characteristic table or characteristic equation

Flip-flop Input equations

 B A x A x AK  x J 

 x BK  B J 

 B B

 A A

⊕=′+′=′=

′==

 

Korea University of Technology and Education 

Analysis with JK Flip-Flops

State table and state diagram

( )( )

( ) ( )( ) ( ) x B A ABx x B B x A B xt  B

 Ax B A B A A x B A Bt  A

 BK  B J t  B

 AK  A J t  A

′′++′′=′

⊕+′′=+

+′+′=′′+′=+

′+′=+

′+′=+

1

1

1

1

Page 16: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 16/24

Korea University of Technology and Education 

Analysis with T Flip-Flops

Input equations and outputequation

T  A=Bx, T  B=x

 y=AB State equations are derived

from characteristic equation

( ) ( ) ( )

( ) B xt  B

 Bx A x A B A A Bx A Bxt  A

⊕=+

′+′+′=′+′

=+

1

1

Korea University of Technology and Education 

Analysis with T Flip-Flops

State/output Input

Page 17: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 17/24

Korea University of Technology and Education 

A sequential circuit with two D flip-flops, A and B;two inputs, x and y; and one output, z, is specified bythe following next-state and output equations:

A(t+1) = x’y + xA(t)

B(t+1) = x’B(t) + xA(t)

Z = B(t)

(a) Draw the logic diagram of the circuit.

(b) List the state table for the sequential circuit.

(c) Draw the corresponding state diagram.

Example

Korea University of Technology and Education 

Mealy model : output is a function of the presentstate and input

Inputs must be synchronized with the clock

Outputs must be sampled at the clock edge

Moore model : output is a function of the presentstate only

Outputs are synchronized with the clock

Mealy and Moore Models

Page 18: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 18/24

Korea University of Technology and Education 

Sequential circuit design: requires state table

⇔ Combinational circuit : truth table

The number of flip-flop is determined from thenumber of states in circuit

If 2ⁿ states exist, there are n  flip-flops

Once the type and number of flip-flops aredetermined

Sequential circuit problem is transformed into acombinational circuit problem

Design Procedure

Korea University of Technology and Education 

Design steps

1) Derive a state diagram or state table

2) Reduce the number of states if necessary

3) Assign binary values to the states

4) Obtain the binary-coded state table

5) Choose the type of flip-flops to be used

6) Derive the flip-flop input equations and outputequations

7) Draw the logic diagram

Design Procedure

Page 19: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 19/24

Korea University of Technology and Education 

Sequential detector Three or more consecutive 1’s in a string of bits coming

through an input line

0

Derive a State Diagram

Korea University of Technology and Education 

0

•State Assign as followings

• 4 States -> 2 bit assign

• S0 = 00

• S1 = 01

• S2 = 10

• S3 = 11

Assign Binary Values To The States

Page 20: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 20/24

Korea University of Technology and Education 

0

Obtain The Binary-coded State Table

Korea University of Technology and Education 

=

==+

==+

)7,6(),,(

)7,5,1(),,()1(

)7,5,3(),,()1(

 x B A y

 x B A Dt  B

 x B A Dt  A

 B

 A

Input equations are obtained directly from the next states

Synthesis using D Flip-Flops

Page 21: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 21/24

Korea University of Technology and Education 

Draw the Logic Diagram

Korea University of Technology and Education 

Excitation Table

Q(t) Q(t+1) J K

0 0 0 X0 1 1 X

1 0 X 11 1 X 0

Q(t) Q(t+1) T

0 0 00 1 1

1 0 11 1 0

Page 22: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 22/24

Korea University of Technology and Education 

Input equations evaluated from the present state tonext state transition

Y = Ax

Synthesis with JK Flip-Flops

Korea University of Technology and Education 

Synthesis using JK Flip-Flops

Page 23: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 23/24

Korea University of Technology and Education 

Example

Synthesis using T flip-flops

- Design with T flip-flops

Korea University of Technology and Education 

Synthesis using T flip-flops

3-bit binary counter

3-bit counter has 3 flip-flops and can count from 0 to 2ⁿ-1(n=3)

Page 24: Chapter5 Synchronous Sequential Logic

8/3/2019 Chapter5 Synchronous Sequential Logic

http://slidepdf.com/reader/full/chapter5-synchronous-sequential-logic 24/24

Korea University of Technology and Education 

T  A2  A 1  A 0 T  A1 

 A 0 T  A0 1

 A 2 

 A 1

 A0

1

1

1 1

1 1

1 1

1

1

1 1

1

1

Synthesis using T Flip-Flops

1. Synthesis the 3-bit binary counter using Dflip-flop

2. Synthesis the 3-bit binary counter using J-K flip-flop

Example