?? 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;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -