36 / 36 · 概念
Capstone: serial pattern detector
Design and check a state machine that detects the pattern 101.
课时内容可免费阅读,选课后可保存学习进度。
译文尚未提供,以下显示课时原文。 (English)
Learning goals
- Design a 101 detector using a transition table.
- Verify overlapping patterns and reset.
Keep only the relevant prefix as state.
S0 means no matching prefix, S1 means the last bit was 1, and S10 means the last two bits were 10. Receiving 1 in S10 completes 101.
Returning to S1 after detection reuses the last 1 as the start of another pattern. Thus 10101 matches at the third and fifth bits.
| State | Input 0 | Input 1 |
|---|---|---|
| S0 | S0 | S1 |
| S1 | S10 | S1 |
| S10 | S0 | S1 / hit=1 |
Finish by designing, predicting and comparing.
Register hit, storing the condition state==S10 and din==1 on each edge. Reset to state=S0 and hit=0. A match makes hit high for the cycle following the edge that samples that bit.
Test 000, 101, 10101, 11101 and a reset mid-pattern. The comparison tool is an educational transition model; it does not execute your RTL. Compare your own RTL against a separate simulation result.
更改输入
自己试试
For input 10101, what is hit after each edge?
阅读解释
The outputs are 0,0,1,0,1. The two matches share one input bit.