Forum Discussion
Altera_Forum
Honored Contributor
16 years agoLUT help!!!
I have wrote this code for implementing a neural network.What it does is to take some values(inputs) and some weights and computes the SUM(values*weigths).What i want to do is to check if the total s...
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- Not true. variables are created once (at elaboration time, not each time the process is triggered), and then updated over and over like anything else. Its all about where you place the variables in the code that makes the difference. for example (inside a clocked process): a := input output <= a; connects a wire between input and output. output is a register output<= a; a := input; puts a register between the input and the output. a and output are registers. If the variable didnt store the values between clocks (as you suggest) then the output would be unconnected all the time. if you do the same thing with signals: a <= input; output <= a; is exactly the same as: output <= a; a <= input; (they both place a register between input and output) This is why you have to be seriously careful with variables, because unlike signals, the procedural placement is very important. --- Quote End --- i added some bolded comments for clarity. i understand that you are trying to explain variables, but "connects a wire between input and output" seemed confusing and i wanted to clear things up.