虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎_泰t克r新ar闻ycf网qsh版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎ls泰_e_克zo新fbtnh闻to网mxec版权所有,请勿未授权转载!!!

entity f_adder2 is

虎n泰e克jfp新_j闻ggl网y版权所有,请勿未授权转载!!!

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

虎zrbz_泰ubli克qrs新mix闻iqg网za版权所有,请勿未授权转载!!!

end entity f_adder2;

虎y泰iy克kse新wkvq闻z网ry版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎uw泰cu克a新cjfvn闻hv网jpjt版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎xqwl泰hcvr克t新ow闻isfm网t版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎xb泰gplw克y_新_c闻glgl网eymq版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎gbc泰k_x克b新dgwg闻cxxo网yw版权所有,请勿未授权转载!!!

case (s) is

虎yv泰mk克i新ufcay闻eemc网tzufp版权所有,请勿未授权转载!!!

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

虎quthp泰jkl克bnn新n闻nnjlj网xfn版权所有,请勿未授权转载!!!

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

虎tl泰iquc克kepmp新f闻oh网kg版权所有,请勿未授权转载!!!

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

虎u泰s_ml克dnlme新gnoeh闻rv网sv版权所有,请勿未授权转载!!!

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

虎jqpzx泰epzz克ywyo新gqyc闻z网gk_版权所有,请勿未授权转载!!!

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

虎h泰z克mrbqn新sjxsc闻_oqbf网rsxj版权所有,请勿未授权转载!!!

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

虎xvfe泰j克_xajx新ldy闻t网_g版权所有,请勿未授权转载!!!

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

虎upbju泰z克jczp新jlbo闻rx网e版权所有,请勿未授权转载!!!

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

虎ln泰ytao克nh新ohgoe闻mu网dgds版权所有,请勿未授权转载!!!

when others =>NULL;

虎d泰ab克jb新dkh_u闻hj网c版权所有,请勿未授权转载!!!

end case;

虎qxkde泰_n克rnvdb新bw闻qiq_d网xf版权所有,请勿未授权转载!!!

end process;

虎g泰yni_克upo新yf闻igw网bwjf版权所有,请勿未授权转载!!!

end architecture;

虎qc泰kbks克gdqd新x_a闻jznee网gj版权所有,请勿未授权转载!!!

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

虎h泰u克wu新r闻mp网mk版权所有,请勿未授权转载!!!




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