Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 lookAheadTest IS
- END lookAheadTest;
- ARCHITECTURE behavior OF rippleTest IS
- -- Component Declaration for the Unit Under Test (UUT)
- COMPONENT rippleAdder
- PORT(
- x : IN std_logic_vector(3 downto 0);
- y : IN std_logic_vector(3 downto 0);
- Cin : IN std_logic;
- S : OUT std_logic_vector(3 downto 0);
- Cout : OUT std_logic;
- control : IN std_logic
- );
- END COMPONENT;
- --Inputs
- signal x : std_logic_vector(3 downto 0) := "0000";
- signal y : std_logic_vector(3 downto 0) := "0000";
- signal Cin : std_logic := '0';
- signal control : std_logic := '0';
- --Outputs
- signal S : std_logic_vector(3 downto 0);
- signal Cout : std_logic;
- -- No clocks detected in port list. Replace <clock> below with
- -- appropriate port name
- --constant <clock>_period : time := 10 ns;
- BEGIN
- -- Instantiate the Unit Under Test (UUT)
- uut: rippleAdder PORT MAP (
- x => x,
- y => y,
- Cin => Cin,
- S => S,
- Cout => Cout,
- control => control
- );
- -- Stimulus process
- stim_proc: process
- begin
- control <= '0' ;
- wait for 100 ns ;
- x <= "0111" ;
- y <= "0111" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "1101" ;
- y <= "1101" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "0100" ;
- y <= "1010" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "1111" ;
- y <= "0000" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "1010" ;
- y <= "0001" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "0010" ;
- y <= "1011" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "0000" ;
- y <= "0000" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "1111" ;
- y <= "1111" ;
- Cin <= '1' ;
- control <= '1' ;
- wait for 100 ns ;
- x <= "0101" ;
- y <= "1001" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "0011" ;
- y <= "1100" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "0100" ;
- y <= "1010" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "1111" ;
- y <= "0000" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "1010" ;
- y <= "0001" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "0010" ;
- y <= "1011" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "0000" ;
- y <= "0000" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "1001" ;
- y <= "0001" ;
- Cin <= '1' ;
- wait for 100 ns ;
- x <= "1111" ;
- y <= "1111" ;
- Cin <= '1' ;
- wait for 100 ns ;
- control <= '0' ;
- x <= "1101" ;
- y <= "1101" ;
- Cin <= '0' ;
- wait for 100 ns ;
- x <= "0111" ;
- y <= "0111" ;
- Cin <= '0' ;
- end process;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement