Home › Practice › Design Verification › Waveform: the detector that misses a repeat
Waveform: the detector that misses a repeat
EasyWaveformdebugFSM
A sequence detector watches the input din, one bit per clock, and raises hit in the same cycle as the last bit of the pattern 101. The spec says the patterns may overlap: in 10101 there are two matches, because the last 1 of the first match is also the first 1 of the second. Below is the waveform from your teammate's test, where rst is high in the first cycle.
Concept first. A detector keeps just enough memory to know how much of the pattern it has seen so far. After a match, the end of the match can still be the start of the next one, so the memory must not be wiped. When you read such a waveform, mark every place where the last three bits of din are 101. Each of those cycles must show a 1 on hit. A missing 1 is the bug, and an extra 1 would be one too.
What to do.
- Walk along
dinand note each cycle where the last three bits are 1, 0, 1. - Click the cell of
hitwhere the output first disagrees with that rule, then press Check.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.