虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎w泰sda克ow_新peoy闻n网cx版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎sodk泰xzwik克_guij新uhd闻irk网y_j版权所有,请勿未授权转载!!!

entity f_adder2 is

虎shl泰o克rlvb新qdy闻xrn网alw_k版权所有,请勿未授权转载!!!

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

虎q泰g克cnfj新n闻pldwl网lrdr版权所有,请勿未授权转载!!!

end entity f_adder2;

虎k泰raysz克lq新cy闻o网rj版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎ubwp泰eac克j新fjei闻mq网phb版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎szzv泰x克l新l闻tzvo网zvyi版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎vd泰r克is新fie闻ydmf网e版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎u_uc泰d_af克kscz新lbo闻j网ayrj版权所有,请勿未授权转载!!!

case (s) is

虎vh泰fhcpm克xhf新ssrp闻wqe网lnvcv版权所有,请勿未授权转载!!!

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

虎kn_b泰hcnt克eubc新xvcc闻ga网lixe版权所有,请勿未授权转载!!!

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

虎k泰du克z新c闻lffkt网evzib版权所有,请勿未授权转载!!!

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

虎zakyp泰xbadc克fswdo新d闻tirok网ubwkg版权所有,请勿未授权转载!!!

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

虎dua泰le克aqr新st闻rksp网acu版权所有,请勿未授权转载!!!

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

虎iemh泰oc克kvq新d闻jz网e版权所有,请勿未授权转载!!!

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

虎zvdqh泰sp克hy新scf闻dvu网bboxs版权所有,请勿未授权转载!!!

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

虎s泰lmb克snikw新b_闻a网h版权所有,请勿未授权转载!!!

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

虎_pm_泰josx克kc新je闻sh网cstl版权所有,请勿未授权转载!!!

when others =>NULL;

虎fqg泰t克hcfbk新k闻mewi网hxjrk版权所有,请勿未授权转载!!!

end case;

虎bnxp泰r克et_新n闻oh网onkw_版权所有,请勿未授权转载!!!

end process;

虎lwqzi泰ecvgb克cr新lrn闻idiw网_版权所有,请勿未授权转载!!!

end architecture;

虎sn泰tbu_克elx新bfljv闻oxkoy网pcgy版权所有,请勿未授权转载!!!

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

虎_dlyh泰xk克rjc新vvp闻b_网swfd版权所有,请勿未授权转载!!!




ถ้าคุณมีข้อมูลอื่นๆใดๆเกี่ยวกับเรื่องนี้กรุณาเพิ่มฟรี

เข้าสู่ระบบเพื่อแสดงความคิดเห็น

แสดงความคิดเห็น

    ไม่มีข้อมูล