Write a program that will control a pair of LEDs labeled LEFT and RIGHT connecte
ID: 2316884 • Letter: W
Question
Write a program that will control a pair of LEDs labeled LEFT and RIGHT connected to two output pins in PORTA. Using the keyboard you should be able to independently control the LEDs. For example, you may have to implement the followingExplanation / Answer
LIBRARY ieee; USE ieee.std_logic_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --USE ieee.numeric_std.ALL; ENTITY ifstmt_tb IS END ifstmt_tb; ARCHITECTURE behavior OF ifstmt_tb IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT ram_ctrl_test PORT( clk : IN std_logic; reset : IN std_logic; sw : IN std_logic_vector(7 downto 0); btn : IN std_logic_vector(2 downto 0); led : OUT std_logic_vector(7 downto 0) ); END COMPONENT; --Inputs signal clk : std_logic := '0'; signal reset : std_logic := '0'; signal sw : std_logic_vector(7 downto 0) := (others => '0'); signal btn : std_logic_vector(2 downto 0) := (others => '0'); --Outputs signal led : std_logic_vector(7 downto 0); -- Clock period definitions constant clk_period : time := 10 ns; BEGIN -- Instantiate the Unit Under Test (UUT) uut: ram_ctrl_test PORT MAP ( clk => clk, reset => reset, sw => sw, btn => btn, led => led ); -- Clock process definitions clk_process :process begin clk '0'); wait for clk_period*5; btn '0'); -- insert stimulus here wait; end process; END;Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.