aboutsummaryrefslogtreecommitdiff
path: root/src/ringcnt.vhd
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@hs-augsburg.de>2024-04-28 18:17:55 +0200
committerFriedrich Beckmann <friedrich.beckmann@hs-augsburg.de>2024-05-28 12:22:40 +0200
commit6b51b0420ed86e9ee8298d6b52781521de6e0476 (patch)
tree36cb902aa9c2863bb7d42946388cb4654a8e49e3 /src/ringcnt.vhd
parent70f4b9e97d88ade1dc262d930edd27ef97de58ae (diff)
add ringcnt to top_shift
Diffstat (limited to 'src/ringcnt.vhd')
-rw-r--r--src/ringcnt.vhd13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ringcnt.vhd b/src/ringcnt.vhd
index 5fc0d60..1c46679 100644
--- a/src/ringcnt.vhd
+++ b/src/ringcnt.vhd
@@ -1,11 +1,18 @@
library ieee;
use ieee.std_logic_1164.all;
-entity ringcnt is
+entity ringcnt is
+ port (
+ clk : in std_ulogic;
+ rst_n : in std_ulogic;
+ en_i : in std_ulogic;
+ y_o : out std_ulogic_vector(9 downto 0));
end entity;
architecture rtl of ringcnt is
+ signal rc, rcn : std_ulogic_vector(9 downto 0);
begin
-
+ rc <= "1000000000" when rst_n = '0' else rcn when rising_edge(clk);
+ rcn <= rc when en_i = '0' else rc(0) & rc(9 downto 1);
+ y_o <= rc;
end architecture rtl;
-