Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Reverse a physical bus at the lane boundary

Hardware interview practice

Reverse a physical bus at the lane boundary

EasyRTL DesignSystemVerilog

A board routes a peripheral bus in reverse bit order. Build a parameterized combinational adapter whose output bit i is input bit W - 1 - i.

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
W=8; input=8'b1101_0010
Expected output
output=8'b0100_1011

Output bit i is wired directly from input bit 7-i, making this a bit reversal rather than a byte-endian conversion.

What to cover

Requirements

  1. Treat this as bit reversal, not a byte swap or numeric endian conversion.
  2. Support every static width W >= 1, including odd widths and W = 1.
  3. Drive every output bit on every evaluation and infer no state.
  4. Use only compile-time-bounded, synthesizable wiring.
Continue practicing

Related questions

RTL DesignDiagnose storage from an incomplete always_comb block→RTL DesignImplement a parameterized binary-to-Gray converter→RTL DesignChoose always_comb over a manual sensitivity list→
asic.fyi · Learn silicon end to end.info@asic.fyi