虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎psdy泰m_wkg克ds新dccp闻xaw网eyik版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎xvru泰ex克nu新anrqo闻mvwxi网xhojf版权所有,请勿未授权转载!!!

entity f_adder2 is

虎vzzxw泰bn克xtz新t闻kqc网ik版权所有,请勿未授权转载!!!

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

虎ys泰hm克ww新f闻gtx网dc版权所有,请勿未授权转载!!!

end entity f_adder2;

虎j泰zsq克u新uf闻uw网vyk版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎ae泰aa克zai新rr闻h网fjnku版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎_r泰ku_o克_新ufhv闻_网kj版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎iylbg泰d克tbhb_新eg闻wayn网zyjj版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎dwjyc泰efd克h新xddc闻hvlp网e版权所有,请勿未授权转载!!!

case (s) is

虎v泰me克anj新t闻oak网j版权所有,请勿未授权转载!!!

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

虎wcl泰vo克my新xcff闻n网yqnur版权所有,请勿未授权转载!!!

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

虎eq泰sjhhv克b新sgai闻oke网msr版权所有,请勿未授权转载!!!

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

虎tc_jp泰ylqdo克ntmr新aiayr闻rwe网f版权所有,请勿未授权转载!!!

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

虎c泰csi克olqgl新nx闻bzfl网n版权所有,请勿未授权转载!!!

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

虎s泰eyv克flc新v闻yeeys网w_版权所有,请勿未授权转载!!!

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

虎_cak泰z克dycej新awc闻mdqy网q版权所有,请勿未授权转载!!!

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

虎bgx泰qewb克_hkwd新zdkq闻oq网sayy版权所有,请勿未授权转载!!!

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

虎asov泰qxk克c新kf闻ygnmp网stdht版权所有,请勿未授权转载!!!

when others =>NULL;

虎f泰qfmo克hplsk新o闻x_mp网_fb版权所有,请勿未授权转载!!!

end case;

虎ubdx泰gdju克uvz新wwvk闻t网qbmd版权所有,请勿未授权转载!!!

end process;

虎xrpbf泰_fii克qt新bzn闻bv网g版权所有,请勿未授权转载!!!

end architecture;

虎uc__泰_克zlg新wgna闻tjerm网j版权所有,请勿未授权转载!!!

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

虎lbmzh泰h克yc新c闻s网z版权所有,请勿未授权转载!!!




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