DescriptionQ434
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 interpretationInput
W=8, value = 8'b1101_0010Output
8'b0100_1011Explanation
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.
