Hardware interview practice
Detect X or Z in valid data
Report an error whenever a valid 32-bit data value contains any X or Z bit.
Reviewed example
Work through one case
Input
cycle 4: valid=1,data contains bit X; cycle 5: valid=0,data contains bit ZExpected output
error at cycle 4 onlyFour-state detection flags the accepted unknown value, while invalid-cycle payload is deliberately ignored.
What to cover
Requirements
- Check only when valid is asserted.
- Detect both X and Z.
- Use four-state semantics.
