Forum Discussion
14 Replies
- Altera_Forum
Honored Contributor
Use Quartus -> Right click -> Insert template -> Full design -> Counter
- Altera_Forum
Honored Contributor
I didnt get what you are saying.
I have designed the counter but I want to work on the stop and start botton on the board to stop/start when i press stop/start without holding the button down. I will need quick reply from you and other members of this forum. - Altera_Forum
Honored Contributor
Add the following lines:
--pseudocode -- on the clock edge if start = '1' then -- or may be '0' depending on key logic start_L <= '1'; elsif stop = '1' then start_L <= '0'; end if; if start_L = '1' then count <= count + 1; end if; - Altera_Forum
Honored Contributor
Can you make ce input to be for both start/stop/pause or you separate start, stop and purse as different input logic?
I will appreciate your urgent reply - Altera_Forum
Honored Contributor
I assume CE is clkenable. You can apply it to all clocked registers at same time.
- Altera_Forum
Honored Contributor
can i separate the START AND PURSE with separate input i.e
Start: IN_STD_LOGIC PAUSE: IN_STD_LOGIC - Altera_Forum
Honored Contributor
you can start, stop, reset, freeze reverse,...etc at will by choosing a switch for each decision
- Altera_Forum
Honored Contributor
is not working out at. I want to the button start to be pressed once and it will purse. I have been able to do it that if i press it down, it will purse. Now I want a code for CLockenable that can stop the counter, like clear it without changing and if i press it again, it should be able to start.
Thanks. - Altera_Forum
Honored Contributor
is not working out . I want the button start to be pressed once and it will purse. I have been able to do it such that if i press it down, it will purse. Now I want a code for CLockenable that can stop the counter, like clear it and if i press it again, it should start.
thanks. - Altera_Forum
Honored Contributor
in that case it should not be called clock enable.
-- on clock edge if sw = '1' then toggle <= not toggle; end if; if toggle = '1' then count <= 0; else count up... you will need to manage the logic of various switches now with care otherwise they might get in conflict. This where simulations helps.