Verilog practice / Problem 16
Rotate left by any amount
Rotate the 8-bit input d left by amt places (0 to 7). Bits that fall off the top come back in at the bottom. For example, d = 8'b1000_0001 rotated by 1 gives 8'b0000_0011.
Ports
| Name | Direction | Bits |
|---|---|---|
d | input | 8 |
amt | input | 3 |
y | output | 8 |
How it's checked
The test tries the input combinations and checks every output for each one.
Stuck? Read the lesson Barrel shifters and glitches.
rotate8.vCtrl + Enter runs