Question about signals
I have a basic question that I canīt get my head around.
In the following process I have 1 signal which is mapped to an output and 4 inputs.
if rising_edge (clk)
ouput_signal <= input_signal_1 AND (NOT input_signal_2);
input_signal_1 <= input_signal_3 OR (NOT input_signal4);
My question is, When the clk edge arrives, does the process takes the values of each of the signals at that moment in time and do the calculations. In which case the changing of input_signal_1 would not affect the state of output_signal. (Is it tue to say that output_signal already has the result of the logic statement and that it will be latched on the clock edge?)
If for example input_signal_3 had changed since the last clock edge and lets say input_signal_1 then changed 3 ns later...could the changing of input_signal_1 have a negative effect when output_signal is being assigned. i.e. input_signal 1 could be in the process of changing, or could have already changed or may not have changed yet.
Maybe the process above is bad design practise? But I just want to have a better understanding of what would actually happen.
I hope I have explained it clearly enough. If not please let me know.
Rising_edge and signals gives F/F's
A quick answer
When ever you gives a signal a value inside a "if rising_edge(clk) then"
will you get a F/F.
The result of your circuit can be seen below - the XOR just a minor adjustment.
Use a variable for input_signal_1 if you would avoid the leftmost F/F
The source code
The blue line = Input_signal_1
Thanks for the replies Jeppe,
I understand what you say about the variables. It something I hadn't taken into account earlier.
But if I don't use a variable I am not clear on what will happen. Is the result dependent on propagation delays? Is the synthezised circuit unsafe/unstable?
Also is it rue that a signal should not appear on the left hand side and right hand side of different statements inside the same process? (I thin k I read something along those lines at one stage)
Thank you again so much for your help.
Well all circuts depends at propergation delays and hence must you choose the max clock frequency in order to avoid problems.
No - your circuit not unsafe or unstable. In fact will you be able to use a higher frequency this way.
But as you can watch at the first figure will there be used two F/F's instead of one. If you move the "input_signal_1 <= ..... " outside the process will you only ask for a single F/F.
No you migth use signals at both right and left side - specially if we are talking about clock-driven processes.
Hope this useful
|All times are GMT. The time now is 08:50 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.