在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜全文
查看: 1804|回复: 2

[求助] 4位加法器,求排错啊

[复制链接]
发表于 2015-4-11 14:24:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity adder4bit is
port(cin: in std_logic;
     a,b: in  std_logic_vector(3 downto 0);
       s: out std_logic_vector(3 downto 0);
    cout: out std_logic_vector(3 downto 0) );
end adder4bit;
architecture one of adder4bit is
   signal sint: std_logic_vector(3 downto 0);
   signal aa,bb: std_logic_vector(3 downto 0);
                begin
                         aa<='0' & a (3 downto 0);
                         bb<='0' & b(3 downto 0);
                         sint<= aa+bb+cin;
                         s(3 downto 0) <= sint (3 downto 0);
                         cout .std_logic_vector(3 downto 0)all.!=  sint(3 downto 0);
end one;
发表于 2015-4-11 18:38:27 | 显示全部楼层
位宽不对吧,‘0’&a(3 downto 0)共5位,aa才4位
回复 支持 反对

使用道具 举报

发表于 2015-4-12 11:32:36 | 显示全部楼层
最后一句的cout .std_logic_vector(3 downto 0)all.!=sint(3 downto 0)是什么意思?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-10-5 06:41 , Processed in 0.014476 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表