源程序:
library ieee;
usr ieee.std_logic_1164.all;
entity jcq is
port(clk:in std_logic;
r:in std_logic;
d:in std_logic_vector(3 dowmto 0);
q:out std_logic_vector(3 downto 0);
end jcq;
architecture rtl lf jcq is
signal q_temp:std_logic_vecter(3 dowmto 0);
begin
process(clk,r)
begin
if(r='1')then
q_temp<="0000";
elsif(clk'event and clk='1')then
q_temp<=d;
end if;
q<=q_temp;
end process;
end rtl;