- . 8- 1- (8'b00001111 << 1), 8'b00011110) , 9 (8'b00001111 << 9), , 8'b00011110, 17 , :

, , , 1 (1,9,17,25... 249), 001 (1).
, 6 (6,14,22,30... 254), 110 (6).
, (8'b00000111), , :
reg_out_temp <= reg_in_1 << (reg_in_2 & 8'h07);
reg_out_temp must be double reg_in_1, in this case there reg_out_temp must be 16 bits and reg_in_18 bits, so you can get the bits to be transferred to another byte when you transfer the data so that they can be combined using the OR expression:
reg_out <= reg_out_temp[15:8] | reg_out_temp[7:0];
So, in two measures you get the result. For 16-bit rotation, your mask should be 8'b00011111( 8'h1F), because your shifts go from 0 to 16, and your temporary register should be 32 bits.
source
share