Short Notes: Binary Logic | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE) PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 1


                                                               
 
Binary Logic 
 
Introduction  
Binary logic deals with variables that assume discrete values and with operators that assume logical meaning. 
While each logical element or condition must always have a logic value of either "0" or "1", we also need to have 
ways to combine different logical signals or conditions to provide a logical result. 
For example, consider the logical statement: "If I move the switch on the wall up, the light will turn on." At first 
glance, this seems to be a correct statement. However, if we look at a few other factors, we realize that there's more 
to it than this. In this example, a more complete statement would be: "If I move the switch on the wall up and the 
light bulb is good and the power is on, the light will turn on." 
If we look at these two statements as logical expressions and use logical terminology, we can reduce the first 
statement to: 
Light = Switch 
This means nothing more than that the light will follow the action of the switch, so that when the switch is 
up/on/true/1 the light will also be on/true/1. Conversely, if the switch is down/off/false/0 the light will also be 
off/false/0. 
Looking at the second version of the statement, we have a slightly more complex expression: 
Light = Switch and Bulb and Power 
When we deal with logical circuits (as in computers), we not only need to deal with logical functions; we also need 
some special symbols to denote these functions in a logical diagram. There are three fundamental logical 
operations, from which all other functions, no matter how complex, can be derived. These functions are named 
and, or, and not. Each of these has a specific symbol and a clearly-defined behaviour. 
AND. The AND operation is represented by a dot(.) or by the absence of an operator. E.g. x.y=z    xy=z  are all read as x 
AND y=z. the logical operation AND is interpreted to mean that  z=1 if and only if x=1 and y=1 otherwise z=0 
OR. The operation is represented by a + sign for example, x+y=z is interpreted as x OR y=z meaning that z=1 if x=1 or 
y=1 or if both x=1 and y=1. If both  x and y are 0, then z=0 
NOT. This operation is represented by a bar or a prime. For example x'= x =z is interpreted as NOT x =z meaning that z 
is what x is not 
It should be noted that although the AND and the OR operation have some similarity with the multiplication and 
addition respectively in binary arithmetic , however one should note that an arithmetic variable may consist of many 
digits. A binary logic variable is always 0 or 1. 
e.g. in binary arithmetic, 1+1=10 while in binary logic 1+1=1 
Basic Gate 
The basic building blocks of a computer are called logical gates or just gates.  Gates are basic circuits that have at least 
one (and usually more) input and exactly one output. Input and output values are the logical values true and false. In 
computer architecture it is common to use 0 for false and 1 for true. Gates have no memory. The value of the output 
depends only on the current value of the inputs.  A useful way of describing the relationship between the inputs of gates 
Page 2


                                                               
 
Binary Logic 
 
Introduction  
Binary logic deals with variables that assume discrete values and with operators that assume logical meaning. 
While each logical element or condition must always have a logic value of either "0" or "1", we also need to have 
ways to combine different logical signals or conditions to provide a logical result. 
For example, consider the logical statement: "If I move the switch on the wall up, the light will turn on." At first 
glance, this seems to be a correct statement. However, if we look at a few other factors, we realize that there's more 
to it than this. In this example, a more complete statement would be: "If I move the switch on the wall up and the 
light bulb is good and the power is on, the light will turn on." 
If we look at these two statements as logical expressions and use logical terminology, we can reduce the first 
statement to: 
Light = Switch 
This means nothing more than that the light will follow the action of the switch, so that when the switch is 
up/on/true/1 the light will also be on/true/1. Conversely, if the switch is down/off/false/0 the light will also be 
off/false/0. 
Looking at the second version of the statement, we have a slightly more complex expression: 
Light = Switch and Bulb and Power 
When we deal with logical circuits (as in computers), we not only need to deal with logical functions; we also need 
some special symbols to denote these functions in a logical diagram. There are three fundamental logical 
operations, from which all other functions, no matter how complex, can be derived. These functions are named 
and, or, and not. Each of these has a specific symbol and a clearly-defined behaviour. 
AND. The AND operation is represented by a dot(.) or by the absence of an operator. E.g. x.y=z    xy=z  are all read as x 
AND y=z. the logical operation AND is interpreted to mean that  z=1 if and only if x=1 and y=1 otherwise z=0 
OR. The operation is represented by a + sign for example, x+y=z is interpreted as x OR y=z meaning that z=1 if x=1 or 
y=1 or if both x=1 and y=1. If both  x and y are 0, then z=0 
NOT. This operation is represented by a bar or a prime. For example x'= x =z is interpreted as NOT x =z meaning that z 
is what x is not 
It should be noted that although the AND and the OR operation have some similarity with the multiplication and 
addition respectively in binary arithmetic , however one should note that an arithmetic variable may consist of many 
digits. A binary logic variable is always 0 or 1. 
e.g. in binary arithmetic, 1+1=10 while in binary logic 1+1=1 
Basic Gate 
The basic building blocks of a computer are called logical gates or just gates.  Gates are basic circuits that have at least 
one (and usually more) input and exactly one output. Input and output values are the logical values true and false. In 
computer architecture it is common to use 0 for false and 1 for true. Gates have no memory. The value of the output 
depends only on the current value of the inputs.  A useful way of describing the relationship between the inputs of gates 
                                                               
 
and their output is the truth table. In a truth table, the value of each output is tabulated for every possible combination of 
the input values. 
We usually consider three basic kinds of gates, and-gates, or-gates, and not-gates (or inverters).  
- The AND Gate 
The AND gate implements the AND function. With the gate shown to the left, both inputs must have logic 1 signals 
applied to them in order for the output to be a logic 1. With either input at logic 0, the output will be held to logic 0. 
 
The truth table for an and-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 0 
   1 0 | 0 
   1 1 | 1 
There is no limit to the number of inputs that may be applied to an AND function, so there is no functional limit to 
the number of inputs an AND gate may have. However, for practical reasons, commercial AND gates are most 
commonly manufactured with 2, 3, or 4 inputs. A standard Integrated Circuit (IC) package contains 14 or 16 pins, for 
practical size and handling. A standard 14-pin package can contain four 2-input gates, three 3-input gates, or two 4-
input gates, and still have room for two pins for power supply connections. 
- The OR Gate 
The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart, allows the output to 
be true (logic 1) if any one or more of its inputs are true. Verbally, we might say, "If it is raining OR if I turn on the 
sprinkler, the lawn will be wet." Note that the lawn will still be wet if the sprinkler is on and it is also raining. This is 
correctly reflected by the basic OR function. 
In symbols, the OR function is designated with a plus sign (+). In logical diagrams, the symbol below designates the 
OR gate. 
 
The truth table for an or-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 1 
   1 0 | 1 
   1 1 | 1 
As with the AND function, the OR function can have any number of inputs. However, practical commercial OR gates 
are mostly limited to 2, 3, and 4 inputs, as with AND gates. 
 
Page 3


                                                               
 
Binary Logic 
 
Introduction  
Binary logic deals with variables that assume discrete values and with operators that assume logical meaning. 
While each logical element or condition must always have a logic value of either "0" or "1", we also need to have 
ways to combine different logical signals or conditions to provide a logical result. 
For example, consider the logical statement: "If I move the switch on the wall up, the light will turn on." At first 
glance, this seems to be a correct statement. However, if we look at a few other factors, we realize that there's more 
to it than this. In this example, a more complete statement would be: "If I move the switch on the wall up and the 
light bulb is good and the power is on, the light will turn on." 
If we look at these two statements as logical expressions and use logical terminology, we can reduce the first 
statement to: 
Light = Switch 
This means nothing more than that the light will follow the action of the switch, so that when the switch is 
up/on/true/1 the light will also be on/true/1. Conversely, if the switch is down/off/false/0 the light will also be 
off/false/0. 
Looking at the second version of the statement, we have a slightly more complex expression: 
Light = Switch and Bulb and Power 
When we deal with logical circuits (as in computers), we not only need to deal with logical functions; we also need 
some special symbols to denote these functions in a logical diagram. There are three fundamental logical 
operations, from which all other functions, no matter how complex, can be derived. These functions are named 
and, or, and not. Each of these has a specific symbol and a clearly-defined behaviour. 
AND. The AND operation is represented by a dot(.) or by the absence of an operator. E.g. x.y=z    xy=z  are all read as x 
AND y=z. the logical operation AND is interpreted to mean that  z=1 if and only if x=1 and y=1 otherwise z=0 
OR. The operation is represented by a + sign for example, x+y=z is interpreted as x OR y=z meaning that z=1 if x=1 or 
y=1 or if both x=1 and y=1. If both  x and y are 0, then z=0 
NOT. This operation is represented by a bar or a prime. For example x'= x =z is interpreted as NOT x =z meaning that z 
is what x is not 
It should be noted that although the AND and the OR operation have some similarity with the multiplication and 
addition respectively in binary arithmetic , however one should note that an arithmetic variable may consist of many 
digits. A binary logic variable is always 0 or 1. 
e.g. in binary arithmetic, 1+1=10 while in binary logic 1+1=1 
Basic Gate 
The basic building blocks of a computer are called logical gates or just gates.  Gates are basic circuits that have at least 
one (and usually more) input and exactly one output. Input and output values are the logical values true and false. In 
computer architecture it is common to use 0 for false and 1 for true. Gates have no memory. The value of the output 
depends only on the current value of the inputs.  A useful way of describing the relationship between the inputs of gates 
                                                               
 
and their output is the truth table. In a truth table, the value of each output is tabulated for every possible combination of 
the input values. 
We usually consider three basic kinds of gates, and-gates, or-gates, and not-gates (or inverters).  
- The AND Gate 
The AND gate implements the AND function. With the gate shown to the left, both inputs must have logic 1 signals 
applied to them in order for the output to be a logic 1. With either input at logic 0, the output will be held to logic 0. 
 
The truth table for an and-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 0 
   1 0 | 0 
   1 1 | 1 
There is no limit to the number of inputs that may be applied to an AND function, so there is no functional limit to 
the number of inputs an AND gate may have. However, for practical reasons, commercial AND gates are most 
commonly manufactured with 2, 3, or 4 inputs. A standard Integrated Circuit (IC) package contains 14 or 16 pins, for 
practical size and handling. A standard 14-pin package can contain four 2-input gates, three 3-input gates, or two 4-
input gates, and still have room for two pins for power supply connections. 
- The OR Gate 
The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart, allows the output to 
be true (logic 1) if any one or more of its inputs are true. Verbally, we might say, "If it is raining OR if I turn on the 
sprinkler, the lawn will be wet." Note that the lawn will still be wet if the sprinkler is on and it is also raining. This is 
correctly reflected by the basic OR function. 
In symbols, the OR function is designated with a plus sign (+). In logical diagrams, the symbol below designates the 
OR gate. 
 
The truth table for an or-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 1 
   1 0 | 1 
   1 1 | 1 
As with the AND function, the OR function can have any number of inputs. However, practical commercial OR gates 
are mostly limited to 2, 3, and 4 inputs, as with AND gates. 
 
                                                               
 
- The NOT Gate, or Inverter 
The inverter is a little different from AND and OR gates in that it always has exactly one input as well as one output. 
Whatever logical state is applied to the input, the opposite state will appear at the output. 
 
The truth table for an inverter looks like this:  
   x | y 
   ----- 
   0 | 1 
   1 | 0 
The NOT function, as it is called, is necesasary in many applications and highly useful in others. A practical verbal 
application might be: 
The door is NOT locked = You may enter 
In the inverter symbol, the triangle actually denotes only an amplifier, which in digital terms means that it "cleans up" 
the signal but does not change its logical sense. It is the circle at the output which denotes the logical inversion. The 
circle could have been placed at the input instead, and the logical meaning would still be the same 
Combined gates 
Sometimes, it is practical to combine functions of the basic gates into more complex gates, for instance in order to save 
space in circuit diagrams. In this section, we show some such combined gates together with their truth tables.  
- The nand-gate 
The nand-gate is an and-gate with an inverter on the output. So instead of drawing several gates like this:  
 
We draw a single and-gate with a little ring on the output like this:  
 
The nand-gate, like the and-gate can take an arbitrary number of inputs.  
The truth table for the nand-gate is like the one for the and-gate, except that all output values have been inverted:  
   
 
 
Page 4


                                                               
 
Binary Logic 
 
Introduction  
Binary logic deals with variables that assume discrete values and with operators that assume logical meaning. 
While each logical element or condition must always have a logic value of either "0" or "1", we also need to have 
ways to combine different logical signals or conditions to provide a logical result. 
For example, consider the logical statement: "If I move the switch on the wall up, the light will turn on." At first 
glance, this seems to be a correct statement. However, if we look at a few other factors, we realize that there's more 
to it than this. In this example, a more complete statement would be: "If I move the switch on the wall up and the 
light bulb is good and the power is on, the light will turn on." 
If we look at these two statements as logical expressions and use logical terminology, we can reduce the first 
statement to: 
Light = Switch 
This means nothing more than that the light will follow the action of the switch, so that when the switch is 
up/on/true/1 the light will also be on/true/1. Conversely, if the switch is down/off/false/0 the light will also be 
off/false/0. 
Looking at the second version of the statement, we have a slightly more complex expression: 
Light = Switch and Bulb and Power 
When we deal with logical circuits (as in computers), we not only need to deal with logical functions; we also need 
some special symbols to denote these functions in a logical diagram. There are three fundamental logical 
operations, from which all other functions, no matter how complex, can be derived. These functions are named 
and, or, and not. Each of these has a specific symbol and a clearly-defined behaviour. 
AND. The AND operation is represented by a dot(.) or by the absence of an operator. E.g. x.y=z    xy=z  are all read as x 
AND y=z. the logical operation AND is interpreted to mean that  z=1 if and only if x=1 and y=1 otherwise z=0 
OR. The operation is represented by a + sign for example, x+y=z is interpreted as x OR y=z meaning that z=1 if x=1 or 
y=1 or if both x=1 and y=1. If both  x and y are 0, then z=0 
NOT. This operation is represented by a bar or a prime. For example x'= x =z is interpreted as NOT x =z meaning that z 
is what x is not 
It should be noted that although the AND and the OR operation have some similarity with the multiplication and 
addition respectively in binary arithmetic , however one should note that an arithmetic variable may consist of many 
digits. A binary logic variable is always 0 or 1. 
e.g. in binary arithmetic, 1+1=10 while in binary logic 1+1=1 
Basic Gate 
The basic building blocks of a computer are called logical gates or just gates.  Gates are basic circuits that have at least 
one (and usually more) input and exactly one output. Input and output values are the logical values true and false. In 
computer architecture it is common to use 0 for false and 1 for true. Gates have no memory. The value of the output 
depends only on the current value of the inputs.  A useful way of describing the relationship between the inputs of gates 
                                                               
 
and their output is the truth table. In a truth table, the value of each output is tabulated for every possible combination of 
the input values. 
We usually consider three basic kinds of gates, and-gates, or-gates, and not-gates (or inverters).  
- The AND Gate 
The AND gate implements the AND function. With the gate shown to the left, both inputs must have logic 1 signals 
applied to them in order for the output to be a logic 1. With either input at logic 0, the output will be held to logic 0. 
 
The truth table for an and-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 0 
   1 0 | 0 
   1 1 | 1 
There is no limit to the number of inputs that may be applied to an AND function, so there is no functional limit to 
the number of inputs an AND gate may have. However, for practical reasons, commercial AND gates are most 
commonly manufactured with 2, 3, or 4 inputs. A standard Integrated Circuit (IC) package contains 14 or 16 pins, for 
practical size and handling. A standard 14-pin package can contain four 2-input gates, three 3-input gates, or two 4-
input gates, and still have room for two pins for power supply connections. 
- The OR Gate 
The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart, allows the output to 
be true (logic 1) if any one or more of its inputs are true. Verbally, we might say, "If it is raining OR if I turn on the 
sprinkler, the lawn will be wet." Note that the lawn will still be wet if the sprinkler is on and it is also raining. This is 
correctly reflected by the basic OR function. 
In symbols, the OR function is designated with a plus sign (+). In logical diagrams, the symbol below designates the 
OR gate. 
 
The truth table for an or-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 1 
   1 0 | 1 
   1 1 | 1 
As with the AND function, the OR function can have any number of inputs. However, practical commercial OR gates 
are mostly limited to 2, 3, and 4 inputs, as with AND gates. 
 
                                                               
 
- The NOT Gate, or Inverter 
The inverter is a little different from AND and OR gates in that it always has exactly one input as well as one output. 
Whatever logical state is applied to the input, the opposite state will appear at the output. 
 
The truth table for an inverter looks like this:  
   x | y 
   ----- 
   0 | 1 
   1 | 0 
The NOT function, as it is called, is necesasary in many applications and highly useful in others. A practical verbal 
application might be: 
The door is NOT locked = You may enter 
In the inverter symbol, the triangle actually denotes only an amplifier, which in digital terms means that it "cleans up" 
the signal but does not change its logical sense. It is the circle at the output which denotes the logical inversion. The 
circle could have been placed at the input instead, and the logical meaning would still be the same 
Combined gates 
Sometimes, it is practical to combine functions of the basic gates into more complex gates, for instance in order to save 
space in circuit diagrams. In this section, we show some such combined gates together with their truth tables.  
- The nand-gate 
The nand-gate is an and-gate with an inverter on the output. So instead of drawing several gates like this:  
 
We draw a single and-gate with a little ring on the output like this:  
 
The nand-gate, like the and-gate can take an arbitrary number of inputs.  
The truth table for the nand-gate is like the one for the and-gate, except that all output values have been inverted:  
   
 
 
                                                               
 
   x y | z 
   ------- 
   0 0 | 1 
   0 1 | 1 
   1 0 | 1 
   1 1 | 0 
The truth table clearly shows that the NAND operation is the complement of the AND 
- The nor-gate 
The nor-gate is an or-gate with an inverter on the output. So instead of drawing several gates like this:  
 
We draw a single or-gate with a little ring on the output like this:  
 
The nor-gate, like the or-gate can take an arbitrary number of inputs.  
The truth table for the nor-gate is like the one for the or-gate, except that all output values have been inverted:  
   x  y | z 
   ------- 
   0  0 | 1 
   0  1 | 0 
   1  0 | 0 
   1  1 | 0 
 
- The exclusive-or-gate 
The exclusive-or-gate is similar to an or-gate. It can have an arbitrary number of inputs, and its output value is 1 if and 
only if exactly one input is 1 (and thus the others 0). Otherwise, the output is 0.  
We draw an exclusive-or-gate like this:  
 
The truth table for an exclusive-or-gate with two inputs looks like this:  
 
Page 5


                                                               
 
Binary Logic 
 
Introduction  
Binary logic deals with variables that assume discrete values and with operators that assume logical meaning. 
While each logical element or condition must always have a logic value of either "0" or "1", we also need to have 
ways to combine different logical signals or conditions to provide a logical result. 
For example, consider the logical statement: "If I move the switch on the wall up, the light will turn on." At first 
glance, this seems to be a correct statement. However, if we look at a few other factors, we realize that there's more 
to it than this. In this example, a more complete statement would be: "If I move the switch on the wall up and the 
light bulb is good and the power is on, the light will turn on." 
If we look at these two statements as logical expressions and use logical terminology, we can reduce the first 
statement to: 
Light = Switch 
This means nothing more than that the light will follow the action of the switch, so that when the switch is 
up/on/true/1 the light will also be on/true/1. Conversely, if the switch is down/off/false/0 the light will also be 
off/false/0. 
Looking at the second version of the statement, we have a slightly more complex expression: 
Light = Switch and Bulb and Power 
When we deal with logical circuits (as in computers), we not only need to deal with logical functions; we also need 
some special symbols to denote these functions in a logical diagram. There are three fundamental logical 
operations, from which all other functions, no matter how complex, can be derived. These functions are named 
and, or, and not. Each of these has a specific symbol and a clearly-defined behaviour. 
AND. The AND operation is represented by a dot(.) or by the absence of an operator. E.g. x.y=z    xy=z  are all read as x 
AND y=z. the logical operation AND is interpreted to mean that  z=1 if and only if x=1 and y=1 otherwise z=0 
OR. The operation is represented by a + sign for example, x+y=z is interpreted as x OR y=z meaning that z=1 if x=1 or 
y=1 or if both x=1 and y=1. If both  x and y are 0, then z=0 
NOT. This operation is represented by a bar or a prime. For example x'= x =z is interpreted as NOT x =z meaning that z 
is what x is not 
It should be noted that although the AND and the OR operation have some similarity with the multiplication and 
addition respectively in binary arithmetic , however one should note that an arithmetic variable may consist of many 
digits. A binary logic variable is always 0 or 1. 
e.g. in binary arithmetic, 1+1=10 while in binary logic 1+1=1 
Basic Gate 
The basic building blocks of a computer are called logical gates or just gates.  Gates are basic circuits that have at least 
one (and usually more) input and exactly one output. Input and output values are the logical values true and false. In 
computer architecture it is common to use 0 for false and 1 for true. Gates have no memory. The value of the output 
depends only on the current value of the inputs.  A useful way of describing the relationship between the inputs of gates 
                                                               
 
and their output is the truth table. In a truth table, the value of each output is tabulated for every possible combination of 
the input values. 
We usually consider three basic kinds of gates, and-gates, or-gates, and not-gates (or inverters).  
- The AND Gate 
The AND gate implements the AND function. With the gate shown to the left, both inputs must have logic 1 signals 
applied to them in order for the output to be a logic 1. With either input at logic 0, the output will be held to logic 0. 
 
The truth table for an and-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 0 
   1 0 | 0 
   1 1 | 1 
There is no limit to the number of inputs that may be applied to an AND function, so there is no functional limit to 
the number of inputs an AND gate may have. However, for practical reasons, commercial AND gates are most 
commonly manufactured with 2, 3, or 4 inputs. A standard Integrated Circuit (IC) package contains 14 or 16 pins, for 
practical size and handling. A standard 14-pin package can contain four 2-input gates, three 3-input gates, or two 4-
input gates, and still have room for two pins for power supply connections. 
- The OR Gate 
The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart, allows the output to 
be true (logic 1) if any one or more of its inputs are true. Verbally, we might say, "If it is raining OR if I turn on the 
sprinkler, the lawn will be wet." Note that the lawn will still be wet if the sprinkler is on and it is also raining. This is 
correctly reflected by the basic OR function. 
In symbols, the OR function is designated with a plus sign (+). In logical diagrams, the symbol below designates the 
OR gate. 
 
The truth table for an or-gate with two inputs looks like this:  
   x y | z 
   ------- 
   0 0 | 0 
   0 1 | 1 
   1 0 | 1 
   1 1 | 1 
As with the AND function, the OR function can have any number of inputs. However, practical commercial OR gates 
are mostly limited to 2, 3, and 4 inputs, as with AND gates. 
 
                                                               
 
- The NOT Gate, or Inverter 
The inverter is a little different from AND and OR gates in that it always has exactly one input as well as one output. 
Whatever logical state is applied to the input, the opposite state will appear at the output. 
 
The truth table for an inverter looks like this:  
   x | y 
   ----- 
   0 | 1 
   1 | 0 
The NOT function, as it is called, is necesasary in many applications and highly useful in others. A practical verbal 
application might be: 
The door is NOT locked = You may enter 
In the inverter symbol, the triangle actually denotes only an amplifier, which in digital terms means that it "cleans up" 
the signal but does not change its logical sense. It is the circle at the output which denotes the logical inversion. The 
circle could have been placed at the input instead, and the logical meaning would still be the same 
Combined gates 
Sometimes, it is practical to combine functions of the basic gates into more complex gates, for instance in order to save 
space in circuit diagrams. In this section, we show some such combined gates together with their truth tables.  
- The nand-gate 
The nand-gate is an and-gate with an inverter on the output. So instead of drawing several gates like this:  
 
We draw a single and-gate with a little ring on the output like this:  
 
The nand-gate, like the and-gate can take an arbitrary number of inputs.  
The truth table for the nand-gate is like the one for the and-gate, except that all output values have been inverted:  
   
 
 
                                                               
 
   x y | z 
   ------- 
   0 0 | 1 
   0 1 | 1 
   1 0 | 1 
   1 1 | 0 
The truth table clearly shows that the NAND operation is the complement of the AND 
- The nor-gate 
The nor-gate is an or-gate with an inverter on the output. So instead of drawing several gates like this:  
 
We draw a single or-gate with a little ring on the output like this:  
 
The nor-gate, like the or-gate can take an arbitrary number of inputs.  
The truth table for the nor-gate is like the one for the or-gate, except that all output values have been inverted:  
   x  y | z 
   ------- 
   0  0 | 1 
   0  1 | 0 
   1  0 | 0 
   1  1 | 0 
 
- The exclusive-or-gate 
The exclusive-or-gate is similar to an or-gate. It can have an arbitrary number of inputs, and its output value is 1 if and 
only if exactly one input is 1 (and thus the others 0). Otherwise, the output is 0.  
We draw an exclusive-or-gate like this:  
 
The truth table for an exclusive-or-gate with two inputs looks like this:  
 
                                                               
 
   x   y | z 
   ------- 
   0   0 | 0 
   0   1 | 1 
   1   0 | 1 
   1   1 | 0 
 
- The exclusive-Nor-gate 
The exclusive-Nor-gate is similar to an N or-gate. It can have an arbitrary number of inputs, and its output value is 1 if 
and only if the two input are of the same values (1 and 1 or 0 and 0). Otherwise, the output is 0.  
We draw an exclusive-Nor-gate like this:  
 
 
The truth table for an exclusive-nor-gate with two inputs looks like this:  
   x   y | z 
   ------- 
   0   0 | 1 
   0   1 | 0 
   1   0 | 0 
   1   1 | 1 
 
 
Let us limit ourselves to gates with n inputs. The truth tables for such gates have 2
n
 lines. Such a gate is completely 
defined by the output column in the truth table. The output column can be viewed as a string of 2
n
 binary digits. How 
many different strings of binary digits of length 2
n
 are there? The answer is 2
2n
, since there are 2
k
 different strings of k 
binary digits, and if k=2
n
, then there are 2
2n
 such strings. In particular, if n=2, we can see that there are 16 different 
types of gates with 2 inputs.  
Families of logic gates 
There are several different families of logic gates. Each family has its capabilities and limitations, its advantages and 
disadvantages. The following list describes the main logic families and their characteristics. You can follow the links to 
see the circuit construction of gates of each family. 
- Diode Logic (DL) 
Diode logic gates use diodes to perform AND and OR logic functions. Diodes have the property of easily passing an 
electrical current in one direction, but not the other. Thus, diodes can act as a logical switch. 
Diode logic gates are very simple and inexpensive, and can be used effectively in specific situations. However, they 
cannot be used extensively, as they tend to degrade digital signals rapidly. In addition, they cannot perform a NOT 
function, so their usefulness is quite limited. 
- Resistor-Transistor Logic (RTL) 
Resistor-transistor logic gates use Transistors to combine multiple input signals, which also amplify and invert the 
resulting combined signal. Often an additional transistor is included to re-invert the output signal. This combination 
provides clean output signals and either inversion or non-inversion as needed. 
Read More
90 docs

Top Courses for Computer Science Engineering (CSE)

Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Objective type Questions

,

pdf

,

shortcuts and tricks

,

Important questions

,

Short Notes: Binary Logic | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

MCQs

,

Viva Questions

,

Free

,

study material

,

ppt

,

video lectures

,

Exam

,

past year papers

,

Short Notes: Binary Logic | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

Previous Year Questions with Solutions

,

Semester Notes

,

Extra Questions

,

Short Notes: Binary Logic | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

Sample Paper

,

Summary

,

practice quizzes

,

mock tests for examination

;