From eb8643ddbef43547eb7bfe58789a3908926c7258 Mon Sep 17 00:00:00 2001 From: Vaino Kauppila Date: Sun, 19 Apr 2026 12:32:58 +0300 Subject: refactor dir structure, add fib.c --- PIC/stack.vhd | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 PIC/stack.vhd (limited to 'PIC/stack.vhd') diff --git a/PIC/stack.vhd b/PIC/stack.vhd deleted file mode 100644 index fd376c0..0000000 --- a/PIC/stack.vhd +++ /dev/null @@ -1,51 +0,0 @@ -library ieee; -use ieee.std_logic_1164.all; -use ieee.numeric_std.all; - -entity stack is - generic ( - DEPTH : positive := 8; - WIDTH : positive := 13 - ); - port ( - clk : in std_logic; - reset : in std_logic; - push : in std_logic; - pop : in std_logic; - din : in std_logic_vector(WIDTH - 1 downto 0); - dout : out std_logic_vector(WIDTH - 1 downto 0) - ); -end entity stack; - -architecture rtl of stack is - - type stack_t is - array (0 to DEPTH - 1) - of std_logic_vector(WIDTH - 1 downto 0); - - signal mem : stack_t - := (others => (others => '0')); - - -- write pointer - signal top : unsigned(2 downto 0) - := (others => '0'); -begin - - dout <= - mem(to_integer(top - 1)) when top /= 0 else (others => '0'); - - stck : process(clk, reset) - begin - if reset = '1' then - top <= (others => '0'); - elsif rising_edge(clk) then - if push = '1' then - mem(to_integer(top)) <= din; - top <= top + 1; - elsif pop = '1' then - top <= top - 1; - end if; - end if; - end process; - -end architecture rtl; -- cgit v1.3