简体   繁体   中英

(VHDL) I'm Receiving an Error When Trying to Output from an Array

I'm trying to output data inside an array to the 7-segment display on my DE1-SoC board.

Here are my variables:

display : out std_logic_vector (6 downto 0);

type bigDisplay is array (0 to 4, 0 to 6) of bit;

signal displayArray : bigDisplay;

Here is the code:

display <= displayArray (0, 6-0);

This is the error I receive:

Error (10381): VHDL Type Mismatch error at Final_Project.vhd(326): indexed name returns a value whose type does not match "std_logic_vector", the type of the target expression

So, I'm guessing I need to convert my bit array to output to the std_logic_vector? How should I do this?

Any particular reason for using bit ? You can just as easily create an array of std_logic_vector :

type bigDisplay is array(0 to 4) of std_logic_vector(6 downto 0);
signal displayArray : bigDisplay;

Then simply (after initializing displayArray with values, of course):

display <= displayArray(0);

Etc, or whatever index you desire, in order to assign values from your array to the display.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM