Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library ieee;
- use ieee.std_logic_1164.all;
- use std.textio.all;
- use ieee.numeric_std.all;
- entity dvb_s2x_RAM is
- Port(
- clk : in std_logic;
- res : in std_logic;
- WE : in std_logic; -- Write enable
- address : in std_logic_vector(15 downto 0);
- in_data : in std_logic_vector(0 downto 0);
- out_data : out std_logic_vector(0 downto 0));
- end entity;
- architecture Behavioral of dvb_s2x_RAM is
- signal out_high : std_logic_vector(0 downto 0) := (others => '0');
- --signal read_en : std_logic := '1'; -- Output register enable
- type ram_type is array (64805 downto 0) of std_logic_vector(0 downto 0); -- 2D Array Declaration for RAM signal
- signal RAM_data : std_logic_vector(0 downto 0);
- signal RAM : ram_type := (others => (others => '0'));
- begin
- process(clk)
- begin
- if(rising_edge(clk)) then
- if(WE = '1') then
- RAM(to_integer(unsigned(address))) <= in_data;
- end if;
- RAM_data <= RAM(to_integer(unsigned(address)));
- end if;
- end process;
- process(clk)
- begin
- if(rising_edge(clk)) then
- if(res = '1') then
- out_high <= (others => '0');
- else
- out_high <= RAM_data;
- end if;
- end if;
- end process;
- out_data <= out_high;
- end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement