Forum Discussion
Altera_Forum
Honored Contributor
13 years agoQuirk with my clocks
I'm building a Binary Game for my final project in Digital Logic and Design and a small portion of this game I'm building uses a countdown timer to show how much time you have left in your round. ...
Altera_Forum
Honored Contributor
13 years agoThis is the clock divider that I'm using the only difference between my 2 clock dividers is the "integer :=25000000" in one and "integer :=250000" in the other...what exactly do I need to change to have them lined up?
Thanks in advance for any help... LIBRARY ieee; USE ieee.std_logic_1164.all; ---------------------------------- ENTITY clk_div is generic(DIVISOR : integer := 25000000); port( clk: in std_logic; x: out std_logic ); END clk_div; ----------------------------------- ARCHITECTURE freq OF clk_div IS signal temp: std_logic := '0'; begin process(clk) variable counter: integer range 1 to DIVISOR; begin if(clk'event AND clk = '1') then if(counter = DIVISOR) then counter := 1; temp <= NOT temp; else counter := counter + 1; end if; end if; end process; x <= temp; END freq; -----------------------------------