34 / 36 · 概念
Design a small state machine
Describe state, input and next state in a transition table.
课时内容可免费阅读,选课后可保存学习进度。
译文尚未提供,以下显示课时原文。 (English)
Learning goals
- Write a state transition table.
- Separate current state from next state.
State represents what the circuit must remember.
A controller that accepts a request and waits for completion can use IDLE and BUSY. In IDLE, start=1 enters BUSY; in BUSY, done=1 returns to IDLE.
Define simultaneous inputs too. Here IDLE considers only start and BUSY only done. Reset returns to IDLE.
| Current state | Condition | Next state |
|---|---|---|
| IDLE | start=0 | IDLE |
| IDLE | start=1 | BUSY |
| BUSY | done=0 | BUSY |
| BUSY | done=1 | IDLE |
Compute the next state, then store it at an edge.
Combinational logic computes next_state; always_ff stores state<=next_state at the clock edge. A Moore output depends only on state; a Mealy output also depends on current inputs.
Using unsynchronized signals from another clock domain is outside this example. All inputs here are assumed stable relative to the same clock.
自己试试
If the current state is BUSY, start=1 and done=0, what is next?
阅读解释
It remains BUSY; only done controls the transition in that state.