Finite State Machine, Memory Systems

Post on 03-Feb-2016

33 views 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 of Finite State Machine, Memory Systems

Finite State Machine, Memory Systems

Prof. Sin-Min Lee

Department of Computer Science

Characteristic Equation of FFs

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

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

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:

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.

Implementing this FSM using a T Flip-Flop

T = XQ' + X'Q

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.

Implementing this FSM using a D Flip-Flop

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

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

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

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.

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.

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

Here is the final implementation.

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:

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”.

Implementing this FSM using a D Flip-Flop

Finally, here is our graph.

Processor/MemoryBus

PCI Bus

I/O Busses

Using T Flip Flop and JK Flip Flop

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

Step 1 - Translate diagram into StateTable 

Step 2 - Create maps for T and JK

 

Step 3 - Determine T, J, and K equations 

Step 4 - Draw resulting diagram

 

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

Convert the diagram into a chart

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

For D and T Flip Flops

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

For JK Flip Flop

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

Final Implementation