Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1.  
  2. LIBRARY ieee;
  3. USE ieee.std_logic_1164.ALL;
  4.  
  5. -- Uncomment the following library declaration if using
  6. -- arithmetic functions with Signed or Unsigned values
  7. --USE ieee.numeric_std.ALL;
  8.  
  9. ENTITY lookAheadTest IS
  10. END lookAheadTest;
  11.  
  12. ARCHITECTURE behavior OF rippleTest IS
  13.  
  14. -- Component Declaration for the Unit Under Test (UUT)
  15.  
  16. COMPONENT rippleAdder
  17. PORT(
  18. x : IN std_logic_vector(3 downto 0);
  19. y : IN std_logic_vector(3 downto 0);
  20. Cin : IN std_logic;
  21. S : OUT std_logic_vector(3 downto 0);
  22. Cout : OUT std_logic;
  23. control : IN std_logic
  24. );
  25. END COMPONENT;
  26.  
  27.  
  28. --Inputs
  29. signal x : std_logic_vector(3 downto 0) := "0000";
  30. signal y : std_logic_vector(3 downto 0) := "0000";
  31. signal Cin : std_logic := '0';
  32. signal control : std_logic := '0';
  33.  
  34. --Outputs
  35. signal S : std_logic_vector(3 downto 0);
  36. signal Cout : std_logic;
  37. -- No clocks detected in port list. Replace <clock> below with
  38. -- appropriate port name
  39.  
  40. --constant <clock>_period : time := 10 ns;
  41.  
  42. BEGIN
  43.  
  44. -- Instantiate the Unit Under Test (UUT)
  45. uut: rippleAdder PORT MAP (
  46. x => x,
  47. y => y,
  48. Cin => Cin,
  49. S => S,
  50. Cout => Cout,
  51. control => control
  52. );
  53.  
  54.  
  55.  
  56. -- Stimulus process
  57. stim_proc: process
  58. begin
  59. control <= '0' ;
  60. wait for 100 ns ;
  61. x <= "0111" ;
  62. y <= "0111" ;
  63. Cin <= '0' ;
  64. wait for 100 ns ;
  65. x <= "1101" ;
  66. y <= "1101" ;
  67. Cin <= '0' ;
  68. wait for 100 ns ;
  69. x <= "0100" ;
  70. y <= "1010" ;
  71. Cin <= '1' ;
  72. wait for 100 ns ;
  73. x <= "1111" ;
  74. y <= "0000" ;
  75. Cin <= '0' ;
  76. wait for 100 ns ;
  77. x <= "1010" ;
  78. y <= "0001" ;
  79. Cin <= '0' ;
  80. wait for 100 ns ;
  81. x <= "0010" ;
  82. y <= "1011" ;
  83. Cin <= '1' ;
  84. wait for 100 ns ;
  85. x <= "0000" ;
  86. y <= "0000" ;
  87. Cin <= '0' ;
  88. wait for 100 ns ;
  89. x <= "1111" ;
  90. y <= "1111" ;
  91. Cin <= '1' ;
  92.  
  93. control <= '1' ;
  94. wait for 100 ns ;
  95. x <= "0101" ;
  96. y <= "1001" ;
  97. Cin <= '1' ;
  98. wait for 100 ns ;
  99. x <= "0011" ;
  100. y <= "1100" ;
  101. Cin <= '0' ;
  102. wait for 100 ns ;
  103. x <= "0100" ;
  104. y <= "1010" ;
  105. Cin <= '1' ;
  106. wait for 100 ns ;
  107. x <= "1111" ;
  108. y <= "0000" ;
  109. Cin <= '0' ;
  110. wait for 100 ns ;
  111. x <= "1010" ;
  112. y <= "0001" ;
  113. Cin <= '0' ;
  114. wait for 100 ns ;
  115. x <= "0010" ;
  116. y <= "1011" ;
  117. Cin <= '1' ;
  118. wait for 100 ns ;
  119. x <= "0000" ;
  120. y <= "0000" ;
  121. Cin <= '0' ;
  122. wait for 100 ns ;
  123. x <= "1001" ;
  124. y <= "0001" ;
  125. Cin <= '1' ;
  126. wait for 100 ns ;
  127. x <= "1111" ;
  128. y <= "1111" ;
  129. Cin <= '1' ;
  130. wait for 100 ns ;
  131. control <= '0' ;
  132. x <= "1101" ;
  133. y <= "1101" ;
  134. Cin <= '0' ;
  135. wait for 100 ns ;
  136. x <= "0111" ;
  137. y <= "0111" ;
  138. Cin <= '0' ;
  139. end process;
  140.  
  141. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement