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 ago1.
You should used a reset signal to have a known initial state. In your code, the critical uninitialized signals are 'data' and 'tooluur', you use them with unknown values 2. You have 2 clocks for a very simple design. Best practice is to have the main clock and an enable signal for the 2Hz clock if clk'event and clk = '1' then if en_2G = '1' then -- pulse at clk frequency each 0.5s ... 3. If you want to make a more complex design with the signal button, you should debounce it.