finite state machine, memory systems
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 PresentationTRANSCRIPT
![Page 1: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/1.jpg)
Finite State Machine, Memory Systems
Prof. Sin-Min Lee
Department of Computer Science
![Page 2: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/2.jpg)
![Page 3: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/3.jpg)
![Page 4: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/4.jpg)
Characteristic Equation of FFs
![Page 5: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/5.jpg)
![Page 6: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/6.jpg)
![Page 7: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/8.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/9.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/10.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/11.jpg)
Implementing this FSM using a T Flip-Flop
T = XQ' + X'Q
![Page 12: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/13.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/17.jpg)
Implementing T Flip-Flop using only a JK Flip-Flop
Here is the final implementation.
![Page 18: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/18.jpg)
![Page 19: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/19.jpg)
![Page 20: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/20.jpg)
![Page 21: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/21.jpg)
![Page 22: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/22.jpg)
![Page 23: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/23.jpg)
![Page 24: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/24.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/25.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/26.jpg)
Implementing this FSM using a D Flip-Flop
Finally, here is our graph.
![Page 27: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/27.jpg)
Processor/MemoryBus
PCI Bus
I/O Busses
![Page 28: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/28.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/29.jpg)
Step 1 - Translate diagram into StateTable
![Page 30: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/30.jpg)
Step 2 - Create maps for T and JK
![Page 31: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/31.jpg)
Step 3 - Determine T, J, and K equations
![Page 32: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/32.jpg)
Step 4 - Draw resulting diagram
![Page 33: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/33.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/34.jpg)
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](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/35.jpg)
Implementing FSM with No Inputs Using D, T, and JK Flip Flops Cont.
For JK Flip Flop
![Page 36: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/36.jpg)
Implementing FSM with No Inputs Using D, T, and JK Flip Flops Cont.
Final Implementation
![Page 37: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/37.jpg)
![Page 38: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/38.jpg)
![Page 39: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/39.jpg)
![Page 40: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/40.jpg)
![Page 41: Finite State Machine, Memory Systems](https://reader036.vdocuments.site/reader036/viewer/2022062408/56815996550346895dc6dd56/html5/thumbnails/41.jpg)