coletucker12

fulladder1bittest

Sep 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.80 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   16:04:53 09/23/2019
  6. -- Design Name:  
  7. -- Module Name:   C:/Users/cgtucker/CompOrg/Lab2Attempt2/full_adder_1bit_test.vhd
  8. -- Project Name:  Lab2Attempt2
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: full_adder_1bit
  14. --
  15. -- Dependencies:
  16. --
  17. -- Revision:
  18. -- Revision 0.01 - File Created
  19. -- Additional Comments:
  20. --
  21. -- Notes:
  22. -- This testbench has been automatically generated using types std_logic and
  23. -- std_logic_vector for the ports of the unit under test.  Xilinx recommends
  24. -- that these types always be used for the top-level I/O of a design in order
  25. -- to guarantee that the testbench will bind correctly to the post-implementation
  26. -- simulation model.
  27. --------------------------------------------------------------------------------
  28. LIBRARY ieee;
  29. USE ieee.std_logic_1164.ALL;
  30.  
  31. -- Uncomment the following library declaration if using
  32. -- arithmetic functions with Signed or Unsigned values
  33. --USE ieee.numeric_std.ALL;
  34.  
  35. ENTITY full_adder_1bit_test IS
  36. END full_adder_1bit_test;
  37.  
  38. ARCHITECTURE behavior OF full_adder_1bit_test IS
  39.  
  40.     -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42.     COMPONENT full_adder_1bit
  43.     PORT(
  44.          Cin : IN  std_logic;
  45.          A : IN  std_logic;
  46.          B : IN  std_logic;
  47.          Sout : OUT  std_logic;
  48.          Cout : OUT  std_logic
  49.         );
  50.     END COMPONENT;
  51.    
  52.  
  53.    --Inputs
  54.    signal Cin : std_logic := '0';
  55.    signal A : std_logic := '0';
  56.    signal B : std_logic := '0';
  57.  
  58.     --Outputs
  59.    signal Sout : std_logic;
  60.    signal Cout : std_logic;
  61.    -- No clocks detected in port list. Replace <clock> below with
  62.    -- appropriate port name
  63.  
  64. BEGIN
  65.  
  66.     -- Instantiate the Unit Under Test (UUT)
  67.    uut: full_adder_1bit PORT MAP (
  68.           Cin => Cin,
  69.           A => A,
  70.           B => B,
  71.           Sout => Sout,
  72.           Cout => Cout
  73.         );
  74.  
  75.    -- Clock process definitions
  76.  
  77.  
  78.    -- Stimulus process
  79.    stim_proc: process
  80.    begin       
  81.       -- hold reset state for 100 ns.
  82.       wait for 100 ns; 
  83.  
  84.       Cin <= '0';
  85.       A <= '0';
  86.       B <= '1';
  87.       wait for 100 ns;
  88.  
  89.       Cin <= '0';
  90.       A <= '1';
  91.       B <= '0';
  92.       wait for 100 ns;
  93.  
  94.  
  95.       Cin <= '0';
  96.       A <= '1';
  97.       B <= '1';
  98.       wait for 100 ns;
  99.  
  100.       Cin <= '1';
  101.       A <= '0';
  102.       B <= '0';
  103.       wait for 100 ns;
  104.  
  105.       Cin <= '1';
  106.       A <= '0';
  107.       B <= '1';
  108.       wait for 100 ns;
  109.  
  110.       Cin <= '1';
  111.       A <= '1';
  112.       B <= '0';
  113.       wait for 100 ns;
  114.  
  115.       Cin <= '1';
  116.       A <= '1';
  117.       B <= '1';
  118.       wait for 100 ns;
  119.  
  120.       -- insert stimulus here
  121.  
  122.       wait;
  123.    end process;
  124.  
  125. END;
Add Comment
Please, Sign In to add comment