Forum Discussion
Altera_Forum
Honored Contributor
12 years agook. First problem. You cannot use both the rising and falling edges of the clock in an FPGA (it will work find in simulation, but is not possible on real hardware). For a double rate you need a 2x clock.
Next: your waveform doesnt show many signals, and doesnt show any of the variables. How can you debug it without seeing all the input values and all the signals/variables in the if statements? Finally: Why are you using variables at all? do you know the difference in behaviour between signals and variables? do you know what hardware they will map to? I suspect you're a software guy. There is almost never a need a use variables. So, I suggest taking a step back, and drawing (yes, with a pen and paper) the circuit you are trying to acheive. This is a description language. without knowing what you're describing, you have no chance of writing correct code.