The best way I found to do this is finding a pattern. When you want to rotate left an 8 bit signal 1 position (8'b00001111 << 1
) the result is 8'b00011110
) also when you want to rotate left 9 positions (8'b00001111 << 9
) the result is the same, 8'b00011110
, and also rotating 17 positions, this reduces your possibilities to next table:

So if you look, the three first bits of all numbers on tale equivalent to rotate 1 position (1,9,17,25...249) are equal to 001 (1).
The three first bits of all numbers on table equivalent to rotate 6 positions (6,14,22,30...254) are equal to 110 (6).
So you can apply a mask (8'b00000111
) to determine the correct shifting by making zero all other bits:
reg_out_temp <= reg_in_1 << (reg_in_2 & 8'h07);
reg_out_temp
shall be the double of reg_in_1
, in this case reg_out_temp
shall be 16 bit and reg_in_1
8 bit, so you can get the carried bits to the other byte when you shift the data so you can combine them using an OR expression:
reg_out <= reg_out_temp[15:8] | reg_out_temp[7:0];
So by two clock cycles you have the result. For a 16 bit rotation, your mask shall be 8'b00011111
(8'h1F
) because your shifts goes from 0 to 16, and your temporary register shall be of 32 bits.