Advertisement
Tyler_Elric

Untitled

Dec 9th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.46 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity Lab8 is
  5.     port (
  6.         clk: in std_logic;
  7.         t: in std_logic;
  8.         rstn: in std_logic;
  9.         q: out std_logic;
  10.         qn: out std_logic
  11.     );
  12. end Lab8;
  13.  
  14. architecture behavior of Lab8 is
  15.     signal prev: std_logic;
  16. begin
  17.     process(clk,rstn) begin
  18.         if rstn = '0' then
  19.             prev <= '0';
  20.         elsif clk'EVENT and clk = '1' AND t = '1' then
  21.             prev <= NOT prev;
  22.         end if;
  23.     end process;
  24.     q <= prev;
  25.     qn <= NOT prev;
  26. end behavior;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement