working buttons and DIN to control display
This commit is contained in:
@@ -37,6 +37,8 @@ entity counter is
|
||||
Port ( CLK : in STD_LOGIC;
|
||||
RST : in STD_LOGIC;
|
||||
CE : in STD_LOGIC;
|
||||
PE : in STD_LOGIC;
|
||||
DIN : in STD_LOGIC_VECTOR(3 downto 0);
|
||||
TC : out STD_LOGIC;
|
||||
COUNT_OUT : out STD_LOGIC_VECTOR (3 downto 0));
|
||||
end counter;
|
||||
@@ -53,6 +55,9 @@ begin
|
||||
if RST = '1' then
|
||||
s_cnt <= "0000";
|
||||
TC <= '0'; -- Reset TC
|
||||
elsif PE = '1' then
|
||||
s_cnt <= DIN;
|
||||
TC <= '0';
|
||||
elsif CE = '1' then
|
||||
if s_cnt = MAX_LIMIT then
|
||||
s_cnt <= "0000"; -- Reset to 0 when limit is hit
|
||||
|
||||
Reference in New Issue
Block a user