Hardware interview practice
Build a FIFO reference model
Implement a bounded FIFO reference class with push, pop, is_full, is_empty, and size. Pop must report success.
Reviewed example
Work through one case
Input
DEPTH=2; push A, push B, push C; pop three timesExpected output
C push rejected; pops return A(ok=1), B(ok=1), then zero(ok=0)Capacity never exceeds two, and successful pops preserve first-in-first-out order before the defined empty result.
What to cover
Requirements
- Do not grow beyond DEPTH.
- Return zero data and ok = 0 when empty.
- Preserve first-in, first-out ordering.
