rom.vhd

来自「design compile synthesis user guide」· VHDL 代码 · 共 29 行

VHD
29
字号
package ROMS is  -- declare a 5x8 ROM called ROM  constant ROM_WIDTH: INTEGER := 5;  subtype ROM_WORD is BIT_VECTOR (1 to ROM_WIDTH);  subtype ROM_RANGE is INTEGER range 0 to 7;  type ROM_TABLE is array (0 to 7) of ROM_WORD;  constant ROM: ROM_TABLE := ROM_TABLE'(      ROM_WORD'("10101"),              -- ROM contents      ROM_WORD'("10000"),      ROM_WORD'("11111"),      ROM_WORD'("11111"),      ROM_WORD'("10000"),      ROM_WORD'("10101"),      ROM_WORD'("11111"),      ROM_WORD'("11111"));end ROMS;use work.ROMS.all;   -- Entity that uses ROMentity ROM_5x8 is  port(ADDR: in ROM_RANGE;       DATA: out ROM_WORD);end;architecture BEHAVIOR of ROM_5x8 isbegin  DATA <= ROM(ADDR);      -- Read from the ROMend BEHAVIOR;

⌨️ 快捷键说明

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