Prathibha R
Newbie level 4
- Joined
- Feb 26, 2014
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 46
Hello,
I'm trying to write code for 64*64 walsh code matrix using hadamard recursive algorithm.The code is below.I'm getting some syntax error in 2d matrix declaration.Please help me.The error what i am getting is Type integer is not an array type and cannot be indexed.
I'm trying to write code for 64*64 walsh code matrix using hadamard recursive algorithm.The code is below.I'm getting some syntax error in 2d matrix declaration.Please help me.The error what i am getting is Type integer is not an array type and cannot be indexed.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 use ieee.numeric_std.all; USE ieee.std_logic_arith.all; package test is subtype word is integer; type strng1 is array (0 to 63) of word; type strng2 is array (0 to 63) of strng1; end test; library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; USE ieee.std_logic_arith.all; use work.test.all; entity walsh is port(N,M:inout strng2); end walsh; architecture Behavioral of walsh is begin process constant A:integer:=64; variable z:integer:=1; variable m,n,x:integer; begin x:=(2**z); for i in 0 to x-1 loop for j in 0 to x-1 loop if((i=j) and (j=1)) then M(i)(j)<=1; else M(i)(j)<=0; end if; end loop; end loop; z:=z+1; x:=(2**z); while(x<=A) loop for i in 0 to x-1 loop for j in 0 to x-1 loop m:=i mod (2**(z-1)); n:=j mod (2**(z-1)); if((i>=(2**(z-1))) and (j>=(2**(z-1)))) then N(i)(j)<=not M(m)(n); else N(i)(j)<= M(m)(n); end if ; end loop; end loop; for i in 0 to x-1 loop for j in 0 to x-1 loop M(i)(j)<= N(i)(j); end loop; end loop; z:=z+1; x:=(2**z); end loop; end process; end Behavioral;
Last edited by a moderator: