虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎yne_泰wjuq克p新tjta闻xpk网vf版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎wec泰dnuf克lnh新b闻rcjm网bixeq版权所有,请勿未授权转载!!!

entity f_adder2 is

虎dunbx泰rg克bsev新rwhil闻tzwk网vxeh版权所有,请勿未授权转载!!!

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

虎zpgzh泰x_gk克y新pvccb闻l网mcsxb版权所有,请勿未授权转载!!!

end entity f_adder2;

虎vag泰cu克sy新rm闻v网mk版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎vgxc泰jv克hd新afoqb闻i网ki版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎ns泰bq克gc新vp闻eyn网hzko版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎wk泰zwh克jfc新si闻h_网np版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎nxop泰d克fll新hh闻oe网pde版权所有,请勿未授权转载!!!

case (s) is

虎ps泰hhdj克mywog新rcva闻rnkeo网a版权所有,请勿未授权转载!!!

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

虎tfauq泰x_克oqg新zo_闻a网x版权所有,请勿未授权转载!!!

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

虎f泰q克zp新yol闻ilmc网dzk版权所有,请勿未授权转载!!!

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

虎oxw泰bq克q新gq闻lfc网xkkn版权所有,请勿未授权转载!!!

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

虎rl泰kvud克cba新d闻ydofe网be版权所有,请勿未授权转载!!!

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

虎cbg泰jttw克trd新ql闻d网zqloy版权所有,请勿未授权转载!!!

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

虎a泰x克kyxsm新mcxv闻tx网qex版权所有,请勿未授权转载!!!

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

虎xo泰q克avlt新pho闻rrx网j版权所有,请勿未授权转载!!!

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

虎lkn泰wj克wdmj新x闻gwnza网e版权所有,请勿未授权转载!!!

when others =>NULL;

虎nlrxp泰zqjkp克a新ktbvq闻dz网ax版权所有,请勿未授权转载!!!

end case;

虎wyf泰yav克kqtam新b闻pot网k版权所有,请勿未授权转载!!!

end process;

虎kids泰t_ej克q新podk闻ndjp网uukur版权所有,请勿未授权转载!!!

end architecture;

虎ve泰djjh克r新hbnk闻d网nz版权所有,请勿未授权转载!!!

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

虎iy泰ox克tc新m闻hhzqc网pcn版权所有,请勿未授权转载!!!




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