Top Banner
 Chapter 5 Synchronous Sequential Logic Sequential Circuits Latches and Flip-Flops Analysis of Clocked Sequential Circuits • HDL • Optimization Design Procedure
150

Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

Apr 12, 2018

Download

Documents

vuthu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Chapter 5Synchronous Sequential Logic

• Sequential Circuits• Latches and Flip­Flops• Analysis of Clocked Sequential Circuits• HDL• Optimization• Design Procedure

Page 2: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Sequential Circuits

• Various definitions– Combinational circuits with feedback– Combinational circuits with memory– Combinational circuits with state– whatever...

Page 3: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Synchronous...

• If there are synchronous circuits, there must be asynchronous as well.

• We (and everybody else) deal mostly with synchronous.

• Synchronous circuits have a clock (it can take a few different forms)

Page 4: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Asynchronous circuits

• Depend on time delay devices for storage• Can exhibit instabilities (due to effects like 

racing conditions)• Hard to design• Used mainly for special subcomponents

Page 5: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 6: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Synchronous Sequential Circuits

• They do not look much different other than:– they have one special input called clock– all flip­flops change state in response to the same 

clock

Page 7: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 8: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Latches

• The simplest kind of memory• They are primitive flip­flops• Flip­flops can contain one or more latches

– usually more

• Great for understanding flip­flops without having to know electronics

Page 9: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

S­R Flip­Flop

• S­R stands for Set­Reset• Just two NOR gates

– could use NAND as well

• The output depends not only on the input but the on the previous output as well!

Page 10: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 11: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Using NAND

• Everything is just the opposite• Set and Reset are active low• The illegal input is 0­0

Page 12: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 13: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Latches with ENABLE

• The bare latch is what nightmares are made of

• We can add a control input• Eventually this will be the clock

Page 14: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 15: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Is it perfect?

• It has an indeterminate next state• What if the feedback propagates more than 

once– This could lead to more indeterminacies– It would require a very short clock pulse.

Page 16: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

D Flip­Flop

• The D flip­flop has one input• The D stands for Data or Delay• With one input it is hard to have an illegal 

input

Page 17: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 18: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Graphic Symbols

• Flip­flops are drawn as rectangles• The standard names (S, R, D, J, K, etc) are 

drawn inside.• If it follows negative logic then the input has 

a negation circle.

Page 19: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 20: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Edge Triggered Flip­Flops

• A long clock pulse can create problems• This is because the flip­flop is triggered by 

the “level” of the clock pulse• How about if it is triggered by the transition 

of the clock pulse• Such flip­flops are edge triggered

Page 21: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 22: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Master­Slave D flip­flop

• Use two D flip­flops with control input• The output of the first is the input to the 

second• The first is the master• The second is the slave

Page 23: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 24: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Master­Slave Operation

• When the CLK is low the slave copies the state of the master

• When the clock is high the state of the master is copied from its input

• The input cannot propagate more than one stage per clock transition.

Page 25: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Master­Slave Alternatives

• Master­Slave is not the only known solution.• A less expensive version would need three 

bare latches

Page 26: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 27: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Operation

• When the CLK is 0 the input to the SR output latch is 1­1, and the output is maintained.

• When the CLK goes 1, the S of the output latch becomes equal to D and R becomes equal to D’

• If D changes while CLK is high, the SR are not affected

Page 28: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 29: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Positive Edge Triggered

• The F­F responds only to 0 ­> 1 transitions– aka leading edge triggered

• The output of the F­F changes immediately after the clock transition

• Any change in the input has no effect before the clock transition.

Page 30: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Timing

• In real­life circuits nothing is instantaneous• The input D has to stabilize for a short time 

before the clock transition– this is called setup time

• The input D has to remain stable for a short time after the clock transition– This is called hold time.

Page 31: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Graphic Symbol

• The clock of a positive edge triggered F­F is indicated by a small arrowhead and the letter C (sometimes CLK)

• The little arrowhead is called dynamic indicator.

• A small circle (bubble... whatever) designates a negative edge triggered F­F

Page 32: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 33: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Other Flip­Flops

• The least expensive F­F is the edge triggered D F­F (if you count VLSI real estate)

• It needs the fewest gates to implement.• Often it needs the smallest total number of 

gates (gates inside the F­F and external logic)

Page 34: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Other Flip­Flops

• Other F­Fs can be built using D F­Fs• There are three desired operations on a F­F

– Set (to 1)– Reset (to 0)– Toggle

Page 35: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

J­K Flip­Flop

• Can do all desired operations• Usually needs the smallest number of 

external gates (its excitation table has many don’t cares)

• Often the best when using MSI technologies• Less impressive in VLSI implementations• Like SR but without illegal inputs

Page 36: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 37: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

J­K Flip­Flop

• D = J Q’ + K Q• The F­F is set when JK = 10• The F­F is reset when JK = 01• Nothing changes if JK = 0• The F­F toggles if JK = 11

– That would be indeterminable for SR latches

Page 38: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

T Flip­Flop

• T stands for trigger or toggle• Was popular in the era of discrete transistors

– could be implemented with two transistors and several resistors and capacitors.

• Counters have essentially T F­F• Can be thought of as a J­K F­F with the 

inputs tied together.

Page 39: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 40: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

T Flip­Flop

• D = TQ’ + T’Q• The F­F toggles if the input T=1• Nothing happens if T=0

Page 41: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Characteristic Tables

• The “truth tables” of F­F• Give us the next state of the F­F given the 

input and current state• Can be expressed in various equivalent 

forms

Page 42: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Characteristic Table for J­K

J K

0 00 11 01 1

Q(t+1)

Q(t)01Q’(t)

No changeResetSetToggle

Page 43: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Tables for D and T

D

01

Q(t+1)

01

T

01

Q(t+1)

10

Page 44: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Characteristic Equations

• Same info as tables, but in algebraic form• The D F­F

– Q(t+1) = D

• The J­K F­F– Q(t+1) = JQ’ + K’Q

• The T F­F– Q(t+1)= TQ’ + T’Q

Page 45: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Direct Inputs

• Need to preset a F­F during startup.– also when we have a general reset

• Has to be independent of clock• Rarely used as part of the overall behaviour.

Page 46: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 47: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Analysis of Clocked Sequential Circuits

• No new mathematics, algorithms• An orderly procedure to investigate the 

functionality of the circuit• Set of conventions

Page 48: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Equations

• Every combination of the flip­flop values is called state

• The state changes after every clock pulse• State equations are the equations that give us 

the next state as a function of the current state and the input

Page 49: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Equations

• The state equations are also called transition equations

• We derive the state equations from the circuit schematic

Page 50: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example

• We analyze a simple circuit with two F­F named A and B, one input x and an output y

• We derive the state equations first

Page 51: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 52: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Equations

• These can be written as– A(t+1) = A(t)x(t) + B(t)x(t)– B(t+1) = A’(t)x(t)

• And if we are lazy– A(t+1) = Ax + Bx– B(t+1) = A’x

Page 53: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Not done yet

• The output equation is usually bundled– y = (A + B)x’

• The output is valid before the clock pulse, then the state changes, the input changes and the output finally settles before the next clock pulse.

Page 54: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table

• The state table presents the same information in tabular form

• Also called transition table• Also bundled with the output data

Page 55: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Two Common Forms

• In the first form every row is labeled by all unique combinations of current state and input. The next state and output are separate columns

• In the second, we label rows with all current states and have multiple sets of columns for the next state and output.

Page 56: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table

Presentstate Input

NextState Output

A B

0 00 00 10 11 01 01 11 1

x

01010101

A B

0 00 10 01 10 01 00 01 0

y

00101010

Page 57: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table (Alt)

PresentState

Next State Output

AB

00011011

x=0

AB

00000000

x=1

AB

01111010

x=0

y

0111

x=1

y

0000

Page 58: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Diagram

• We see the circuit more like something that changes states, than a collection of F­F and gates

• It is really a Finite State Machine (FSM)• So can be represented by a State Diagram 

(you know, the thingy with the bubbles and the arrows between them...)

Page 59: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Diagram

• The bubbles represent the states and are labeled (usually) with the binary number of the state

• The edges are the transitions and are labeled with the input that cause the transition

• We indicate the output after the slash

Page 60: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Mealy and Moore

• There are two slight variations in FSMs– The Mealy, where the output is a function of the 

input and present state– The Moore, where the output is a function of the 

present state alone.

Page 61: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Mealy and Moore

• In the Mealy the / (slash) and the output are written on the transition edge

• In the Moore model the / and the output are written inside the state bubble.

Page 62: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 63: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

F­F Input Convention

• We might need to write explicitly the input equation for the F­F of our circuit

• If it is a D F­F named A then– D_A = Ax + Bx

• Similarly– D_B = A’ x

Page 64: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Analysis with D F­F

• We did that already• It is easy because the next state is the same 

as the input

Page 65: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 66: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

For this Example

• Input Equations– D_A = A xor x xor y

• State Equations– A(t+1) = A xor x xor y

• There is no output (the state itself is usually the output in this case)

Page 67: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Analysis with J­K F­F

• Slightly more complex• One needs to use the characteristic table or 

the characteristic equation for the J­K F­F

Page 68: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Steps

• Determine the F­F input Equations• List the binary values for each input equation 

and state• Use the char. tables to determine the next 

state

Page 69: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 70: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Input Equations

• These are:– J_a = B– K_a= Bx’– J_b = x’– K_b= A xor x

Page 71: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table V1

PresentState Input

NextState F-F Inputs

AB

0000010110101111

J A KA J B KB

0 0 1 00 0 0 11 1 1 01 0 0 10 0 1 10 0 0 01 1 1 11 0 0 0

x

01010101

Page 72: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table V2

PresentState Input

NextState F-F Inputs

AB

0000010110101111

AB

0100111011100011

J A KA J B KB

0 0 1 00 0 0 11 1 1 01 0 0 10 0 1 10 0 0 01 1 1 11 0 0 0

x

01010101

Page 73: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 74: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Alternatively...

• We can use the characteristic equation– A(t+1) = J_a A’ + K_a’ A– B(t+1) = J_b B’ + K_b’ B

• Plug in the values– A(t+1) = BA’ + B’A + Ax– B(t+1) = x’B’ + A’x’B + AxB

• Matter of taste

Page 75: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Analysis with T F­F

• Similar idea to J­K F­F• We fill the state table in two stages

Page 76: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 77: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table

PresentState Input

NextState

FF inputA B

AB

0000010110101111

x

01010101

AB

0100111011100011

J K

0000111000001110

J K

1001100111001100

Page 78: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL for Sequential Circuits

• Behavioral Modeling– using the always construct

• Structural Description– By describing the interconnection between gates 

and FFs

Page 79: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The always Construct

• The always statement is executed repeatedly

• Normally conditioned by the event control expression or sensitivity list or just @­list

• Can have as many always statements as needed. All execute concurrently– Concurrency is a fact of life in H/W

Page 80: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The always Construct

• The event list is an or separated list of signals

• The always statement is executed when there is a change in any of the signals

• The statement (or block of statements) is then executed once

Page 81: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Two Kinds of Events

• Level sensitive– triggered by any change in level– useful in combinational circuits

• Edge triggered– triggered by positive only or negative only 

events– useful in sequential circuits

Page 82: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Of course!

• There are two kinds of edge­triggered events– keyword negedge– keyword posedge

• That’s because FF are of two kinds

Page 83: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Procedural Assignments

• These are gated and happen only when always blocks are executed

• Different from the dataflow assignment, which is continuous

• The lhs has to be of type reg.

• And guess what...

Page 84: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

There are Two Kinds

• Blocking– The assignment is completed before the next 

statement starts execution– Similar to C and most other programming 

languages

• Non­Blocking– The next statement sees the old value of the lhs 

of the previous statement

Page 85: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example: Blocking

• Consider the following blocking procedural assignments, where A is initially 3 and B is initially 1– B = A– C = B + 1

• After the execution C will contain 4

Page 86: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example: non­Blocking

• If the assignment is non­blocking– B <= A– C <= B + 1

• After the execution C will contain 2!• Easier to understand if you think of B and C 

as collections of edge triggered FFs.

Page 87: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

D Latch

• The D latch has two inputs– the D input– and the control input

• And one output• If the control is high the output trails the 

input, otherwise holds the last input

Page 88: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL code for the D Latch//HDL Example 5­1//­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­               //Description of D latch (See Fig.5­6)module D_latch (Q,D,control);   output Q;   input D,control;   reg Q;   always @ (control or D)     if (control) Q = D;     //Same as: if (control = 1)endmodule

Page 89: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

D Flip­Flop

• Slightly more complex• It is triggered by the clock edge• If the input D changes the state or output of 

the FF does not change before the clock edge

Page 90: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL for D Flip­Flop//HDL Example 5­2//­­­­­­­­­­­­­­­­­­­­­­­­­­­      //D flip­flop module D_FF (Q,D,CLK);   output Q;   input D,CLK;   reg Q;   always @ (posedge CLK)     Q = D;endmodule 

Page 91: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

D FF with RESET

• We now have two asynchronous inputs• The RESET is active low

Page 92: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL for D FF with RESET//D flip­flop with asynchronous reset.module DFF (Q,D,CLK,RST);   output Q;   input D,CLK,RST;   reg Q;   always @(posedge CLK or negedge RST)      if (~RST) Q = 1'b0;    // Same as: if (RST = 0)     else Q = D;endmodule 

Page 93: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Observation

• In the if statement the then clause is asynchronous logic

• Same for else if, if there was any.

• The last else statement is synchronous logic

Page 94: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Observation

• In the sensitivity list we have posedge CLK and negedge RST

• As long as RST is 0, the FF is reset, despite the fact that we trigger with negedge

• The CLK is effective only during the positive edge, and the only when RST=1

Page 95: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

T Flip­Flop

• The characteristic equation is– Q(t+1) = Q xor T

• We can use a D FF to build the T FF– we could build it from scratch too...

• Use dataflow and structural model mix

Page 96: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL for T Flip­Flop//T flip­flop from D flip­flop and gatesmodule TFF (Q,T,CLK,RST);   output Q;   input T,CLK,RST;   wire DT;   assign DT = Q ^ T ;//Instantiate the D flip­flop   DFF TF1 (Q,DT,CLK,RST);endmodule

Page 97: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

T Flip­Flop from Scratch//T flip­flopmodule T_FF (Q,T,CLK,RST);   output Q;     input T,CLK,RST;   reg Q;     always @ (posedge CLK or negedge RST)       if (~RST) Q = 1'b0;       else Q = Q ^ T;endmodule

Page 98: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

J­K Flip­Flop

• The characteristic equation is– Q(t+1) = JQ’ + J’K

• We use again a D FF

Page 99: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

HDL for J­K F­F//JK flip­flop from D flip­flop and gates   module JKFF (Q,J,K,CLK,RST);   output Q;   input J,K,CLK,RST;   wire JK;   assign JK = (J & ~Q) | (~K & Q);//Instantiate D flipflop   DFF JK1 (Q,JK,CLK,RST);endmodule

Page 100: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

J­K from Scratch// Functional description of JK flip­flopmodule JK_FF (J,K,CLK,Q,Qnot);   output Q,Qnot;   input  J,K,CLK;   reg  Q;   assign Qnot = ~ Q ;   always @ (posedge CLK)            case ({J,K})             2'b00: Q = Q;             2'b01: Q = 1'b0;             2'b10: Q = 1'b1;             2'b11: Q = ~ Q;           endcaseendmodule

Page 101: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Diagrams

• Verilog (and other HDLs) can immitate state diagrams

• There are two basic variations: Mealy and Moore

• Makes life easier to use keyword parameter.

Page 102: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example: Mealy

• Mealy is the one with the outputs on the edges

• The structure of the HDL program reflects the H/W:– one always for the sequential circuit

– one always for the next state calculation

– one always for the output

Page 103: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 104: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Diagram in HDLmodule Mealy_mdl (x,y,CLK,RST);  input x,CLK,RST;  output y;  reg y;  reg [1:0] Prstate, Nxtstate;  parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11;   always @ (posedge CLK or negedge RST)      if (~RST) Prstate = S0;  else Prstate = Nxtstate; //Clock operations   always @ (Prstate or x)     //Determine next state         case (Prstate)            S0: if (x) Nxtstate = S1;            S1: if (x) Nxtstate = S3;   else Nxtstate = S0;            S2: if (~x)Nxtstate = S0;            S3: if (x) Nxtstate = S2;  else Nxtstate = S0;         endcase   always @ (Prstate or x)     //Evaluate output         case (Prstate)            S0: y = 0;            S1: if (x) y = 1'b0; else y = 1'b1;            S2: if (x) y = 1'b0; else y = 1'b1;            S3: if (x) y = 1'b0; else y = 1'b1;         endcaseendmodule

Page 105: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example: Moore

• Moore is the one with the outputs inside the state bubble (or implied)

• The HDL reflects again the (slightly) simpler H/W

• Here we combine the always.

Page 106: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 107: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Moore in HDLmodule Moore_mdl (x,AB,CLK,RST);   input x,CLK,RST;   output [1:0]AB;   reg [1:0] state;   parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11;      always @ (posedge CLK or negedge RST)         if (~RST) state = S0;  //Initialize to state S0            elsecase (state)           S0: if (~x) state = S1;             S1: if (x)  state = S2; else state = S3;               S2: if (~x) state = S3;           S3: if (~x) state = S0;          endcase   assign AB = state;        //Output of flip­flopsendmodule

Page 108: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 109: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Reduction

• Often a sequential circuit with fewer states can do exactly the same job

• There are multiple benefits from reducing the number of states

• State tables (or diagrams) generated by software tend to have redundant states.

Page 110: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Benefits

• Fewer flip­flops• More unused states, thus more don’t cares

Page 111: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Definition

• Two FSM are equivalent when for all input sequences they produce the same output

• Unfortunately all is too many• We have to find a more workable definition

Page 112: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

How About...

• Define the equivalence of states. If we find that two states are equivalent we merge them

• Two states in an FSM are equivalent if for every input produce the same output and jump to the same state or to equivalent states.

Page 113: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Sounds better

• This is a workable definition• We can use it to simplify state diagrams by 

hand• We can use it to design an algorithm.

Page 114: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example

• In the next FSM we observe that states g and e are equivalent– with input 1 they go to f and produce 1– with input 0 they go to a and produce 0

Page 115: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 116: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Some More...

• So e and g is one state with two different names.

• But now f and d are equivalent– with input 0 they go to {e,g} and produce 0– with input 1 they go to f and produce 1

Page 117: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 118: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Algorithm

• Initial step:– For every state fill in the truth table that relates 

inputs to outputs– Place all the states in groups such that all states 

in the same group have identical truth tables

Page 119: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Iteration

• Repeatedly select a group of states i– if the states within i jump to different groups, 

split i into several groups

Page 120: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

The Same Example

a

b

c

d

e

f

g

00000001010101

01010101010101

abcdadefafgfaf

State Inp Out Next

Page 121: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Groupings

d e f g

a

b c

d e f g

a b c

a

a

b c

b c

d f e g

e gd f

Page 122: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Assignment

• With N states there are at least N! possible state assignments

• Some of them are better than others• There is little algorithmic help to find the 

optimal state assignment

Page 123: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

A Few Simple Ideas

• If there is a natural ordering in the states of the module, then assign consecutive binary numbers to the states

• Even better (sometimes) use Gray code instead of binary (minterms tend to fall near other minterms in the map)

Page 124: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Number of F­F

• A circuit always has a power of two number of states, although the FSM requires fewer

• We end up with unused states• This is good: lots of don’t cares!• Sometimes it is worth having extra F­F just 

for the don’t cares.

Page 125: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

In the Extreme

• We can even have one F­F per state (aka one hot)

• This often saves enough gates to justify the real estate taken up by the extra F­F

Page 126: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Design Procedure

• Now we are ready to design a circuit• Design consists of

– translating “words” to symbols, tables, HDL...– specifying the logic– optimizing the design for cost and or 

performance– communicating the results

Page 127: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

But most of all

• Keep things tidy and ordered• Manage complexity

Page 128: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Detailed Steps

• Produce a state diagram• Minimize it• Assign binary values to states• Choose the technology• Obtain state table (binary coded)• Minimize FF input equations

Page 129: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

...Detailed Steps

• Draw logic diagram (or equivalent)• Calculate costs• Do it again until you nauseate (or have 

reduced the cost enough)

Page 130: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Word Specification

• Comes from the system architect• Might or might not be exact, unambiguous• There is some help from various design aids• Needs experience

Page 131: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Example

• Design a module that detects three or more consecutive 1’s.

• This module should have 4 states– One state for zero 1’s– One for one 1– One for two 1’s– One for three or more 1’s

Page 132: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 133: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table

Present Input Next Output

AB

0000010110101111

x

01010101

AB

0001001000110011

0

00000011

Page 134: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Using D F­F

• Using D F­F the next state is the same as the F­F input– A(t+1) = Sum(3,5,7)– B(t+1) = Sum(1,5,7)– y = Sum(6,7)

Page 135: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 136: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Using J­K F­F

• Not much harder, but we need the excitation tables

• These are the inverses of the characteristic tables

• For J­K F­F the have lots of don’t cares

Page 137: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 138: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

J­K and T FF ExcitationTables

Q(t)

0011

Q(t+1)

0101

J K

0 X1 XX 1X 0

Q(t)

0011

Q(t+1)

0101

T

0110

Page 139: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table for J­K F­F

Pres Input Next F-F Inputs

A B

0 00 00 10 11 01 01 11 1

x

01010101

A B

0 00 11 00 11 01 11 10 0

Page 140: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table for J­K F­F

Pres Input Next F-F Inputs

A B

0 00 00 10 11 01 01 11 1

x

01010101

J K

0 X0 X1 X0 XX 0X 0X 0X 1

J K

0 X1 XX 1X 00 X1 XX 0X 1

A B

0 00 11 00 11 01 11 10 0

Page 141: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 142: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 143: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 144: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

State Table for 3­Bit Counter

Present Next Flip-Flop Inputs

A2 A1 A0

0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

A2 A1 A0

0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0

Page 145: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Present Next Flip-Flop Inputs

A2 A1 A0

0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

A2 A1 A0

0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0

T1 T2 T3

0 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 1

Page 146: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 147: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 148: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 149: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •

   

Page 150: Chapter 5 Synchronous Sequential Logic - Department of …€¦ ·  · 2010-10-01Chapter 5 Synchronous Sequential Logic ... • Flipflops can contain one or more latches ... •