lemueltra

ffjk_tb

Feb 16th, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.79 KB | None | 0 0
  1. -- Descrição do testbench do flip-flop JK
  2. library ieee;
  3. use ieee.std_logic_1164.all;
  4.  
  5. entity ffjk_tb is
  6. end ffjk_tb;
  7.  
  8. architecture teste of ffjk_tb is
  9. component ffjk
  10.     port(
  11.         j: in std_logic;
  12.         k: in std_logic;
  13.         clk: in std_logic;
  14.         clr: in std_logic;
  15.         q: out std_logic
  16.     );
  17. end component;
  18. signal jj: std_logic := '0';
  19. signal kk: std_logic := '0';
  20. signal clock: std_logic := '0';
  21. signal clear: std_logic := '1';
  22. signal qq: std_logic;
  23. begin
  24.     flip_flop: ffjk port map (jj,kk,clock,clear,qq);
  25.     process (clock)
  26.     begin
  27.         clock <= not clock after 10 ns;
  28.     end process;
  29.     clear <= '0' after 10 ns, '1' after 50 ns;
  30.     jj <= '1' after 10 ns, '0' after 70 ns, '1' after 110 ns;
  31.     kk <= '1' after 30 ns, '0' after 50 ns, '1' after 70 ns, '0' after 90 ns, '1' after 110 ns;
  32. end teste;
Advertisement
Add Comment
Please, Sign In to add comment