registers; state machines analysis section 7-1 section 5-4
TRANSCRIPT
![Page 1: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/1.jpg)
Registers; State Machines Analysis
Section 7-1Section 5-4
![Page 2: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/2.jpg)
2
Definition
• Register – a set of flip-flops♦ May include extensive logic to control
state transition♦ register also refers to fast memory for
storing data in a computer
![Page 3: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/3.jpg)
3
Simple Register
• Store D = (D0 D1 D2 D3)
• On positive edge of Clock
• Clear signal normally high♦ Power-up reset
![Page 4: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/4.jpg)
4
Register with Load Control
• If load signal is H♦ D0 , D1 , D2 , D3
reach inputs of FFs
• If load signal is L, Q is fed back♦ Q0 , Q1 , Q2 , Q3
reach inputs of FFs♦ FFs Keep same
value
![Page 5: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/5.jpg)
5
State Machines: Analysis and Design
• How to design machines that go through a sequence of events
• Basically close this loop
![Page 6: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/6.jpg)
6
Analysis of Sequential Circuits
• Earlier we learned how to analyze combinational circuits
• Now extend to synchronous sequential♦ Include time
• We’ll use state tables and state diagrams
![Page 7: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/7.jpg)
8
Input Equations: D FF Example
( )AD AX BX
XADB
XBAY )(
Describe inputs to FF with logic equations
![Page 8: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/8.jpg)
9
Determining Next State and Output
Current state= {A(t), B(t)} = values stored in FFs during clock t
Next state= {A(t+1), B(t+1) = values stored in FFs during clock t+1}
![Page 9: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/9.jpg)
10
Determining Next State and OutputThe current state {A(t), B(t)} & input X are used to determine next state {A(t+1), B(t+1)}( 1)
( ) ( ) ( ) ( ) ( )A
A t
D t A t X t B t X t
( 1)
( ) ( ) ( )B
B t
D t A t X t
![Page 10: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/10.jpg)
11
Determining Next State and Output (cont.)
Current state & input X are used to determine output, Y
• Synchronous circuit♦ State transitions are at
positive edge of clock
( ) ( ( ) ( )) ( )Y t A t B t X t
( 1)A t AX BX ( 1)B t AX
( )Y A B X
![Page 11: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/11.jpg)
12
State Table
• Just truth table with state added
( 1) ( )AA t D t AX BX ( 1) ( )BB t D t AX XBAY )(
At time tAt time t+1
![Page 12: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/12.jpg)
13
Two Dimensional State Table
• Same thing, different layout
)( BXAXDA
XADB
XBAY )(
![Page 13: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/13.jpg)
14
Sequential Circuit Types
• Moore model – outputs depend on states
• Mealy model – outputs also depend on inputs
![Page 14: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/14.jpg)
15
State Diagram• Alternative representation for
state table• Moore: outputs depend only on
statesState/Output
Inputs
( ) ( 1)AD X Y A A t
Z A
![Page 15: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/15.jpg)
16
Mealy Model
• Output depends on input and state Input/Output
State Table for Circuit of Figure 6-17
---------------------------------------------State Table for Circuit of Figure 5-15
![Page 16: Registers; State Machines Analysis Section 7-1 Section 5-4](https://reader035.vdocuments.net/reader035/viewer/2022070414/5697c0071a28abf838cc5ca7/html5/thumbnails/16.jpg)
17
State Table vs. Diagram
• Same information• Table is perhaps easier to fill in
from description• Diagram is easier for
understanding and writing code♦ You can label states with English
description