Signal driven inside versus outside the process

Joined
May 10, 2011
Messages
1
Reaction score
0
Hello All,

I have a 'general interest' question about the following code..
This is not my code and I am trying to understand it, without running a sim.

P2S_Output: PROCESS (CLK,reset,FRAME)
BEGIN
IF (reset = '0' OR reset = 'L') THEN
Serial_Out <= (others => '0');
elsIF (CLK'EVENT AND CLK = '0') THEN
if (FRAME='1') then
Serial_Out <= p_in;
else
Serial_Out <= "0" & Serial_Out(63 downto 1);
end if;
end if;
DOUT <= Serial_Out(0);
END PROCESS P2S_Output;


1) Is it true that at the end of the process (delta time) DOUT would have 'old/previous' value of 'Serial_Out' ? I am saying this, as new value to Serial_Out will not be assigned, till the process ends.

2) Is this a 'good' way to code? Or is there a better to assign old value of Serial_Out to DOUT?

Thanks
 
Joined
Jan 29, 2009
Messages
152
Reaction score
0
I think it's fine (though one might say it may be "nicer" to use a variable to make it more explicit the old value is copied rather than the new one)

BTW it is unnecessary FRAME is listed in the sensitivity list. This may cause a little bit of extra (unnecessary) checking the signal by a simulator (it is not incorrect, but it may take some time doing those checks)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top