Here is another simple VHDL code to carryout simple bit shifting operation. I decided to post simple VHDL codes in this blog so that any newbie who reads this will be able to find some examples to work on. Make sure that you assign correct pins for inputs and outputs as mentioned in the
‘A’ should be connected to a push button
‘B’ should be connected to LEDs.
library IEEE; use IEEE.numeric_std.all; use IEEE.std_logic_1164.all; entity bitshiftror is port (A: in std_logic; B: out std_logic_vector(7 downto 0)); end entity bitshiftror; architecture bitshiftor of bitshiftror is signal B_out: BIT_VECTOR(7 downto 0) := (0 => '1', others => '0'); constant n: NATURAL := 1; begin aa: process (A) is begin if((A xor '1') = '1') then B_out <= (B_out ror n); B <= to_stdlogicvector(B_out); end if; end process aa; end architecture bitshiftor;