Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Cross-check a byte reverser

Hardware interview practice

Cross-check a byte reverser

MediumReference ModelsSystemVerilog

Write the reference checks for a byte-window design that reverses an active prefix and clears every inactive output slot. Use both a direct prediction and the identity reverse(reverse(prefix)) = prefix.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Reviewed example

Work through one case

Input
count=3; input slots=[A,B,C,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD]; feed the first result through again
Expected output
first output=[C,B,A,0,0,0,0,0,0,0,0,0,0,0,0,0]; second active prefix=[A,B,C]

The direct oracle checks reversal and zeroed inactive lanes, while reverse-twice independently recovers the original active prefix.

What to cover

Requirements

  1. For counts from 0 through 16, compare every active byte with input[count - 1 - i] and require the complete inactive suffix to be zero.
  2. Define the second-pass check for feeding a legal first result back with the same count; compare its active prefix with the original and require a zero suffix.
  3. For count greater than 16, require request_error and an all-zero output.
  4. Assert that an accepted request completes within the stated bound and that no new start is issued while busy.
  5. Explain how zero, one, odd, even, full, invalid, repeated, palindromic, and dirty-suffix cases exercise the two checks.
asic.fyi · Learn silicon end to end.info@asic.fyi