《计算机科学导论》课件Unit-4Data-Operations.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《《计算机科学导论》课件Unit-4Data-Operations.ppt》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机科学导论 计算机科学 导论 课件 Unit Data Operations
- 资源描述:
-
1、2345Logical Operations at bit level6Figure 4.1 Logical operationsLogical Operations at bit level7Logical Operations at bit levelXNOT X0110Table 4.1 Truth table for NOT operationThe NOT operator takes one input and produces one output,which is the complement of the input.Table 4.1 shows the truth tab
2、le for the NOT operation at bit level.A truth table lists all possible input combinations along with the corresponding outputs.8Logical Operations at bit levelTable 4.2 Truth table for AND operationXYX AND Y0000101001119Logical Operations at bit levelInherent Rule of the AND Operator:The AND operati
3、on can be used to force(unset)individual bits in a bit string to 0.From Table 4.2,we can see that if one of the input bits is 0,the result is always 0 regardless of the other input bit,which means you dont need to check the corresponding bit value of the other input.10Logical Operations at bit level
4、Table 4.3 Truth table for OR operationXYX OR Y000011101111The OR operator accepts two inputs and creates one output.For each pair of input bits,the result is 0 if and only if both bits are 0;otherwise,the result is 1.Table 4.3 shows the truth table for the OR operation at bit level.11Logical Operati
5、ons at bit levelInherent Rule of the OR Operator:The OR operation can be used to force(set)individual bits in a bit string to 1.If one of the input bits is 1,the result is always 1 regardless of the other input bit,which means you dont need to check the corresponding bit value of the other input.12L
6、ogical Operations at bit levelTable 4.4 Truth table for XOR operationXYX XOR Y000011101110The XOR(exclusive OR)operator accepts two inputs and creates one output.For each pair of input bits,the result is 0 if and only if both bits are equal;otherwise,the result is 1.Table 4.4 shows the truth table f
7、or the XOR operation at bit level.13Logical Operations at bit level ()()x XOR yx AND NOT yORNOT x AND yThe XOR operator can be used to selectively invert(flip or NOT)bits in a bit string.If one of the input bits is 1,the result is always the inverse of the other input bit.If one of the input bits is
8、 0,the result is exactly the value of the other input bit.Actually,the XOR operator is not a basic operator.We can simulate its functionality by using the three basic operators.The following expression shows the relation between them:14Logical Operations at bit levelTable 4.5 Truth table for XNOR op
9、eratorXYX XNOR Y001010100111The XNOR operator accepts two inputs and creates one output.For each pair of input bits,the result is 0 if and only if both bits are not equal;otherwise,the result is 1.Table 4.5 shows the truth table for the XNOR operation at bit level.15Logical Operations at bit level (
10、)()()x XNOR yx AND y ORNOT x AND NOT yNOTx XOR yLike XOR operator,the XNOR operator can be represented by using the three basic operators.The following expression show the relation between them:It is not a basic logical operator too and it just a reverse(NOT)of XOR16Logical Operations at bit level x
11、 NAND yNOT x AND yx NOR yNOT x OR yThe NAND(or not-and)operator applies AND to its input bits and then inverts the output by applying NOT.For each pair of input bits,the result of applying NAND operator is 0 if and only if both bits are 1;otherwise,the result is 1.Similarly,the NOR(or not-or)operato
12、r applies OR to its input bits and then inverts the output by applying NOT.For each pair of input bits,the result of applying NOR operator is 0 if and only if either of its input bits are 1;otherwise,the result is 1.They can be represented through following expressions:So,they are not basic logical
13、operators either.17Logical Operations at bit levelTable 4.6 Truth table for NAND operatorXYX NAND Y001011101110The corresponding truth tables are shown in Table 4.6 and Table 4.718Logical Operations at bit levelTable 4.7 Truth table for NOR operatorXYX NOR Y00101010011019Logical Operations at patter
14、n levelThe logical operators that can be applied to an n-bit pattern arethe same as the logical operators applied to each individual inputbit.There are some examples to help us understand this rule.Apply the NOT operator on the bit pattern 1110101020Logical Operations at pattern levelApply AND,OR,XO
15、R,XNOR,NOR,and NAND operators on the bit patterns 10101101 and 0110101121Logical Operations at pattern levelApply AND,OR,XOR,XNOR,NOR,and NAND operators on the bit patterns 10101101 and 0110101122Logical Operations at pattern levelApply AND,OR,XOR,XNOR,NOR,and NAND operators on the bit patterns 1010
16、1101 and 0110101123Logical Operations at pattern levelApply AND,OR,XOR,XNOR,NOR,and NAND operators on the bit patterns 10101101 and 0110101124Logic Diagram Symbol25Logic Diagram SymbolTable 4.8 Logic Diagram Symbol and Logic Function Expression26Logic Diagram SymbolTable 4.8 Logic Diagram Symbol and
17、 Logic Function Expression27ApplicationsWe can modify a bit pattern with four binary logic operators:NOT,AND,OR,and XOR.These binary operators can complement,unset,set,or flip the target bit pattern with a mask.The mask is used to modify the target bit pattern.28ApplicationsThe most important applic
18、ation of AND operator is to unset(force to 0)specific bits in a target bit pattern.To do that,we must use an unsetting mask of the same length as of the target bit pattern.In this technique,to unset a specific bit of the target bit pattern,the corresponding bit in the mask is set to 0.Otherwise,to l
展开阅读全文