当前位置:网站首页>1.5 - 逻辑运算
1.5 - 逻辑运算
2022-06-30 06:12:00 【是李黏黏鸭】
一、逻辑运算

- 或:一个为真则为真;
- 与:一个为假则为假;
- 异或:都为真则为假,都为假也是假;一真一假则为真;
- 同或:都为真则为真,都为假则为真;一真一假则为假;
- 非:本身是真即是假;本身是假则为真;
二、辅助理解

- 0表示假,1表示真;
注意:每种逻辑运算都有很多种表示符号,分别适用于不用的环境;例如||适用在代码中,其他的有的可以用在代数运算中;
三:考点:逻辑运算的

- 由题可知,00、11是数值符号的有效表现形式;也就是当两个数值的符号位都是00,或都是11时,他们的逻辑运算结果为真(0);
- 01、10是数值符号的无效表现形式;也就是当两个数值的符号位都是01,或者都是10时,他们的逻辑运算结果为假(1);
- 所以由此推断,需要进行 异或 逻辑运算,才能满足题中要求的两个符号相同的数相加,运算结果产生溢出,也就是假(1);
注意:
在做逻辑运算的题时,遇到不正常的情况,如上题中的溢出,那么他的结果就是假,也就是1;
边栏推荐
- Verilog中case,casez,casex语句的用法
- Ten years' miscellaneous thoughts
- Develop stylelint rules from zero (plug-ins)
- Inner member of class 5: inner class
- Mariadb数据库的安装与初始化
- Problems related to pinduoduo store search, why can't new products be found on the shelves
- How to use unmarshaljson
- New project folder based on PIO plug-in in vscode -- Interpretation
- 1.9 - Cache
- Wechat applet mall project
猜你喜欢
随机推荐
Unclear about glide loading picture
Share problems solved
Base64 explanation: playing with pictures Base64 encoding
Variable parameters of go
Switch must be better than if Else fast
Ten years' miscellaneous thoughts
Why does the verification code not refresh when clicked
1.6 - CPU组成
Ini parsing learning documents
Gazebo installation, uninstall and upgrade
MySQL advanced SQL statement
Control method of UAV formation
DOM (document object model) document XML file object model
Detailed description of methods in the interface
Rhcsa day 3
[regular expression series] greedy and non greedy patterns
我做功能测试这么多年的心得
MySQL index
Rotate dimension tool rolabelimg
[wechat applet: single or multiple styles, background color, rounded corners]









