完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
if a(i-1)='1' xor b(i-1)='1' xor c1='1' then s1(i-1):='1';else s1(i-1):='0';
这句话是什么意思呢 a(i-)=‘1’,又是什么意思啊 是加法器里面完整程序在下面。多谢大牛们解答 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity dajiafaqi is generic( s:integer:=8); port(a,b:in std_logic_vector(s-1 downto 0); cin:in std_logic; sum: out std_logic_vector(s-1 downto 0); cout:out std_logic); end entity dajiafaqi; architecture bhv of dajiafaqi is begin process(a,b,cin) variable s1:std_logic_vector(s-1 downto 0); variable c1:std_logic;--_vector(s downto 0); begin c1:=cin; --c1(0):=cin; for i in 1 to s loop if a(i-1)='1' xor b(i-1)='1' xor c1='1' then s1(i-1):='1';else s1(i-1):='0'; end if; if(a(i-1)='1' and b(i-1)='1')or (a(i-1)='1' and c1='1') or (b(i-1)='1' and c1='1') or (a(i-1)='1' and b(i-1)='1' and c1='1') then c1:='1'; else c1:='0'; end if; end loop; sum<=s1;cout<=c1; end process; end architecture bhv; |
|
相关推荐
2个回答
|
|
|
就是判断a的某一位是不是1啊
|
|
|
|
|
|
两个数a,b对应位和进位信号异或是在计算偶校验,如果值为1则说明三个加数中有奇数个1,则和为1,否则有偶数个1,和为0
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
NVMe高速传输之摆脱XDMA设计51:主要功能测试结果与分析3 nvmePCIe高速存储 PCIe高速存储
230 浏览 0 评论
NVMe高速传输之摆脱XDMA设计50:主要功能测试结果与分析2 nvmePCIe高速存储
378 浏览 0 评论
NVMe高速传输之摆脱XDMA设计49:主要功能测试结果与分析1
1509 浏览 0 评论
935 浏览 0 评论
876 浏览 0 评论
4431 浏览 63 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 11:08 , Processed in 0.631046 second(s), Total 73, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5103