当前位置:网站首页>verilog 归约操作符
verilog 归约操作符
2022-06-29 08:21:00 【嗒曦】
一、归约操作符包括:
归约与(&),归约与非(~&),归约或(|),归约或非(~|),归约异或(^),归约同或(~^)。
二、归约操作符结果
归约操作符只有一个操作数,它对这个向量操作数逐位进行操作,最终产生一个 1bit 结果。
三、和其他不同
逻辑操作符、按位操作符和归约操作符都使用相同的符号表示,因此有时候容易混淆。区分这些操作符的关键是分清操作数的数目,和计算结果的规则。
1.逻辑操作符主要有 3 个:&&(逻辑与), ||(逻辑或),!(逻辑非)。
2.按位操作符有两个操作数,双目运算。
3.归约操作符只有一个操作数,单目运算。
四、归约操作符
归约与(&):全部是一
归约与非(~&):有一个零
归约或(|):有一个一
归约或非(~|):全部是零
归约异或(^):一的个数是奇数
归约同或(~^):一的个数是偶数
五、例子
A = 4'b1010 ; &A ; //结果为 1 & 0 & 1 & 0 = 1'b0,可用来判断变量A是否全1 ~|A ; //结果为 ~(1 | 0 | 1 | 0) = 1'b0, 可用来判断变量A是否为全0 ^A ; //结果为 1 ^ 0 ^ 1 ^ 0 = 1'b0
边栏推荐
- Simple use of vlookup function in Excel -- exact matching or approximate matching data
- 考研英语易混词整理【闪过】
- TypeScript 變量聲明 —— 類型斷言
- Huawei equipment is configured with small network WLAN basic services
- 背包九讲——全篇详细理解与代码实现
- 802.11--802.11n protocol phy
- Heavyweight released "FISCO bcos application landing guide"
- Dialogue | prospects and challenges of privacy computing in the digital age
- 闭关修炼(二十)如何做好单元测试
- Paddlenlp general information extraction model: UIE [information extraction {entity relationship extraction, Chinese word segmentation, accurate entity markers, emotion analysis, etc.}, text error cor
猜你喜欢

Differences between x86 and x64

抽象类、接口

2022第六季完美童模 合肥赛区 决赛圆满落幕

Déclaration de la variable Typescript - - assertion de type

Huawei equipment is configured with medium-sized network WLAN basic services

Some "non-technical" Thoughts on distributed digital identity

Typescript variable declaration - type assertion

Does the SQL server run with administrator privileges? Or run it as a normal user?

华为设备配置小型网络WLAN基本业务

Uber前安全主管面临欺诈指控 曾隐瞒数据泄露事件
随机推荐
2022第六季完美童模 合肥赛区 决赛圆满落幕
Official reply on issues related to the change of children's names after parents' divorce
P4769-[noi2018] bubble sort [combinatorics, tree array]
Open an account to buy funds. Is it safe to open an account through online funds-
js for in循环 for of循环的区别以及用法
华为设备配置小型网络WLAN基本业务
《乔布斯传》英文原著重点词汇笔记(八)【 chapter six 】
io流的总结
闭关修炼(二十二)session和cookie原理
hostname -f与uname -n的返回值可能不同
mongoDB 持久化
Huawei equipment is configured with small network WLAN basic services
cokkie和session的区别
sed 替换值为变量
各种级数(调和、几何)总结
开发小技巧-图片资源管理
Voice annotation automatic segment alignment tool sppas usage notes
ThreadLocal thread variable
二手交易平台碳减排,有了评估标准
C# 语音端点检测(VAD)实现过程分析