I have recently started working on HDL , while going through right/left shift operators what i have studied in my school was they are continous D FlipFlops that shift data bit by bit to result the output.
I assumed same will be done over while synthesizing them in hdl, but i couldn't see the same hardware in verilog synthesis , its appearing like simple concatenation operations in the RTL_LSHIFT.
Could some one explain me how actually the hardware will be inside this RTL_LSHIFT. If it is FF's then why there is no clock input to the BLock.
I know all the functionality of arithmetic and logic shift, I need the hardware synthesized in HDL.
Code:
module doubt(
input[5:0] a,
input [5:0] b,
input clk,
output reg [9:0] c,
output reg [9:0] d
);
reg s1,s2;
always @ ( posedge clk)
begin
c <= (a<<1);
d<= (b<<4);
end
endmodule
In hardware, a left/right shifter is a simple set of multiplexers, take a look at the barrel shifter's design. Also, it depends on the EDA synthesizer how this is inferred and possibly optimized.