VHDL报错std_logic type does not match integer literal
随风飘扬 学习 2015年12月01日7:07 7375
VHDL报错std_logic type does not match integer literal
library ieee;
虎j泰folz克sfq新odlzo闻gfieb网c_srq版权所有,请勿未授权转载!!!
use ieee.std_logic_1164.all;
虎xws泰amtx克dn新e闻fzli网fu版权所有,请勿未授权转载!!!
entity f_adder2 is
虎bspnu泰t克p_c新rn闻h网qo版权所有,请勿未授权转载!!!
port(a,b,c : in std_logic; so,co : out std_logic);
虎_esc泰kxgs克r新uvf闻qa_网sr版权所有,请勿未授权转载!!!
end entity f_adder2;
虎fmvi泰bum克yx新bg闻jk网so版权所有,请勿未授权转载!!!
architecture bhv of f_adder2 is
虎cqky泰yqu克uu新u_f闻zzk网zmyrp版权所有,请勿未授权转载!!!
signal s : std_logic_vector(2 downto 0);
虎ayb泰yug克rehf新yznk闻v网j版权所有,请勿未授权转载!!!
begin s<=c&b&a;
虎xpu泰we克_tam新a闻a网gqxan版权所有,请勿未授权转载!!!
process(c,b,a) begin
虎acls泰lcexg克ere新bpe_闻omm网elim版权所有,请勿未授权转载!!!
case (s) is
虎p泰ts克yec新s闻yk网lakt版权所有,请勿未授权转载!!!
when "000" => so<=0;co<=0;
虎_p泰n克akda新hguv闻riaa网f版权所有,请勿未授权转载!!!
when "001" => so<=1;co<=0;
虎y泰wx克err新lfr闻ylpgv网ks版权所有,请勿未授权转载!!!
when "010" => so<=1;co<=0;
虎bj泰e克if新khwaz闻s网unxn版权所有,请勿未授权转载!!!
when "011" => so<=0;co<=1;
虎l泰q克paqht新lbldu闻lwxff网ewz版权所有,请勿未授权转载!!!
when "100" => so<=1;co<=0;
虎babip泰zk克k新x闻jhkmh网zirh版权所有,请勿未授权转载!!!
when "101" => so<=0;co<=1;
虎sh_q泰hup克a新pam闻utrt网sgq版权所有,请勿未授权转载!!!
when "110" => so<=0;co<=1;
虎do泰pewcv克t_iqe新svlrt闻onyzs网hk版权所有,请勿未授权转载!!!
when "111" => so<=1;co<=1;
虎ibn泰sf克a新lvr闻qq网wbq_版权所有,请勿未授权转载!!!
when others =>NULL;
虎u_rg泰kzl克o新qfmv_闻mqxsj网nv版权所有,请勿未授权转载!!!
end case;
虎tu泰hmkw克kdlt新ruq闻jciwi网zxykc版权所有,请勿未授权转载!!!
end process;
虎nbr泰r克y新okc闻e网pfxlk版权所有,请勿未授权转载!!!
end architecture;
虎u_qk泰m克xwshy新bdgdy闻b网qsmv版权所有,请勿未授权转载!!!
定义的s是std_logic类型,但你赋值的时候由于没加单引号,被认为是integer类型了,所以应加单引号
虎xcxy泰lirin克im新lvy闻ipfne网oj版权所有,请勿未授权转载!!!
Statement: all articles / drawings reproduced on this website are for the purpose of transmitting more information and facilitating discussion, which does not mean that the website, the host and the organizer agree with their opinions or confirm the authenticity of their contents. The contents of the articles are for reference only. If the rights of the original author are violated, please contact the website administrator.
Comment list
-
No data