虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎_la泰mgjhx克elcou新qlwni闻ooq网t版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎_su泰qtvc克q_新nhvjj闻mr网a版权所有,请勿未授权转载!!!

entity f_adder2 is

虎so_a泰rjfo克ul新izgo闻vyhpc网yyfu版权所有,请勿未授权转载!!!

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

虎ivx泰laux克noh新ioe闻qz网yby版权所有,请勿未授权转载!!!

end entity f_adder2;

虎_ifu泰_克jpg新m闻gtc网xkira版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎uo泰thfx克io新xh闻naec网uxgo版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎afwep泰htslj克pofq新kdiui闻tvg网k版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎vmt泰eg克nu新fqtck闻jbusv网kwye版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎mpmo泰oyjp克sh_新o闻p网hzccj版权所有,请勿未授权转载!!!

case (s) is

虎_i泰cjvrz克qy新m闻euv网a版权所有,请勿未授权转载!!!

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

虎tfo泰zqawq克hxfhb新imh闻hos网ifxe版权所有,请勿未授权转载!!!

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

虎rb泰kvmj克lb新djk闻t网lw版权所有,请勿未授权转载!!!

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

虎zme泰acazu克h新ztzcl闻mb网ngc版权所有,请勿未授权转载!!!

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

虎gpv泰j克lfqgh新pwjwc闻hxy网x版权所有,请勿未授权转载!!!

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

虎vxa泰wlya克jeqg新rcol闻_j网m版权所有,请勿未授权转载!!!

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

虎nacig泰iur克c新gdz闻rxza网d版权所有,请勿未授权转载!!!

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

虎xsvn泰di克rsrm新je闻njl网zgi版权所有,请勿未授权转载!!!

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

虎bbzwx泰odo克whk新km闻wr网f版权所有,请勿未授权转载!!!

when others =>NULL;

虎tf泰rsbvf克ch新te闻gs网jwtfz版权所有,请勿未授权转载!!!

end case;

虎ek_yp泰f_dcg克ix新k闻ryty网mg版权所有,请勿未授权转载!!!

end process;

虎ar泰_tpiw克xnlfg新pia闻gito网qv版权所有,请勿未授权转载!!!

end architecture;

虎ybsmb泰pjors克wd新turqc闻fj网i_版权所有,请勿未授权转载!!!

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

虎s泰xmiu克qy_z新go闻pyneo网pbsop版权所有,请勿未授权转载!!!




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