Advertisement
Jgug

DNOLAB_5_6

Dec 26th, 2013
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.05 KB | None | 0 0
  1. --FUNCTION_DESCRIPTION
  2. --NOT
  3. LIBRARY IEEE;
  4. USE IEEE.STD_LOGIC_1164.all;
  5. entity N is
  6. port(
  7.     a1: in STD_LOGIC;
  8.     b1: out STD_LOGIC);
  9. end N;
  10. architecture archN of N is
  11. begin
  12.     b1 <= not a1 after 1 ns;
  13. end archN;
  14. --NA2
  15. LIBRARY IEEE;
  16. USE IEEE.STD_LOGIC_1164.all;
  17. entity NA2 is
  18. port(
  19.     a1, a2: in STD_LOGIC;
  20.     b1: out STD_LOGIC);
  21. end NA2;
  22. architecture archNA2 of NA2 is
  23. begin
  24.     b1 <= not(a1 and a2) after 2 ns;
  25. end archNA2;
  26. --NOA22
  27. LIBRARY IEEE;
  28. USE IEEE.STD_LOGIC_1164.all;
  29. entity NOA22 is
  30. port(
  31.     a1, a2, a3, a4: in STD_LOGIC;
  32.     b1: out STD_LOGIC);
  33. end NOA22;
  34. architecture archNOA22 of NOA22 is
  35. begin
  36.     b1 <= not((a1 and a2) or (a3 and a4)) after 4 ns;
  37. end archNOA22;
  38.  
  39. --DEVICE_DESCRIPTION
  40. LIBRARY IEEE;
  41. USE IEEE.STD_LOGIC_1164.all;
  42. entity TRIG is
  43. port(
  44.     D, S, C: in STD_LOGIC;
  45.     Q: out STD_LOGIC);
  46. end TRIG;
  47. architecture archTRIG of TRIG is
  48. component N
  49. port(
  50.     a1: in STD_LOGIC;
  51.     b1: out STD_LOGIC);
  52. end component; 
  53. component NA2
  54. port(
  55.     a1, a2: in STD_LOGIC;
  56.     b1: out STD_LOGIC);
  57. end component;
  58. component NOA22
  59. port(
  60.     a1, a2, a3, a4: in STD_LOGIC;
  61.     b1: out STD_LOGIC);
  62. end component;
  63. signal za1, za2, zb1, zb2, zc1: STD_LOGIC;
  64. begin
  65. A_1:N port map(S,za1);
  66. A_2:N port map(C,za2);
  67. B_1:NOA22 port map(zc1,za1,D,zb2,zb1);
  68. B_2:N port map(za2,zb2);
  69. C_1:NA2 port map(za1,zb1,zc1);
  70. C_2:N port map(zb1,Q);
  71. end archTRIG;
  72.  
  73. --TEST_DESCRIPTION
  74. LIBRARY IEEE;
  75. USE IEEE.STD_LOGIC_1164.all;
  76. entity testTRIG is
  77. end testTRIG;
  78. architecture archtestTRIG of testTRIG is
  79. component TRIG
  80. port(
  81.     D, S, C: in STD_LOGIC;
  82.     Q: out STD_LOGIC);
  83. end component;
  84. signal D, S, C, Q: STD_LOGIC;
  85. begin
  86. --D <= '0','1' after 80 ns,'0' after 160 ns,'1' after 240 ns,'0' after 320 ns,'1' after 400 ns;
  87. --S <= '1','0' after 80 ns,'1' after 240 ns,'0' after 320 ns;
  88. --C <= '0','1' after 80 ns,'0' after 160 ns,'1' after 320 ns,'0' after 400 ns;
  89. D <= '0','1' after 80 ns,'0' after 160 ns,'1' after 320 ns;
  90. S <= '1','0' after 160 ns;
  91. C <= '0','1' after 160 ns,'0' after 240 ns,'1' after 320 ns,'0' after 400 ns;
  92. final: TRIG port map(D, S, C, Q);
  93. end archtestTRIG;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement