Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble using arrays

Status
Not open for further replies.

JPerez2

Programmer
Mar 30, 2003
1
0
0
US
I am trying to use an array of either std_logic_vectors or bit_vectors. However, I am getting an error message that I just can't figure out what it means. Here is my code:

ENTITY rom_array IS
PORT(array_out :OUT BIT_vector(7 downto 0);
clock :IN STD_LOGIC;
row,column :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
pointer_in :IN STRING);
END rom_array;

ARCHITECTURE structure OF rom_array is

BEGIN
PROCESS(clock)
type char_array is array (1 to 7) of bit_vector(7 downto 0);
constant letter_b:char_array:=
(x"7c",x"66",x"66",x"7c",x"66",x"66",x"7c");

BEGIN
IF pointer_in = "B" then
array_out<= letter_b(CONV_INTEGER(row));
end if;
end process;
END structure;

When I try to compile this I get the following error message: Unsupported feature error: aggregates are supported only for types that map to an array of bits.

Is this an issue with my compiler or is there an error in my code? I'm using Max+Plus II to compile this code. Does anyone know what the problem is? Thank you in advanced for any help.
-Jorge Perez
 
hi,
first include the library ieee and itz packages. then convert std_logic_vector into signed/unsigned before converting signed to integer, as conv_integer is used to convert a signed/unsigned number into integer. Lemme give u a piece of advice along with this. Please try to resolve these small syntactical errors u'r self so that it'll help u excel in vhdl.
check this link. seems good to u
------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

ENTITY rom_array IS
PORT(array_out :OUT BIT_vector(7 downto 0);
clock :IN STD_LOGIC;
row,column :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
pointer_in :IN STRING);
END rom_array;

ARCHITECTURE structure OF rom_array is

BEGIN
PROCESS(clock)
type char_array is array (1 to 7) of bit_vector(7 downto 0);
constant letter_b:char_array:=
(x&quot;7c&quot;,x&quot;66&quot;,x&quot;66&quot;,x&quot;7c&quot;,x&quot;66&quot;,x&quot;66&quot;,x&quot;7c&quot;);

BEGIN
IF pointer_in = &quot;B&quot; then
array_out<= letter_b(CONV_INTEGER(unsigned(row)));
end if;
end process;
END structure;
------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top