Board logo

标题: 菜鸟问题:关于vhdl的一个小小程序, [打印本页]

作者: duoduober    时间: 2008-5-9 11:09     标题: 菜鸟问题:关于vhdl的一个小小程序,

library ieee;
use ieee.std_logic_1164.all;
entity two is
port(n:in std_logic_vector(3 downto 0);
fut std_logic
);
end two;
architecture two_arch of two is
begin
process(n)
begin
with n select
f<= '1' when "0001",
'0' when others;
end process;
end two_arch;

这样的小程序,报错1:Error (10500): VHDL syntax error at two.vhd(12) near text "with"; expecting "end", or "(", or an identifier ("with" is a reserved keyword), or a sequential statment

报错2:Error (10500): VHDL syntax error at two.vhd(13) near text "when"; expecting ";"

真是不明白啊,不放在process里就好好的,放进process就有这样的错,

请高手指点啊!!

谢谢


作者: cpld1234    时间: 2008-5-12 11:15

顺序语句需要放在进程里面,并行语句只能放在进程外面,with...select语句 属于并行赋值语句!!!






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0