⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rom.vhd

📁 This sources implement a 8-bit FIR Filter with selectable coefficent rom.
💻 VHD
字号:
--------------------------------------------------------------------------------
-- Company: 
-- Engineer:
--
-- Create Date:    12:34:46 11/27/08
-- Design Name:    
-- Module Name:    ROM - Behavioral
-- Project Name:   
-- Target Device:  
-- Tool versions:  
-- Description:
--
-- Dependencies:
-- 
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
-- 
--------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity ROM is
	 Generic ( data_width: integer := 8;
				  address_width: integer := 4;
			     mem_depth: integer := 32);

    Port ( dir : in std_logic_vector(address_width-1 downto 0);
           dout : out std_logic_vector(data_width-1 downto 0);
			  clk : in std_logic);
end ROM;

architecture Behavioral of ROM is


type rom_typeis array (mem_depth-1 downto0) of STD_LOGIC_VECTOR (data_width-1 downto0);

constant rom: rom_type:=(  "10001010", "11110000", "10101010", "00001111", 
								  	"01010101", "00000000", "11111111", "11001100", 
								   "01010101"); 
begin

	rd: process(clk)
	begin
		if (rising_edge(clk)) then
			data_out<= rom(to_integer(unsigned(dir)));
		end if;
	end process;

end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -