library IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
entity srff is
port (s:in STD_LOGIC;
r:in STD_LOGIC;
clk:in STD_LOGIC;
q:inout STD_LOGIC
);
end srff;
architecture srff_arch of srff is
begin
process (clk,s,r)
begin
if(clk='1' and clk'event)then
if(s='0' and r='0')
then q<=q;
elsif(s='0' and r='1')then
q<='0';
elsif(s='1' and r='0')then
q<='1';
elsif(s='1' and r='1')then
q<='X';
end if;
end if;
end process;
end srff_arch;
USE IEEE.STD_LOGIC_1164.ALL;
entity srff is
port (s:in STD_LOGIC;
r:in STD_LOGIC;
clk:in STD_LOGIC;
q:inout STD_LOGIC
);
end srff;
architecture srff_arch of srff is
begin
process (clk,s,r)
begin
if(clk='1' and clk'event)then
if(s='0' and r='0')
then q<=q;
elsif(s='0' and r='1')then
q<='0';
elsif(s='1' and r='0')then
q<='1';
elsif(s='1' and r='1')then
q<='X';
end if;
end if;
end process;
end srff_arch;
No comments:
Post a Comment