《软硬件系统编程PPT (14).pdf》由会员分享,可在线阅读,更多相关《软硬件系统编程PPT (14).pdf(18页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、基本逻辑运算和逻辑门基本逻辑运算和逻辑门 Basic Logic Operation and Logic Gate I.LOGIC Logic A law that shows the cause and effect of things The realization of logic is manifested by proposition and reasoning Proposition A statement that is either true or false Reasoning A thinking process that deduces conclusion from p
2、remise Premise is a known proposition,and conclusion is a proposition deduced by reasoning 2 3 Example:true false 3 is an even number Are there classes tomorrow morning?Not a proposition 3 is not an even number.Not(negation)John has learned both English and German.And(simultaneity)From Xian to Beiji
3、ng,people can go through Zhengzhou or Taiyuan.Or 2+3=5 Logic Proposition 4 Compound propositions can be constituted from simple propositions through the operation of“connectives”.Proposition is the basic representation of logic,therefore,“connectives”represents logical operation not NOT operation an
4、d AND operation or OR operation Logic Proposition 5 The truth and false of a proposition can correspond to In physic the opening and closing of a switch,or the high and low level of electrical level.In math 1 and 0 in binary system Modern computer is made up of various logic devices,and its mathemat
5、ical foundation is logic algebra.Logic Proposition 6 Logic algebra was invented by British mathematician George Boole Is mainly used in judgement related operations logical operation Using letters to represent variables,and the values of variables are only 0 and 1“0”for“false”“1”for“true”Logic algeb
6、ra A B Y 0 0 0 0 1 0 1 0 0 1 1 1 Logical operation uses symbols to represent connective relations of propositions e.g.proposition“John has learned both English and German”can be symbolized as A and B This means that A and B happen at the same time Representing the logical relationships between two p
7、ropositions(truth table)Basic logic gates“AND”,“OR”,“NOT”Truth Table II.LOGICAL OPERATIONS AND BASIC LOGIC GATES 8“AND”operation when all inputs are true,the output will be true when one of the inputs is false,the output must be false the symbol of“AND”operation“”,“”If 1 for true and 0 for false,ope
8、ration logic can be expressed in this way 1.“AND”Operation 11=1 10=0 01=0 00=0 9 K1K2K3“AND”operation In circuits,“AND”operation is equivalent to a series circuit of several switches only when all switches are all closed,the circuit is powered up&A B Y 输输 入入(V)输出输出(V)VA VB VY 0 0 0 5 5 0 5 5 0.3 0.3
9、 0.3 5 输输 入入 输输 出出 A B Y 0 0 0 1 1 0 1 1 0 0 0 1&A B Y X A gate circuit that performs AND operation on multiple logic variables Voltage relation between inputs and output Logical relation between inputs and output“AND”gate Input(V)Output(V)Input Output 11“OR”operation if one of the inputs is true,th
10、en the result will be true only if all inputs are false,the output will be false the symbol of“OR”operation“+”,“”operation logic 00=0 01=1 10=1 11=1 2.“OR”Operation 12 K1K2K3In circuit,“OR”operation is equivalent to a parallel circuit of several switches only when all the switches are off,the circui
11、t is powered off“OR”operation 11 A B Y 输输 入入 输输 出出 VA(V)VB(V)VY(V)0 0 0 5 5 0 5 5 0 4.7 4.7 4.7 输输 入入 输输 出出 A B Y 0 0 0 1 1 0 1 1 0 1 1 1 11 A B Y X A gate circuit that performs OR operation on multiple logic variable Voltage relation between inputs and output Logical relation between inputs and out
12、put“OR”gate Input(V)Output(V)Input Output“NOT”operation:when the conditions for result deciding are met,events do not occur.“NOT”only has one operand and the operational character is an overline Boolean Expression A=B 3.“NOT”Operation 15 KRThe circuit of“NOT”operation When the switch is off,the ligh
13、t is work,while when the switch is closed,the light is not work.“AND”operation 16 1 A F performs“NOT”operation on single logic variable input“OR”gate F=A output 17 the difference between logical operation and the arithmetic operation Arithmetic operation is an operation between two numbers,and the carry of low-order will pass to high-order.Logical operation is a bit-by-bit operation,and the carry of low-order will not pass to high-order.Summary For“AND”gate,when one of its inputs is low level or 0,the output is 0 For“OR”gate,when one of its inputs is high level or 1,the output is 1