Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x y
- 1 14
- 2 45
- 3 67
- 4 32
- 5 12
- 6 64
- 7 89
- 8 34
- 9 54
- 10 22
- case address is
- when 1 => result <= 14;
- when 2 => result <= 45;
- when 3 => result <= 67;
- when 4 => result <= 32;
- when 5 => result <= 12;
- when 6 => result <= 64;
- ...
- when others => result <= 0; -- Default
- end case;
- Memory_Initialization_Radix=16;
- Memory_Initialization_Vector=
- 0E,2D,43,20,0C,40,59,22,36,16;
- entity cgrom is
- port (clkin : in std_logic;
- adr : in std_logic_vector(13 downto 0);
- data:out std_logic_vector(3 downto 0));
- end cgrom;
- architecture a_cgrom of cgrom is
- attribute INIT_00 :string;attribute INIT_01 :string;attribute INIT_02 :string;attribute INIT_03 :string;
- attribute INIT_04 :string;attribute INIT_05 :string;attribute INIT_06 :string;attribute INIT_07 :string;
- attribute INIT_00 of chargen0: label is "0000000000000000000000000000000000000000000000000000000000000000";
- attribute INIT_01 of chargen0: label is "00000000000000E000E00060000000200040006000E000E000E000E000E00000";
- attribute INIT_02 of chargen0: label is "00000000000000000000000000000000000000000000011C011C011C011C0000";
- attribute INIT_03 of chargen0: label is "0000000000000048007C005C00CC01D800B800B801B007FC0330017007700260";
- attribute INIT_04 of chargen0: label is "00000020002000DC03FC01080120035000F0005C0028030C01FC035800200000";
- attribute INIT_05 of chargen0: label is "00000000000001800600006002C0039C0384038C0398006A0076003600300000";
- attribute INIT_06 of chargen0: label is "00000000002002F803BA059E03CC03E60654007800700030001C00F800F80020";
- attribute INIT_07 of chargen0: label is "0000000000000000000000000000000000000000000000600060006000600000";
- subtype nybble is std_logic_vector(3 downto 0);
- subtype byte is std_logic_vector(7 downto 0);
- signal romClock : std_logic;
- signal romAddress : nybble;
- signal romResult : byte;
- myROM: process(romClock,romAddress) is
- begin
- if (rising_edge(romClock)) then
- case romAddress is
- when x"1" => romResult <= x"0E"; -- 14
- when x"2" => romResult <= x"2D"; -- 45
- when x"3" => romResult <= x"43"; -- 67
- when x"4" => romResult <= x"20"; -- 32
- when x"5" => romResult <= x"0C"; -- 12
- when x"6" => romResult <= x"40"; -- 64
- when others => romResult <= x"00"; -- 0
- end case;
- end if;
- end process myROM;
Add Comment
Please, Sign In to add comment