Mig*_*ork 2 fpga vhdl intel-fpga quartus
当我尝试这个时,我正面临着来自quartus的一些奇怪的错误.
这是代码(所有未签名和其他奇怪的函数都是我试图说服Quartus编译它.)
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
...
variable data : std_logic_vector(17 downto 0) := "000000000000000011";
...
-- 00000000111111000 original
-- 00000000000011111 shifted
-- 00000000000011000 result (AND)
data := std_logic_vector(unsigned(data) & shift_right(unsigned(data), 4));
-- 00000000011111000 original
-- 00000000111110000 shifted
-- 00000000111111000 result (OR)
data := std_logic_vector(unsigned(data) or shift_left(unsigned(data), 1));
Run Code Online (Sandbox Code Playgroud)
我遗漏了很多代码,但破碎的部分保持不变.
我越来越
错误(10344):snake_driver.vhd上的VHDL表达式错误(66):表达式有36个元素,但必须有18个元素
怎么做对了?
该&操作是不一样and的VHDL运营商.您正在寻找and操作员执行按位和操作.&是矢量的串联运算符,在两个18位向量之间使用它将产生一个36位向量(同样也是向量宽度不匹配),如错误消息所示.