From c6ee080fc68079392e9e66961bd11ebf52ab852d Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Fri, 10 May 2024 19:08:32 +0200 Subject: add top_count solutions --- src/cnt1sec.vhd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cnt1sec.vhd') diff --git a/src/cnt1sec.vhd b/src/cnt1sec.vhd index a722ff9..14fad68 100644 --- a/src/cnt1sec.vhd +++ b/src/cnt1sec.vhd @@ -10,7 +10,11 @@ entity cnt1sec is end entity; architecture rtl of cnt1sec is + signal cnt, ncnt : unsigned(25 downto 0); begin - + cnt <= (others => '0') when rst_n = '0' else ncnt when rising_edge(clk); + ncnt <= to_unsigned(0,cnt'length) when cnt = 4 else + cnt + 1; + en_o <= '1' when cnt = 0 else '0'; end architecture rtl; -- cgit v1.2.3