Commit a41ca98f authored by Oran Garrity's avatar Oran Garrity
Browse files

Lab #10 Game Synthesize

parent 82287d54
<internal_error>
<executable>quartus_map</executable>
<sub_system>MEM</sub_system>
<error>*** Fatal Error: Out of memory in module quartus_map (2147 megabytes used) while running 32-bit Quartus II on a 64-bit Operating System platform. Use the 64-bit Quartus II to increase memory capacity.</error>
<date>Tue May 18 12:42:14 2021</date>
<version>Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Web Edition</version>
</internal_error>
......@@ -3,13 +3,27 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity count1s is
GENERIC(
n : natural := 26;
m : natural := 50000000);
port ( clk : in std_ulogic;
rst_n : in std_ulogic;
onesec_o : out std_ulogic);
end entity;
architecture rtl of count1s is
SIGNAL next_state, current_state : unsigned(n-1 DOWNTO 0);
begin
next_state_logic : next_state <= to_unsigned(m-1, n) WHEN current_state = 0 ELSE
current_state - 1;
state_register : current_state <= to_unsigned(m-1, n) WHEN rst_n = '0' ELSE
next_state WHEN rising_edge(clk);
onesec_count : onesec_o <= '1' WHEN current_state = 0 ELSE '0';
end architecture rtl;
......@@ -79,6 +79,10 @@ begin
wait for 10*period;
key <= '1';
wait for 30*period;
key <= '0';
wait for 10*period;
key <= '1';
wait for 30*period;
clken_p <= false;
wait;
end process stimuli_p;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment