虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎xpk泰rab克fikdr新aubl闻c_ujn网ro版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎macoz泰e克iy新b闻egbl网mlgr版权所有,请勿未授权转载!!!

entity f_adder2 is

虎jkd泰nt克p新jkn闻fv网tcdbg版权所有,请勿未授权转载!!!

port(a,b,c : in std_logic; so,co : out std_logic);

虎xv_泰thiai克hprsm新pwg闻j网hk版权所有,请勿未授权转载!!!

end entity f_adder2;

虎ifxb泰xhooa克ht新n闻_t网iulo版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎iii泰gpx克o新cw闻avvq网s__e版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎g泰mycz克vss新xtlta闻tfhia网ctmaq版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎qd泰w克slu新b闻ozyh网_ndkv版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎rfao_泰h克sbceq新sh闻nfj网r版权所有,请勿未授权转载!!!

case (s) is

虎h泰lczym克fnrgq新g闻fwht网fhuvn版权所有,请勿未授权转载!!!

when "000" => so<=0;co<=0;

虎qm泰mz_dm克rqm新l闻cf网zf_f版权所有,请勿未授权转载!!!

when "001" => so<=1;co<=0;

虎km泰cmw克tqqcy新rkdzr闻lkycy网_版权所有,请勿未授权转载!!!

when "010" => so<=1;co<=0;

虎u泰zrpyl克qwmu新mr闻bszu网agywj版权所有,请勿未授权转载!!!

when "011" => so<=0;co<=1;

虎h泰r克dpk新wxlpu闻hoyra网thp版权所有,请勿未授权转载!!!

when "100" => so<=1;co<=0;

虎jvc泰kjm克c新yenm闻hs网pr版权所有,请勿未授权转载!!!

when "101" => so<=0;co<=1;

虎ftp_u泰ldyic克zuve新kovik闻tt网wnu版权所有,请勿未授权转载!!!

when "110" => so<=0;co<=1;

虎qzlca泰qdht克d_新zn闻jl网y版权所有,请勿未授权转载!!!

when "111" => so<=1;co<=1;

虎b泰repz_克elo新xjcl闻cahm网yjdxy版权所有,请勿未授权转载!!!

when others =>NULL;

虎ian泰lvq克bccu新bwa_闻ae网rpjg版权所有,请勿未授权转载!!!

end case;

虎ifyi泰f克w_nw新x闻mnhm网z_q版权所有,请勿未授权转载!!!

end process;

虎_woyu泰hq克idib新mjer闻mhvke网ga版权所有,请勿未授权转载!!!

end architecture;

虎ywwog泰kyu克oie新omawu闻hiwxg网ofr版权所有,请勿未授权转载!!!

定义的s是std_logic类型,但你赋值的时候由于没加单引号,被认为是integer类型了,所以应加单引号

虎qyb泰wdm克azns新mz闻cnkej网xh版权所有,请勿未授权转载!!!




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.

Sign in to comment

Comment list

    No data