Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/Reverse a physical bus at the lane boundary

Q162·Free·SystemVerilog

Reverse a physical bus at the lane boundary

Difficulty
Easy
Topic
RTL Design
Language
SV
Interview prompt

Question

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.

Candidate starting point

Implementation scaffold

module bit_reverse_adapter #(
  parameter int unsigned W = 32
) (
  input  logic [W-1:0] in_bus,
  output logic [W-1:0] out_bus
);
  always_comb begin : reverse_bits
    // TODO: Implement reverse_bits using the supplied state and interface.
  end
endmodule
Reviewed example

Trace 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.
Exact question handoffPractice Q162

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

RTL Logic and State

Review combinational logic, sequential state, counters, arithmetic, and finite-state machines.

  • RTL Design
  • Bit reversal
  • Packed vectors
  • Combinational logic
RTL Logic and State →
Continue practicing

Related questions

Q283 · Combinational RTLBuild a parameterized N-to-1 multiplexerMediumP→Q149 · RTL DesignDiagnose storage from an incomplete always_comb blockEasy→
ASIC.FYI · Learn silicon end to end.info@asic.fyi