簡體   English   中英

(VHDL)嘗試從陣列輸出時收到錯誤

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

我試圖將陣列內的數據輸出到DE1-SoC板上的7段顯示器。

這是我的變量:

display : out std_logic_vector (6 downto 0);

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

signal displayArray : bigDisplay;

這是代碼:

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

這是我收到的錯誤:

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

所以,我猜我需要將我的位數組轉換為輸出到std_logic_vector嗎? 我應該怎么做?

使用bit任何特殊原因? 您可以輕松地創建一個std_logic_vector數組:

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

然后簡單地(當然,在用值初始化displayArray之后):

display <= displayArray(0);

等等,或者您想要的任何索引,以便將數組中的值分配給顯示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM