working buttons and DIN to control display

This commit is contained in:
filipriec skolsky PC
2026-03-23 17:22:08 +01:00
parent 07f021abe6
commit 3e2b49671e
3 changed files with 30 additions and 8 deletions

View File

@@ -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