Question about signals

Joined
Jul 8, 2008
Messages
23
Reaction score
0
Hi,
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.


process(clk)
begin
if rising_edge (clk)
ouput_signal <= input_signal_1 AND (NOT input_signal_2);
input_signal_1 <= input_signal_3 OR (NOT input_signal4);
end if;
end process;


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?)

OR

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.

Thanks
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
Rising_edge and signals gives F/F's

Hi

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
Capture_133.jpg

The source code
Capture_131.jpg

The blue line = Input_signal_1
Capture_132.jpg




Your welcome
Jeppe
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
Extra information - If you use variables can you "avoid" internale F/F's but beware of the order of statements

Capture_134.jpg


Capture_135.jpg
 
Joined
Jul 8, 2008
Messages
23
Reaction score
0
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.
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
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
Jeppe
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top