Write Verilog codes of 8-bit Log Left Shifter and 4-bit Barrel Right/Left Shifter.
Simulate the designs with test benches of at least 4 test cases.
A barrel shifter is simply a bit-rotating shift register.
The bits shifted out of LSB end of the register are
shifted back into the MSB end of the register. The
number of multiplexers required is n*log2(n), for an n
bit word. Four common word sizes and the number of
multiplexers needed are listed below:
64_bit -64*log2(64)=64*6=364
32_bit -32*log2(32)=32*5=160
16_bit -16*log2(16)=16*4=64
8_bit -8*log2(8)=64*3=24
Comments
Leave a comment