34 / 36 · Khái niệm
Design a small state machine
Describe state, input and next state in a transition table.
Bài học miễn phí. Đăng ký để lưu tiến độ học tập.
Chưa có bản dịch. Nội dung bài học gốc được hiển thị. (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.
Tự thử
If the current state is BUSY, start=1 and done=0, what is next?
Đọc giải thích
It remains BUSY; only done controls the transition in that state.