Home › Practice › RTL Design › 4-bit barrel rotator
4-bit barrel rotator
EasyRTLcombinational
Build a 4-bit combinational barrel rotator.
ais a 4-bit input,shis the rotation amount (0 to 3 bits), anddirselects the direction.- When
dir=0, rotatealeft byshpositions (bits shifted off the top wrap around to the bottom). - When
dir=1, rotatearight byshpositions (bits shifted off the bottom wrap around to the top). - No clock. The output follows the inputs.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.