finite state machine, memory systems

41
Finite State Machine, Memory Systems Prof. Sin-Min Lee Department of Computer Science

Upload: doli

Post on 03-Feb-2016

32 views

Category:

Documents


0 download

DESCRIPTION

Finite State Machine, Memory Systems. Prof. Sin-Min Lee Department of Computer Science. CS147 Lecture 11. Characteristic Equation of FFs. Note that when Clear is 1, everything goes to 0. When Clear is 0, this does not affect the others. clk. T. clear. Q. 1. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Finite State Machine, Memory Systems

Finite State Machine, Memory Systems

Prof. Sin-Min Lee

Department of Computer Science

Page 2: Finite State Machine, Memory Systems
Page 3: Finite State Machine, Memory Systems
Page 4: Finite State Machine, Memory Systems

Characteristic Equation of FFs

Page 5: Finite State Machine, Memory Systems
Page 6: Finite State Machine, Memory Systems
Page 7: Finite State Machine, Memory Systems

clk

T

clear

Note that when Clear is 1, everything goes to 0.

When Clear is 0, this does not affect the others.

Q 1

Page 8: Finite State Machine, Memory Systems

Finite State Machines and Flip-Flops

Now, suppose we have an FSM with two states like this:

Although it may be confusing, the inputs and outputs are labeled “0” and “1”, and our two states are also have the labels “0” and “1”. This somewhat awkward naming convention means it is easier to translate this to computer code later on.

X/Y:

x = inputy = output

Page 9: Finite State Machine, Memory Systems

Finite State Machines and Flip-Flops

We can think of the starting state as Q(t) and the ending state as Q(t+1), with x and y being our inputs and outputs, leading to this chart:

Page 10: Finite State Machine, Memory Systems

Implementing this FSM using a T Flip-Flop

Using the values from the first chart, we can get this second chart.

Then, we apply the same reverse method to determine what input values we would need to arrive at the ones listed in this second chart.

Page 11: Finite State Machine, Memory Systems

Implementing this FSM using a T Flip-Flop

T = XQ' + X'Q

Page 12: Finite State Machine, Memory Systems

Implementing this FSM using a D Flip-Flop

This time we use the same FSM and same initial chart, but now derive an equation for D.

Page 13: Finite State Machine, Memory Systems

Implementing this FSM using a D Flip-Flop

Since this is a delay, the corresponding chart is the same.

Page 14: Finite State Machine, Memory Systems

Implementing JK Flip-Flop using only a T Flip-Flop

This is the final Karnaugh map and the associated equation for T.

Page 15: Finite State Machine, Memory Systems

Implementing T Flip-Flop using only a JK Flip-Flop

This time, we are doing the reverse again, asking what values of J and K will give us the corresponding values in the T chart above.

00 or 01 will give 0, so weenter “0X”. X is our “don't care” value; it can be 0 or 1.

Page 16: Finite State Machine, Memory Systems

Implementing T Flip-Flop using only a JK Flip-Flop

Once we derive all the values, we have to split this into two, in order to get an equation that defines J and another than defines K.

Page 17: Finite State Machine, Memory Systems

Implementing T Flip-Flop using only a JK Flip-Flop

Here is the final implementation.

Page 18: Finite State Machine, Memory Systems
Page 19: Finite State Machine, Memory Systems
Page 20: Finite State Machine, Memory Systems
Page 21: Finite State Machine, Memory Systems
Page 22: Finite State Machine, Memory Systems
Page 23: Finite State Machine, Memory Systems
Page 24: Finite State Machine, Memory Systems

Implementing JK Flip-Flop using only a T Flip-Flop

Note how the areas marked off with a blue box behave like a T flip-flop, while the area within the purple box behave like a D flip-flop.

From this last chart, we can derive the following chart:

Page 25: Finite State Machine, Memory Systems

Implementing JK Flip-Flop using only a T Flip-Flop

To derive the next chart, we work in reverse, asking, “What is the input into the T (toggle) function that will result in the output shown in the previous chart?” In this case, the first column of Q is 0 and our circled value is a 0; a 0 will give this result.

The input that will give us a 1, when Q is 1, is also 0. Refer back to the T flip-flop chart to see that on 0, there is no change; 1 “toggles”.

Page 26: Finite State Machine, Memory Systems

Implementing this FSM using a D Flip-Flop

Finally, here is our graph.

Page 27: Finite State Machine, Memory Systems

Processor/MemoryBus

PCI Bus

I/O Busses

Page 28: Finite State Machine, Memory Systems

Using T Flip Flop and JK Flip Flop

log24 = 2, so 2 flip flops are needed to implement this FSA

Page 29: Finite State Machine, Memory Systems

Step 1 - Translate diagram into StateTable 

Page 30: Finite State Machine, Memory Systems

Step 2 - Create maps for T and JK

 

Page 31: Finite State Machine, Memory Systems

Step 3 - Determine T, J, and K equations 

Page 32: Finite State Machine, Memory Systems

Step 4 - Draw resulting diagram

 

Page 33: Finite State Machine, Memory Systems

Implementing FSM with No Inputs Using D, T, and JK Flip Flops

Convert the diagram into a chart

Page 34: Finite State Machine, Memory Systems

Implementing FSM with No Inputs Using D, T, and JK Flip Flops Cont.

For D and T Flip Flops

Page 35: Finite State Machine, Memory Systems

Implementing FSM with No Inputs Using D, T, and JK Flip Flops Cont.

For JK Flip Flop

Page 36: Finite State Machine, Memory Systems

Implementing FSM with No Inputs Using D, T, and JK Flip Flops Cont.

Final Implementation

Page 37: Finite State Machine, Memory Systems
Page 38: Finite State Machine, Memory Systems
Page 39: Finite State Machine, Memory Systems
Page 40: Finite State Machine, Memory Systems
Page 41: Finite State Machine, Memory Systems