我怎样才能使用;用select";用vhdl?
你好:)我仍然不懂vhdl,并试图用select实现以下内容,但在实现FBGA时,我得到了错误的逻辑。我不知道我缺少了什么,但不知怎的,这很棘手,如果有人能告诉我我在哪里遗漏了要点,那将是非常好的 我想实现的是 o0=((非i3)和i1和i0)或((非i3)和(非i2)和i1)或(i0和(非i2))或(i3和(非i0)) o1=((非i0)和i3)或((非i3)和(非i2)和i1)或(i0和i2以及i3和i1) o2=(i0和i2以及i3和i1)或((非i3)和(非i1))或(i3和(非i1)) o3=((i3)和(不是i0))或((不是i3)和(不是i2)和i1)或((不是i3)和i0和i1) 我想重建一个舞会。。。我的vhdl代码是:我怎样才能使用;用select";用vhdl?,vhdl,Vhdl,你好:)我仍然不懂vhdl,并试图用select实现以下内容,但在实现FBGA时,我得到了错误的逻辑。我不知道我缺少了什么,但不知怎的,这很棘手,如果有人能告诉我我在哪里遗漏了要点,那将是非常好的 我想实现的是 o0=((非i3)和i1和i0)或((非i3)和(非i2)和i1)或(i0和(非i2))或(i3和(非i0)) o1=((非i0)和i3)或((非i3)和(非i2)和i1)或(i0和i2以及i3和i1) o2=(i0和i2以及i3和i1)或((非i3)和(非i1))或(i3和(非i1))
library ieee;
use ieee.std_logic_1164.all;
entity with_select is
port(i3,i2,i1,i0 : in std_logic;
o0,o1,o2,o3:out std_logic
);
end with_select;
architecture behave of with_select is
signal s_out : std_logic_vector(3 downto 0);
begin
with i0 select
o0<=((not i3) and i1 and i0) or ((not i3) and (not i2) and i1) or (i0 and (not i2)) or (i3 and (not i0)) when '1',
'0' when others;
with i1 select
o1<=((not i0) and i3) or ((not i3) and (not i2) and i1) or (i0 and i2 and i3 and i1) when '1',
'0' when others;
with i2 select
o2<=(i0 and i2 and i3 and i1) or ((not i3) and (not i1)) or (i3 and (not i1)) when '1',
'0' when others;
with i3 select
o3<=((i3) and (not i0)) or ((not i3) and (not i2) and i1) or ((not i3) and i0 and i1) when '1',
'0' when others;
end behave;
ieee库;
使用ieee.std_logic_1164.all;
带有_select的实体是
端口(i3、i2、i1、i0:std_逻辑中;
o0,o1,o2,o3:输出标准逻辑
);
以_选择结束;
带_select的架构行为是
信号s_输出:标准逻辑向量(3到0);
开始
使用i0选择
使用选定的信号分配语句时,布尔表达式的术语不正确。选择“1”要求分配给o0
例如要求i0
为“1”,这与以下术语相矛盾:
用i0选择
o0为什么不按照所写的那样简单地实现这些布尔表达式呢?例如,在o0
赋值中,有两个术语不要求i0
为“1”,但您需要在所选赋值语句中使用“1”选项,在所有四个术语中i0
为“1”。您不是在使用选定的信号分配忠实地实现VHDL代码之前显示的布尔表达式,而是应该按照Brian的建议,在不使用选定的信号分配的情况下直接实现它们。一元运算符not的优先级高于运算符and或or。在VHDL中,这里不需要括号来明确表示逻辑上颠倒的值。