Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make process to execute when S'active?

Status
Not open for further replies.

PeggyYao

Programmer
Aug 25, 2003
6
SG
I'd like to execute one process whenever the signal S is active (that is, a new value is assigned to S, but not necessary to be different from the old value of S). How to make that?

If just put S in the process sensitive list, the process will only be executed when S has an event (that is, S gets a different value from the old one)...

Then, how shall I write? Thank you!
 
synched update process


signal Value: STD_LOGIC_VECTOR(7 dowhnto 0);
signal S: STD_LOGIC_VECTOR(7 dowhnto 0);
signal S_Active:STD_LOGIC;
signal S_Read: STD_LOGIC_VECTOR(7 dowhnto 0);
signal S_NotActive:STD_LOGIC;

-----------------------------
---- S Update process -------
-----------------------------
S_Writer: Process(CLK)
if (CLK = 1 AND CLK'event) then
if (however you know you have a 'Value' wanted?)then
S <=Value;-- update with value
S_Active <= NOT S_Active;-- mark as active
end if;
endif;
end process;

-----------------------------
---- s read process ---------
-----------------------------
S_Reader: Process(CLK)
if (CLK = 1 AND CLK'event) then
if S_NotActive /= S_Active then
S_Read <=S;
S_NotActive <= S_Active then
endif;
endif;
end process;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top