Hardware interview practice
Map packed words to unpacked bytes
Split a 32-bit packed word into four unpacked bytes using little-endian byte lanes, then rebuild the original word.
Reviewed example
Work through one case
Input
word = 32'hA1B2_C3D4Expected output
bytes[0:3] = [D4, C3, B2, A1]; rebuilt_word = 32'hA1B2_C3D4Little-endian lane zero is word[7:0], and the inverse indexed part-select mapping reproduces every source bit.
What to cover
Requirements
- Define byte 0 as word[7:0].
- Use indexed part-selects rather than an implicit array assignment.
- Rebuilding the word must reproduce every input bit.
