This ai describe :
library ieee;
use ieee.std_logic_1164.all;
entity ROM is
port ( address_A : in std_logic_vector(5 downto 0);
data_D : out std_logic_vector(5 downto 0)
CS,CS:in BIT ;
end entity ROM;
architecture behavioral of ROM is
type mem is array ( 63 to 0) of std_logic_vector(5 downto 0);
constant my_Rom : mem := (
0 => "000000",
1 => "000000",
2 => "000000",
3 => "000000",
4 => "000000",
5 => "000000",
6 => "000000",
7 => "000000",
8 => "000000",
9 => "000001", "(9in binar is 001001 and the number located is 1)
10 =>"000010",
....to 63......);
begin
process (address)
begin
if CS and OE = '1'then
case address is
when "0000" => data <= my_rom(0);
when "0001" => data <= my_rom(1);
when "0010" => data <= my_rom(2);
when "0011" => data <= my_rom(3);
when "0100" => data <= my_rom(4);
when "0101" => data <= my_rom(5);
when "0110" => data <= my_rom(6);
when "0111" => data <= my_rom(7);
when "1000" => data <= my_rom(8);
when "1001" => data <= my_rom(9);
when "1010" => data <= my_rom(10);
.....to 63....
when others => data <= "00000000";
end case;
else
data <= 'Z';
end process;
end architecture behavioral;
How can I create a function for "my_rom"(used by me in program)?
Thank for all answer!!!
---------- Post added at 23:19 ---------- Previous post was at 23:17 ----------
I need a concrete function......
Thanks!
---------- Post added at 23:46 ---------- Previous post was at 23:19 ----------
Please help me make this program better based on this model.
Thanks!