虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎kyrt泰vtug_克gtt新qfg闻mix网yxkuh版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎u泰e克y新xqr闻qgfcr网ulq版权所有,请勿未授权转载!!!

entity f_adder2 is

虎o泰wivy克f新bvyra闻ux网bfkvn版权所有,请勿未授权转载!!!

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

虎gjfeo泰detz克vym新tq闻a网_ik版权所有,请勿未授权转载!!!

end entity f_adder2;

虎j泰amyos克x新tfznx闻g网d版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎wyc泰z克d新cn闻l网mr版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎poniu泰qe克f新tw闻yudo网cesmf版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎jkh泰wzrjz克f_新ulwbk闻scvbm网x版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎rtmkd泰m克aftd新yixwf闻troq网oayk版权所有,请勿未授权转载!!!

case (s) is

虎nqtc泰i克f新f闻fk网j版权所有,请勿未授权转载!!!

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

虎ja泰uay克t新vfgye闻cgwlf网lc版权所有,请勿未授权转载!!!

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

虎zde泰ym克ca新fslhy闻zqh网y版权所有,请勿未授权转载!!!

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

虎mlfdh泰rnk克resr新c闻u网mt版权所有,请勿未授权转载!!!

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

虎ugn泰s_m克lk新yuhc闻acqxo网xwjji版权所有,请勿未授权转载!!!

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

虎gzo泰cm克b新nbey_闻y网bxgay版权所有,请勿未授权转载!!!

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

虎htf泰fvyph克i新czp闻leb网uoqs版权所有,请勿未授权转载!!!

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

虎tp泰hoxz克tsl新xefgm闻a网z版权所有,请勿未授权转载!!!

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

虎oi泰otih克t新ubl闻jgl网ply版权所有,请勿未授权转载!!!

when others =>NULL;

虎cqw泰h克lzwb新n闻tt_vc网x版权所有,请勿未授权转载!!!

end case;

虎scbej泰dmo克mj新qhlpf闻fcgl网zp版权所有,请勿未授权转载!!!

end process;

虎_泰fhu克py新dfxz闻ljaju网a版权所有,请勿未授权转载!!!

end architecture;

虎jr泰w_zk克irh新ihl_闻anqhg网vvrag版权所有,请勿未授权转载!!!

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

虎qiorh泰fxcuv克ou新nyr闻upz网arxv版权所有,请勿未授权转载!!!




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