uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

instrmem.vhd (1113B)


      1 library ieee;
      2 use ieee.std_logic_1164.all;
      3 use ieee.std_logic_unsigned.all;
      4 use ieee.numeric_std.all;
      5 
      6 entity instrmem is port (
      7 	addr:	in std_logic_vector(3 downto 0);
      8 	c:	out std_logic_vector(31 downto 0)
      9 );
     10 end instrmem;
     11 
     12 architecture dataflow of instrmem is
     13 
     14 type instr_arr is array(0 to 15) of std_logic_vector (31 downto 0);
     15 constant instr_mem: instr_arr := (
     16 	"00000000000000000000000000000000", -- 0
     17 	"00000000000000000000000000000000", -- 1
     18 	"00000000000000000000000000000000", -- 2
     19 	"00000000000000000000000000000000", -- 3
     20 	"00000000000000000000000000000000", -- 4
     21 	"00000000000000000000000000000000", -- 5
     22 	"00000000000000000000000000000000", -- 6
     23 	"00000000000000000000000000000000", -- 7
     24 	"00000000000000000000000000000000", -- 8
     25 	"00000000000000000000000000000000", -- 9
     26 	"00000000000000000000000000000000", -- 10
     27 	"00000000000000000000000000000000", -- 11
     28 	"00000000000000000000000000000000", -- 12
     29 	"00000000000000000000000000000000", -- 13
     30 	"00000000000000000000000000000000", -- 14
     31 	"00000000000000000000000000000000"  -- 15
     32 );
     33 
     34 begin
     35 	c <= instr_mem(to_integer(unsigned(addr)));
     36 end dataflow;