M
Max
Guest
I need that ch_en signal does low when reset is low; when reset is
high I need to write ch_en only when regen_en is '1' and I have
rising edge of wr.
I wrote the following codes:
----------version 1 ------------------
process (reset, regen_en, wr)
begin
if reset = '0' then
ch_en = '0';
elsif regen_en = '1' and rising_edge(wr) then
ch_en <= ctrl_data_bus(0);
end if;
end process;
--------------------------
----version 2--------------------------
ch_en <= '0' when reset = '1' else
ctrl_data_bus(0) when regen_en = '1' and rising_edge(wr);
--------------------------------------
I don't know if it make sense to use rising_edge() out of a process
block.
I think thant version 1 is correct, and I have some doubt about
version 2.
Anyway is better to use version 1 or version 2?
thanks
high I need to write ch_en only when regen_en is '1' and I have
rising edge of wr.
I wrote the following codes:
----------version 1 ------------------
process (reset, regen_en, wr)
begin
if reset = '0' then
ch_en = '0';
elsif regen_en = '1' and rising_edge(wr) then
ch_en <= ctrl_data_bus(0);
end if;
end process;
--------------------------
----version 2--------------------------
ch_en <= '0' when reset = '1' else
ctrl_data_bus(0) when regen_en = '1' and rising_edge(wr);
--------------------------------------
I don't know if it make sense to use rising_edge() out of a process
block.
I think thant version 1 is correct, and I have some doubt about
version 2.
Anyway is better to use version 1 or version 2?
thanks