虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎rnls泰vuew克ogio新hmch闻w网jkihs版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎osh泰my克pazbr新btpn闻vncl网vkv版权所有,请勿未授权转载!!!

entity f_adder2 is

虎sy泰sf克fxkt新ugnt闻bzdaz网rvsnt版权所有,请勿未授权转载!!!

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

虎ug泰g克_gue新nevx闻fas网frwv版权所有,请勿未授权转载!!!

end entity f_adder2;

虎j泰k克dkm新vxgta闻nnw网cpb版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎n泰zpse克kvf新sd闻rm网zbl版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎qise泰yw克n新o闻rtg网juj版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎dm泰nl克mjv新eq闻xlu网w版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎s泰agh克corl新zlmo闻yby网eu_版权所有,请勿未授权转载!!!

case (s) is

虎hfft泰d克zvmlo新cjwkx闻pxvs网mzao版权所有,请勿未授权转载!!!

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

虎bd泰hx克sq新rn闻wy网pm版权所有,请勿未授权转载!!!

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

虎ex泰kzgc克nmv新hxzz闻qvs网td版权所有,请勿未授权转载!!!

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

虎avzt泰ut克msva新tkneo闻p网pgp版权所有,请勿未授权转载!!!

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

虎d泰wkiwe克c新mp闻xl_网lmm版权所有,请勿未授权转载!!!

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

虎zhm泰y克m新g闻qna网ol版权所有,请勿未授权转载!!!

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

虎qh泰dw克x新sw闻ard网je版权所有,请勿未授权转载!!!

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

虎znqy泰hru克avzuc新lg闻kmilc网xue版权所有,请勿未授权转载!!!

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

虎ih泰xoluc克jq_新daxxk闻kx网xjfo版权所有,请勿未授权转载!!!

when others =>NULL;

虎itnn泰tg克yek_新dwci闻cgljw网a版权所有,请勿未授权转载!!!

end case;

虎hwil泰yiuj克igyvn新p闻z网mr版权所有,请勿未授权转载!!!

end process;

虎q泰o克brado新rvnxm闻nel网gosbi版权所有,请勿未授权转载!!!

end architecture;

虎_b泰wyl克sws新cmxvn闻pgmy网xngxq版权所有,请勿未授权转载!!!

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

虎hidm泰_克awjc新m闻dtnwe网vtkg版权所有,请勿未授权转载!!!




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