Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ434
Page ↗
Q434FWASIC interview problem

Reverse a bit vector

TechniquesBitsParameterized width
DifficultyEasy
TopicBit Manipulation
LanguageSystemVerilog
Requirements2 checkpoints
01

Problem

Reverse the bit order of a W-bit vector.

Example input and output

Use this case to check your interpretation
Input
W=8, value = 8'b1101_0010
Output
8'b0100_1011
Explanation

Output bit i receives input bit 7-i, including the leading and trailing zeros.

02

Requirements (2)

  • Support a compile-time width parameter.
  • Map input bit W - 1 - i to output bit i.