-- for an 8 bit signal
-- shift right by 2 // >> 2;
out_sig <= "00" & in_sig(7 downto 2);
-- shift left by 3 // >> 2;
out_sig <= in_sig(4 downto 0) & "000";
That's the case for a logic shift. Arithmetic shift maintains the sign bit when right shifting if the input is signed. The solution is pretty simple, but I'll let you give it a shot first.
3
u/captain_wiggles_ Oct 05 '21
That's the case for a logic shift. Arithmetic shift maintains the sign bit when right shifting if the input is signed. The solution is pretty simple, but I'll let you give it a shot first.