Hardware interview practice
Verify a nested microcode decoder
Write the bounded parser oracle and two core streaming properties for a token decoder that expands nested repeat groups up to depth four and 64 output bytes.
Reviewed example
Work through one case
Input
token frame encodes COUNT 2 OPEN, literal A, COUNT 2 OPEN, literal B, CLOSE, CLOSEExpected output
decoded bytes="ABBABB"The inner group expands B twice to BB, then the outer group repeats ABB twice without exceeding depth or output limits.
What to cover
Requirements
- Predict exact legal bytes or one all-zero error beat using the earliest accepted-token fault and the specified code priority for simultaneous conditions.
- Enforce at most 32 input tokens, nesting depth four, repeat counts 1 through 4, nonempty groups, and decoded length 1 through 64.
- Require first output availability within two cycles of an accepted final token and keep every stalled output field stable.
- Explain legal-tree generation, one-fault mutation, response scoreboarding, reset, and coverage as follow-up verification work.
