VHDL报错std_logic type does not match integer literal
随风飘扬 学习 2015年12月01日7:07 6796
VHDL报错std_logic type does not match integer literal
library ieee;
虎mnzg泰uqhbu克ownh新c闻dqiu网pwrcn版权所有,请勿未授权转载!!!
use ieee.std_logic_1164.all;
虎qnusl泰nh_w克m新cddj闻obn网prrmu版权所有,请勿未授权转载!!!
entity f_adder2 is
虎t泰xj克mx新gt闻mj网cv版权所有,请勿未授权转载!!!
port(a,b,c : in std_logic; so,co : out std_logic);
虎kynqu泰rasyj克gtl新bqwbx闻w网pfbps版权所有,请勿未授权转载!!!
end entity f_adder2;
虎cr_p泰wrl克decgi新n闻t_is网val版权所有,请勿未授权转载!!!
architecture bhv of f_adder2 is
虎vcz泰cazqh克tlo_u新po闻pzof网capj版权所有,请勿未授权转载!!!
signal s : std_logic_vector(2 downto 0);
虎ephn泰y克_jgz新k_闻t网s版权所有,请勿未授权转载!!!
begin s<=c&b&a;
虎orjya泰qjb克_xk新imjo闻p网_ecu版权所有,请勿未授权转载!!!
process(c,b,a) begin
虎_qlha泰vi克d新f_ap闻j网jjkv版权所有,请勿未授权转载!!!
case (s) is
虎kmo泰xwwg克vzn新oe闻ti网xmm版权所有,请勿未授权转载!!!
when "000" => so<=0;co<=0;
虎o泰d克tqv新mz闻jae网nig版权所有,请勿未授权转载!!!
when "001" => so<=1;co<=0;
虎zwwq泰hzy克zcfk新c_闻rcxv网ex版权所有,请勿未授权转载!!!
when "010" => so<=1;co<=0;
虎jgf泰vj克b新hn_jl闻ywjim网tnt版权所有,请勿未授权转载!!!
when "011" => so<=0;co<=1;
虎c泰rret克szgs新bsjr闻myz网itchy版权所有,请勿未授权转载!!!
when "100" => so<=1;co<=0;
虎pzfmg泰lgxtc克cdrj新fj闻_nff网h版权所有,请勿未授权转载!!!
when "101" => so<=0;co<=1;
虎co泰lpg_s克dssn新xx_闻dm网h版权所有,请勿未授权转载!!!
when "110" => so<=0;co<=1;
虎_ns_泰uk克ybeo新mb闻glpi网utxaz版权所有,请勿未授权转载!!!
when "111" => so<=1;co<=1;
虎lsos泰hvyj克ydfnd新cjm闻hhktg网lxodr版权所有,请勿未授权转载!!!
when others =>NULL;
虎a泰t克m新z闻ciewz网krdl版权所有,请勿未授权转载!!!
end case;
虎bvm泰pno克hkw新si闻y网vu版权所有,请勿未授权转载!!!
end process;
虎cxfa泰vjeyc克az新t闻vbec网ilqq版权所有,请勿未授权转载!!!
end architecture;
虎fm泰i克ax新rts闻w网ojrsu版权所有,请勿未授权转载!!!
定义的s是std_logic类型,但你赋值的时候由于没加单引号,被认为是integer类型了,所以应加单引号
虎xjji泰atbce克kpvvw新nraxr闻h网pc版权所有,请勿未授权转载!!!
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