Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.87 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.all;
  3. use IEEE.STD_LOGIC_unsigned.all;
  4. entity numarator_minute is
  5. port(clk,reset:in std_logic;
  6. iesire:out std_logic_vector(5 downto 0));
  7. end numarator_minute;
  8.  
  9. architecture arh_minute of numarator_minute is
  10. signal copie: std_logic_vector(5 downto 0):="000000";
  11. begin
  12. process(clk,reset)
  13. begin
  14. if(reset='1') then
  15. copie<="000000";
  16. elsif(clk='1' and clk'event) then
  17. copie<=copie+"000001";
  18. end if;
  19. if(copie="111011")then
  20. copie<="000000" after 0 ms;
  21. end if;
  22. end process;
  23. iesire<=copie;
  24. end arh_minute;
  25. library IEEE;
  26. use IEEE.STD_LOGIC_1164.all;
  27. use IEEE.STD_LOGIC_unsigned.all;
  28. entity numarator_ore is
  29. port(clk,reset:in std_logic;
  30. iesire:out std_logic_vector(4 downto 0));
  31. end numarator_ore;
  32.  
  33. architecture arh_ore of numarator_ore is
  34. signal copie: std_logic_vector(4 downto 0):="00000";
  35. begin
  36. process(clk,reset)
  37. begin
  38. if(reset='1') then
  39. copie<="00000";
  40. elsif(clk='1' and clk'event) then
  41. copie<=copie+"00001";
  42. end if;
  43. if(copie="10111")then
  44. copie<="00000";
  45. end if;
  46. end process;
  47. iesire<=copie;
  48. end arh_ore;
  49. library IEEE;
  50. use IEEE.STD_LOGIC_1164.all;
  51. use IEEE.STD_LOGIC_unsigned.all;
  52. entity numarator_zile2 is
  53. port(clk,reset:in std_logic;
  54. iesire:out std_logic_vector(2 downto 0));
  55. end numarator_zile2;
  56.  
  57. architecture arh_zile2 of numarator_zile2 is
  58. signal copie: std_logic_vector(2 downto 0):="001";
  59. begin
  60. process(clk,reset)
  61. begin
  62. if(reset='1') then
  63. copie<="001";
  64. elsif(clk='1' and clk'event) then
  65. copie<=copie+"001";
  66. end if;
  67. if(copie="111")then
  68. copie<="001";
  69. end if;
  70. end process;
  71. iesire<=copie;
  72. end arh_zile2;
  73. library IEEE;
  74. use IEEE.STD_LOGIC_1164.all;
  75. use IEEE.STD_LOGIC_unsigned.all;
  76. entity numarator_zile1 is
  77. port(clk,reset:in std_logic;
  78. iesire:out std_logic_vector(4 downto 0));
  79. end numarator_zile1;
  80.  
  81. architecture arh_zile1 of numarator_zile1 is
  82. signal copie: std_logic_vector(4 downto 0):="00001";
  83. begin
  84. process(clk,reset)
  85. begin
  86. if(reset='1') then
  87. copie<="00001";
  88. elsif(clk='1' and clk'event) then
  89. copie<=copie+"00001";
  90. end if;
  91. if(copie="11110")then
  92. copie<="00001";
  93. end if;
  94. end process;
  95. iesire<=copie;
  96. end arh_zile1;
  97. library IEEE;
  98. use IEEE.STD_LOGIC_1164.all;
  99. use IEEE.STD_LOGIC_unsigned.all;
  100. entity numarator_luni is
  101. port(clk,reset:in std_logic;
  102. iesire:out std_logic_vector(3 downto 0));
  103. end numarator_luni;
  104.  
  105. architecture arh_luni of numarator_luni is
  106. signal copie: std_logic_vector(3 downto 0):="0001";
  107. begin
  108. process(clk,reset)
  109. begin
  110. if(reset='1') then
  111. copie<="0001";
  112. elsif(clk='1' and clk'event) then
  113. copie<=copie+"0001";
  114. end if;
  115. if(copie="1100")then
  116. copie<="0001";
  117. end if;
  118. end process;
  119. iesire<=copie;
  120. end arh_luni;
  121. library IEEE;
  122. use IEEE.STD_LOGIC_1164.all;
  123. use IEEE.STD_LOGIC_unsigned.all;
  124. entity numarator_ani is
  125. port(clk,reset:in std_logic;
  126. iesire:out std_logic_vector(11 downto 0));
  127. end numarator_ani;
  128.  
  129. architecture arh_ani of numarator_ani is
  130. signal copie: std_logic_vector(11 downto 0):="011111100011";
  131. begin
  132. process(clk,reset)
  133. begin
  134. if(reset='1') then
  135. copie<="011111100011";
  136. elsif(clk='1' and clk'event) then
  137. copie<=copie+"000000000001";
  138. end if;
  139. end process;
  140. iesire<=copie;
  141. end arh_ani;
  142. library IEEE;
  143. use IEEE.STD_LOGIC_1164.all;
  144. use IEEE.STD_LOGIC_unsigned.all;
  145. entity numarator_minute is
  146. port(clk,reset:in std_logic;
  147. iesire:out std_logic_vector(5 downto 0));
  148. end numarator_minute;
  149.  
  150. architecture arh_minute2 of numarator_minute is
  151. signal copie: std_logic_vector(5 downto 0):="000000";
  152. begin
  153. process(clk,reset)
  154. begin
  155. if(reset='1') then
  156. copie<="000000";
  157. elsif(clk='1' and clk'event) then
  158. copie<=copie+"000001";
  159. end if;
  160. if(copie="111011")then
  161. copie<="000000" after 0 ms;
  162. end if;
  163. end process;
  164. iesire<=copie;
  165. end arh_minute2;
  166. library IEEE;
  167. use IEEE.STD_LOGIC_1164.all;
  168. use IEEE.STD_LOGIC_unsigned.all;
  169. entity numarator_ore is
  170. port(clk,reset:in std_logic;
  171. iesire:out std_logic_vector(4 downto 0));
  172. end numarator_ore;
  173.  
  174. architecture arh_ore2 of numarator_ore is
  175. signal copie: std_logic_vector(4 downto 0):="00000";
  176. begin
  177. process(clk,reset)
  178. begin
  179. if(reset='1') then
  180. copie<="00000";
  181. elsif(clk='1' and clk'event) then
  182. copie<=copie+"00001";
  183. end if;
  184. if(copie="10111")then
  185. copie<="00000";
  186. end if;
  187. end process;
  188. iesire<=copie;
  189. end arh_ore2;
  190. library ieee;
  191. use ieee.std_logic_1164.all;
  192.  
  193. entity sapte_segmente is
  194. port(
  195. x:in std_logic_vector(2 downto 0);
  196. y:out std_logic_vector(6 downto 0)
  197. );
  198. end sapte_segmente;
  199.  
  200. architecture decodificatorprimalitera of sapte_segmente is
  201. begin
  202. with x select
  203. y<="0001110" when "001",
  204. "1110110" when "010",
  205. "1110110" when "011",
  206. "0111000" when "100",
  207. "0111110" when "101",
  208. "1011011" when "110",
  209. "1111110" when "111",
  210. "0000001" when others;
  211. end decodificatorprimalitera;
  212. architecture decodificatoradoualitera of sapte_segmente is
  213. begin
  214. with x select
  215. y<="0111110" when "001",
  216. "1110111" when "010",
  217. "0110000" when "011",
  218. "1111110" when "100",
  219. "0110000" when "101",
  220. "1110111" when "110",
  221. "0111110" when "111",
  222. "0000001" when others;
  223. end decodificatoradoualitera;
  224. library IEEE;
  225. use ieee.std_Logic_1164.all;
  226. entity comparator5 is
  227. port( intrare1,intrare2:in std_logic_vector(4 downto 0);
  228. iesire:out std_logic);
  229. end comparator5;
  230.  
  231. architecture comparator5b of comparator5 is
  232. begin
  233. iesire<= '1' when (intrare1=intrare2) else '0';
  234. end comparator5b;
  235. library IEEE;
  236. use ieee.std_Logic_1164.all;
  237. entity comparator6 is
  238. port( intrare1,intrare2:in std_logic_vector(5 downto 0);
  239. iesire:out std_logic);
  240. end comparator6;
  241.  
  242. architecture comparator6b of comparator6 is
  243. begin
  244. iesire<= '1' when (intrare1=intrare2) else '0';
  245. end comparator6b;
  246. library IEEE;
  247. use ieee.std_logic_1164.all;
  248. entity poarta_si is
  249. port(a,b:in std_logic;
  250. iesire:out std_logic);
  251. end poarta_si;
  252. architecture si of poarta_si is
  253. begin
  254. iesire<=a and b;
  255. end si;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement