Hardware interview practice
Check hold while stalled
Given the previous cycle's ready/valid state and the current valid and payload values, return 1 when the transfer obeys the stall rule. After a stalled cycle, valid must remain asserted and the payload must stay unchanged.

Reviewed example
Work through one case
Input
previous cycle: valid=1, ready=0, payload=0x55; current cycle: valid=1, ready=1, payload=0x56Expected output
legal=0The previous cycle created a hold obligation. The payload must remain 0x55 on the next sample even though ready is now high.
What to cover
Requirements
- Use the previous cycle to decide whether a hold obligation exists.
- Require current valid and use case equality for the four-state payload.
- Return legal when the previous cycle was not stalled.
