Forum Discussion
Altera_Forum
Honored Contributor
8 years agoNeed help in code
Hello I'm currently working on my assignment in Spartan-3E.My assignment is: While button is clicked show values of switches in low 4 bit of LED,when button is released move from left to right.S...
Altera_Forum
Honored Contributor
8 years agoBest not mention Spartan on this Altera forum. However, I think we can overlook that...
You're code, whilst it could be improved, looks fundamentally there even if it doesn't employ best practice. I think it should do roughly what's been asked of you. So, a couple of questions back to you. What isn't it doing? Anything? Nothing? Have you constrained the I/O to the correct pins on the device? Are any of the input or output signals active low - e.g. does the button generate a logic LOW on the pin when it's pressed (rather than a logic HIGH as your code is expecting). Have you simulated any of this? You don't need the 'temp' variable. Anything unnecessary should be removed to keep any code clear, simple and uncluttered. Cheers, Alex