[英]I'm receiving Null on my output when trying to print a 2d array from reading a file
[英](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.