F
fl
Guest
Hi,
I see a question online:
how will u write d ff using variables alone
Below is my VHDL code. Because I do not see any specialties in the code,
I suspect that the code is not it is supposed to be.
What is your opinion on the question?
Thanks,
...................
process(CLR,PRE,CLK) --process with sensitivity list.
variable v_d: std_ulogic := '0';
begin
if (CLR = '1') then --Asynchronous clear input
v_d := '0';
else
if(PRE = '1') then --Asynchronous set input
v_d := '1';
else
if ( CE = '1' and falling_edge(CLK) ) then
v_d := '1';
end if;
end if;
end if;
Q <= v_d;
end process;
I see a question online:
how will u write d ff using variables alone
Below is my VHDL code. Because I do not see any specialties in the code,
I suspect that the code is not it is supposed to be.
What is your opinion on the question?
Thanks,
...................
process(CLR,PRE,CLK) --process with sensitivity list.
variable v_d: std_ulogic := '0';
begin
if (CLR = '1') then --Asynchronous clear input
v_d := '0';
else
if(PRE = '1') then --Asynchronous set input
v_d := '1';
else
if ( CE = '1' and falling_edge(CLK) ) then
v_d := '1';
end if;
end if;
end if;
Q <= v_d;
end process;