nikhilsigma
Full Member level 2
- Joined
- Jun 19, 2010
- Messages
- 142
- Helped
- 17
- Reputation
- 34
- Reaction score
- 16
- Trophy points
- 1,298
- Location
- Delhi, India
- Activity points
- 2,584
hi everyone....
i am having problem in reading the value of an 1D-1D array....
problematic lines are marked with comments in the following code....
please tell me why the above assignment is not working.......
Note : this type of assignment is also illustrated in pedroni [VHDL BOOK] in section 3.4
i am having problem in reading the value of an 1D-1D array....
problematic lines are marked with comments in the following code....
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity arrr is Port ( clk : in std_logic; data : out STD_LOGIC_VECTOR (15 downto 0)); end arrr; architecture Behavioral of arrr is type m1 is array (0 to 1) of std_logic_vector(15 downto 0); signal mem : m1; begin process(clk) variable q : integer:=0; variable r : std_logic_vector(15 downto 0); begin if (rising_edge(clk)) then if(q=0) then mem<=(others => (others => '0')); mem(0)<="1111111111001111"; mem(1)(15 downto 0)<=mem(0)(15 downto 0); -- THIS LINE IS NOT WORKING q:=1; r:=mem(0)(15 downto 0); -- THIS IS ALSO NOT WORKING else data<=mem(1); end if; end if; end process; end Behavioral;
please tell me why the above assignment is not working.......
Note : this type of assignment is also illustrated in pedroni [VHDL BOOK] in section 3.4