虎泰克博客

VHDL报错std_logic type does not match integer literal


VHDL报错std_logic type does not match integer literal

library ieee;

虎ib泰vfx克eszpy新thq闻nw网i_key版权所有,请勿未授权转载!!!

use ieee.std_logic_1164.all;

虎azt泰pk克glig_新m闻tc网xcefm版权所有,请勿未授权转载!!!

entity f_adder2 is

虎geu泰udtuo克p新ia闻qrfjw网rqn版权所有,请勿未授权转载!!!

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

虎mxsbv泰h克ykxp新b闻d网kx版权所有,请勿未授权转载!!!

end entity f_adder2;

虎hcrno泰ovt克t_bgn新alujj闻s网l版权所有,请勿未授权转载!!!

architecture bhv of f_adder2 is

虎lc泰pdww克rsuu新s闻iy网owp版权所有,请勿未授权转载!!!

signal s : std_logic_vector(2 downto 0);

虎wbge泰ym克dfeti新wnyu闻rxe网dc_v版权所有,请勿未授权转载!!!

begin s<=c&b&a;

虎qtz泰fk克x新isdd闻gljn网wmppc版权所有,请勿未授权转载!!!

process(c,b,a) begin

虎bi泰di克bzh新re闻be网wo版权所有,请勿未授权转载!!!

case (s) is

虎kn泰ys克re新zgi闻j网vih版权所有,请勿未授权转载!!!

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

虎gt泰g克psd新ylou闻lr网uh版权所有,请勿未授权转载!!!

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

虎wyti泰n_l克bd新qx闻fq网xgt版权所有,请勿未授权转载!!!

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

虎qjgu泰vr克xca新vtjg闻cimqh网ccjj版权所有,请勿未授权转载!!!

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

虎j泰vo克cic新gojk闻b网emia版权所有,请勿未授权转载!!!

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

虎nx泰g_ekl克k新ccu闻jzbs网atk版权所有,请勿未授权转载!!!

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

虎wgr泰d克bij新tkwuf闻d网essv版权所有,请勿未授权转载!!!

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

虎uzno_泰uxbuc克xfgs新vuxcd闻psf网ud版权所有,请勿未授权转载!!!

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

虎ft泰obvs克blyy新bqq闻knw网iekh版权所有,请勿未授权转载!!!

when others =>NULL;

虎fzoe泰ctu克l新r闻qhw_网wgy版权所有,请勿未授权转载!!!

end case;

虎gnjr泰qv克kam新g闻vow网pvnm版权所有,请勿未授权转载!!!

end process;

虎b泰khe克rqi新d闻dobn网wxoed版权所有,请勿未授权转载!!!

end architecture;

虎snfm泰mktgf克sytb新qvob闻bmsy网_版权所有,请勿未授权转载!!!

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

虎p泰j克fl新rkjz闻vdjbi网ox版权所有,请勿未授权转载!!!




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