我想单独设置 std_logic_vector 的位,以便轻松设置单个位或位组的注释。这是我所拥有的:
signal DataOut : std_logic_vector(7 downto 0);
...
DataOut <= ( 5=>'1', -- Instruction defined
4=>'1', -- Data length control bit, high=8bit bus mode selected
3=>'1', -- Display Line Number ctrl bit, high & N3 option pin to VDD=3 lines display
2=>'0', -- Double height font type control byte, not selected
1 downto 0=>"01", -- Select Instruction table1
others=>'0' -- for bits 6,7
);
但是,我对“downto”语句有疑问,使用 Xilinx ISE 时出现以下错误:
Type std_ulogic does not match with a string litteral
任何避免使用等效解决方案
1=>'0',
0=>'1',
并允许我按块设置位?
分配X downto Y => 'A'
当 A 是数组元素时正确。例如,以下代码片段是正确的:
1 downto 0 => '1',
这段代码是错误的:
1 downto 0 => "01",
因此,您的分配是非法的。作为您的代码,您可以指定为:
DataOut <= ( 5 downto 3 =>'1',
2 downto 1 =>'0',
0 => '1',
others=>'0'
);
如果你想通过数组的某个字段来访问/分配,你可以使用串联:
DataOut <= Something_0 & Something_1 & "01";
While Something_*
is std_logic_vector
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)