Professional Documents
Culture Documents
Shifting
operation: s_l=0. Parallel load: s_l=1. Provide the VHDL code and create a
VHDL testbench. The clock frequency must be 50 MHz. Submit the
implementaion of your design in google doc.
VHDL code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity sipo is
port( res: in std_logic;
s_1: in std_logic;
clk: in std_logic;
pout: out std_logic_vector(3 downto 0));
end sipo;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity sipotb is
-- Port ( );
end sipotb;
begin
clk_process :process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
stim_proc: process
begin
s_1<='0';
wait for 20 ns;
s_1<='0';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='0';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='0';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='0';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
s_1<='0';
wait for 20 ns;
s_1<='1';
wait for 20 ns;
wait;
wait;
end process;
END;
Schematic Diagram:
Output Waveform: