Test Bench For 8 Bit Counter
Test Bench For 8 Bit Counter
vhdl code
• Test bench:
• LIBRARY ieee;
• USE ieee.std_logic_1164.ALL;
•
•
• ENTITY Bitcounter_8_tb IS
• END Bitcounter_8_tb;
•
• ARCHITECTURE behavior OF Bitcounter_8_tb IS
•
• -- Component Declaration for the Unit Under Test (UUT)
•
• COMPONENT Bitcounter_8
• PORT(
• CLK : IN std_logic;
• OUTPUT : OUT std_logic_vector(7 downto 0)
• );
• END COMPONENT;
•
•
• --Inputs
• signal CLK : std_logic := '0';
•
• --Outputs
• signal OUTPUT : std_logic_vector(7 downto 0);
•
• -- Clock period definitions
• constant CLK_period : time := 10 ns;
•
• BEGIN
•
• -- Instantiate the Unit Under Test (UUT)
• uut: Bitcounter_8 PORT MAP (
• CLK => CLK,
• OUTPUT => OUTPUT
• );
•
• -- Clock process definitions
• CLK_process :process
• begin
• CLK <= '0';
• wait for CLK_period/2;
• CLK <= '1';
• wait for CLK_period/2;
• end process;