Ringkasan Bab 3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

CHAPTER 3.

MORE LOGIC GATES 32


3-1.NOR Gates
The inclusive NOR (Not-OR) gate has an output that is normally at logic level “1”
and only goes “LOW” to logic level “0” when ANY of its inputs are at logic level “1”.
The Logic NOR Gate is the reverse or “Complementary” form of the inclusive OR gate
we have seen previously.

Logic NOR Gate Equivalent

 
The logic or Boolean expression given for a logic NOR gate is that for Logical Multiplication which it
performs on the complements of the inputs. The Boolean expression for a logic NOR gate is denoted by a plus
sign, ( + ) with a line or Overline, ( ‾‾ ) over the expression to signify the NOT or logical negation of
the NOR gate giving us the Boolean expression of:  A+B = Q.
Then we can define the operation of a 2-input digital logic NOR gate as being:
 
“If both A and B are NOT true, then Q is true”

Transistor NOR Gate


A simple 2-input logic NOR gate can be constructed using RTL Resistor-transistor switches connected
together as shown below with the inputs connected directly to the transistor bases. Both transistors must be
cut-off “OFF” for an output at Q.

 
Logic NOR Gates are available using digital circuits to produce the desired logical function and is given a
symbol whose shape is that of a standard OR gate with a circle, sometimes called an “inversion bubble” at its
output to represent the NOT gate symbol with the logical operation of the NOR gate given as.

The Digital Logic “NOR” Gate

2-input NOR Gate


Symbol Truth Table

B A Q

0 0 1

0 1 0

1 0 0
2-input NOR Gate
1 1 0

Read as A OR B
Boolean Expression Q = A+B
gives NOT Q

3-input NOR Gate

Symbol Truth Table

C B A Q

0 0 0 1

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0
3-input NOR Gate
1 0 1 0

1 1 0 0

1 1 1 0

Read as
Boolean Expression Q = A+B+C A OR B OR C
gives NOT Q

As with the OR function, the NOR function can also have any number of individual inputs and commercial
available NOR Gate IC’s are available in standard 2, 3, or 4 input types. If additional inputs are required, then
the standard NOR gates can be cascaded together to provide more inputs for example.

A 4-input NOR Function

 
The Boolean Expression for this 4-input NOR gate will therefore be:   Q = A+B+C+D
If the number of inputs required is an odd number of inputs any “unused” inputs can be held LOW by
connecting them directly to ground using suitable “Pull-down” resistors.
The Logic NOR Gate function is sometimes known as the Pierce Function and is denoted by a downwards
arrow operator as shown, A↓B.

The “Universal” NOR Gate


Like the NAND gate seen in the last section, the NOR gate can also be classed as a “Universal” type
gate. NOR gates can be used to produce any other type of logic gate function just like the NAND gate and by
connecting them together in various combinations the three basic gate types of AND, OR and NOT function
can be formed using only NOR gates, for example.

Various Logic Gates using only NOR Gates

 
As well as the three common types above, Exclusive-OR, Exclusive-NOR and standard NOR gates can also be
formed using just individual NOR gates.
Commonly available digital logic NOR gate IC’s include:
TTL Logic NOR Gates

 74LS02 Quad 2-input


 74LS27 Triple 3-input
 74LS260 Dual 4-input

CMOS Logic NOR Gates

 CD4001 Quad 2-input


 CD4025 Triple 3-input
 CD4002 Dual 4-input

7402 Quad 2-input NOR Gate


 
In the next tutorial about Digital Logic Gates, we will look at the digital logic Exclusive-OR gate known
commonly as the Ex-OR Gate function as used in both TTL and CMOS logic circuits as well as its Boolean
Algebra definition and truth tables.

3-2. De Morgan's First Theorem


As we have seen previously, Boolean Algebra uses a set of laws and rules to define the operation of a digital
logic circuit with “0’s” and “1’s” being used to represent a digital input or output condition. Boolean Algebra
uses these zeros and ones to create truth tables and mathematical expressions to define the digital operation of
a logic AND, OR and NOT (or inversion) operations as well as ways of expressing other logical operations
such as the XOR (Exclusive-OR) function.
While George Boole’s set of laws and rules allows us to analyise and simplify a digital circuit, there are two
laws within his set that are attributed to Augustus DeMorgan (a nineteenth century English mathematician)
which views the logical NAND and NOR operations as separate NOT AND and NOT OR functions
respectively.
But before we look at DeMorgan’s Theory in more detail, let’s remind ourselves of the basic logical
operations where A and B are logic (or Boolean) input binary variables, and whose values can only be either
“0” or “1” producing four possible input combinations, 00, 01, 10, and 11.

Truth Table for Each Logical Operation

Input Variable Output Conditions

A B AND NAND OR NOR

0 0 0 1 0 1

0 1 0 1 1 0

1 0 0 1 1 0

1 1 1 0 1 0
The following table gives a list of the common logic functions and their equivalent Boolean notation where a
“.” (a dot) means an AND (product) operation, a “+” (plus sign) means an OR (sum) operation, and the
complement or inverse of a variable is indicated by a bar over the variable.

Logic Function Boolean Notation

AND A.B

OR A+B

NOT A

NAND A .B

NOR A+B

DeMorgan’s Theory
DeMorgan’s Theorems are basically two sets of rules or laws developed from the Boolean expressions
for AND, OR and NOT using two input variables, A and B. These two rules or theorems allow the input
variables to be negated and converted from one form of a Boolean function into an opposite form.

Inputs Truth Table Outputs For Each Term

DeMorgan’s first theorem states that two (or more)


variables NOR´ed together is the same as the two variables
B A A.B A.B A B A + B
inverted (Complement) and AND´ed, while the second
theorem states that two (or more) variables NAND´ed
together is the same as the two terms inverted
0 0 0 1 1 1 1 (Complement) and OR´ed. That is replace all the OR
operators with AND operators, or all the AND operators
with an OR operators.

0 1 0 1 0 1 1
DeMorgan’s First Theorem
DeMorgan’s First theorem proves that when two (or more)
input variables are AND’ed and negated, they are
1 0 0 1 1 0 1
equivalent to the OR of the complements of the individual

1 1 1 0 0 0 0
variables. Thus the equivalent of the NAND function will be a negative-OR function, proving that A.B = A+B.
We can show this operation using the following table.

Verifying DeMorgan’s First Theorem using Truth Table


 
We can also show that A.B = A+B using logic gates as shown.

DeMorgan’s First Law Implementation using Logic Gates

 
The top logic gate arrangement of: A.B can be implemented using a standard NAND gate with inputs A and B.
The lower logic gate arrangement first inverts the two inputs producing A and B. These then become the inputs
to the OR gate. Therefore the output from the OR gate becomes: A+B
Then we can see here that a standard OR gate function with inverters (NOT gates) on each of its inputs is
equivalent to a NAND gate function. So an individual NAND gate can be represented in this way as the
equivalency of a NAND gate is a negative-OR.

DeMorgan’s Second Theorem


DeMorgan’s Second theorem proves that when two (or more) input variables are OR’ed and negated, they are
equivalent to the AND of the complements of the individual variables. Thus the equivalent of
the NOR function is a negative-AND function proving that A+B = A.B, and again we can show operation this
using the following truth table.

Verifying DeMorgan’s Second Theorem using Truth Table

Inputs Truth Table Outputs For Each Term

B A A+B A+B A B A . B

0 0 0 1 1 1 1

0 1 1 0 0 1 0
1 0 1 0 1 0 0

1 1 1 0 0 0 0

 
We can also show that A+B = A.B using the following logic gates example.

DeMorgan’s Second Law Implementation using Logic Gates

 
The top logic gate arrangement of: A+B can be implemented using a standard NOR gate function using
inputs A and B. The lower logic gate arrangement first inverts the two inputs, thus producing A and B. Thus
then become the inputs to the AND gate. Therefore the output from the AND gate becomes: A.B
Then we can see that a standard AND gate function with inverters (NOT gates) on each of its inputs produces
an equivalent output condition to a standard NOR gate function, and an individual NOR gate can be
represented in this way as the equivalency of a NOR gate is a negative-AND.
Although we have used DeMorgan’s theorems with only two input variables A and B, they are equally valid
for use with three, four or more input variable expressions, for example:
For a 3-variable input
 
A.B.C = A+B+C
and also
A+B+C = A.B.C
For a 4-variable input
 
A.B.C.D = A+B+C+D
and also
A+B+C+D = A.B.C.D
and so on.

DeMorgan’s Equivalent Gates


We have seen here that by using DeMorgan’s Theorems we can replace all of the AND (.) operators with
an OR (+) and vice versa, and then complements each of the terms or variables in the expression by inverting
it, that is 0’s to 1’s and 1’s to 0’s before inverting the entire function.
Thus to obtain the DeMorgan equivalent for an AND, NAND, OR or NOR gate, we simply add inverters
(NOT-gates) to all inputs and outputs and change an AND symbol to an OR symbol or change an OR symbol
to an AND symbol as shown in the following table.

DeMorgan’s Equivalent Gates

Standard Logic Gate DeMorgan’s Equivalent Gate


Then we have seen in this tutorial about DeMorgan’s Thereom that the complement of two (or
more) AND’ed input variables is equivalent to the OR of the complements of these variables, and that the
complement of two (or more) OR’ed variables is equivalent to the AND of the complements of the variables as
defined by DeMorgan.

3-3. NANO Gates


The NAND (Not – AND) gate has an output that is normally at logic level “1” and only goes “LOW” to logic
level “0” when ALL of its inputs are at logic level “1”. The Logic NAND Gate is the reverse or
“Complementary” form of the AND gate we have seen previously.

Logic NAND Gate Equivalence

 
The logic or Boolean expression given for a logic NAND gate is that for Logical Addition, which is the
opposite to the AND gate, and which it performs on the complements of the inputs. The Boolean expression for
a logic NAND gate is denoted by a single dot or full stop symbol, ( . ) with a line or Overline, ( ‾‾ ) over the
expression to signify the NOT or logical negation of the NAND gate giving us the Boolean expression
of:  A.B = Q.
Then we can define the operation of a 2-input digital logic NAND gate as being:
 
“If both A and B are true, then Q is NOT true”

Transistor NAND Gate


A simple 2-input logic NAND gate can be constructed using RTL Resistor-transistor switches connected
together as shown below with the inputs connected directly to the transistor bases. Either transistor must be
cut-off “OFF” for an output at Q.
 
 
Logic NAND Gates are available using digital circuits to produce the desired logical function and is given a
symbol whose shape is that of a standard AND gate with a circle, sometimes called an “inversion bubble” at its
output to represent the NOT gate symbol with the logical operation of the NAND gate given as.

3-4. De Morgan's Second Theorem


DeMorgan’s Theorem is mainly used to solve the various Boolean algebra expressions. The Demorgan’s
theorem defines the uniformity between the gate with the same inverted input and output. It is used for
implementing the basic gate operation likes NAND gate and NOR gate.

The Demorgan’s theorem mostly used in digital programming and for making digital circuit diagrams.

There are two DeMorgan’s Theorems. They are described below in detail.

DeMorgan’s First Theorem


According to DeMorgan’s first theorem, a NOR gate is equivalent to a bubbled AND gate. The Boolean
expressions for the bubbled AND gate can be expressed by the equation shown below.

For NOR gate, the equation is:

For the bubbled AND gate the equation is:

As the NOR and bubbled gates are interchangeable, i.e., both gates have exactly identical outputs for the same
set of inputs.

Therefore, the equation can be written as shown below:

DeMorgan’s Second Theorem


DeMorgan’s Second Theorem states that the NAND gate is equivalent to a bubbled OR gate.
The Boolean expression for the NAND gate is given by the equation shown below:

The Boolean expression for the bubbled OR gate is given by the equation shown below:

Since NAND and bubbled OR gates are interchangeable, i.e., both gates have identical outputs for the same set

of inputs. Therefore, the equations become as given below:

This identity or equation (2) shown above is known as DeMorgan’s Second Theorem.

The symbolic representation of the theorem is shown in the figure below:

The Bubbled OR Gate


The logic circuit of the bubbled OR gate is shown below:

The truth table for the bubbled OR gate is shown below:

A B Z

0 0 1

0 1 1

1 0 1

1 1 0
In this, both the inputs are inverted before they are applied to an OR gate. The output of a bubbled OR gate can

be derived from its logic circuit and can be expressed by the equation shown below:

Here are the results when the logic circuit of bubbled OR gate when all the possible sets of inputs are applied
such as 00, 01, 10 or 11.

For AB: 00

For AB: 01

For AB: 10

For AB: 11

The truth table for the bubbled AND gate is exactly identical to the truth table of a NAND gate. Hence, NAND
and bubbled OR gate is interchangeable.

3-5. EXCLUSIVE-OR Gates


In the previous tutorials, we saw that by using the three principal gates, the AND Gate, the OR Gate and the
NOT Gate, we can build many other types of logic gate functions, such as a NAND Gate and a NOR Gate or
any other type of digital logic function we can imagine.
But there are two other types of digital logic gates which although they are not a basic gate in their own right
as they are constructed by combining together other logic gates, their output Boolean function is important
enough to be considered as complete logic gates. These two “hybrid” logic gates are called the Exclusive-OR
(Ex-OR) Gate and its complement the Exclusive-NOR (Ex-NOR) Gate.
Previously, we saw that for a 2-input OR gate, if A = “1”, OR B = “1”, OR BOTH A + B = “1” then the
output from the digital gate must also be at a logic level “1” and because of this, this type of logic gate is
known as an Inclusive-OR function. The logic gate gets its name from the fact that it includes the case of Q =
“1” when both A and B = “1”.
If however, an logic output “1” is obtained when ONLY A = “1” or when ONLY B = “1” but NOT both
together at the same time, giving the binary inputs of “01” or “10”, then the output will be “1”. This type of
gate is known as an Exclusive-OR function or more commonly an Ex-Or function for short. This is because its
boolean expression excludes the “OR BOTH” case of Q = “1” when both A and B = “1”.
In other words the output of an Exclusive-OR gate ONLY goes “HIGH” when its two input terminals are at
“DIFFERENT” logic levels with respect to each other.
An odd number of logic “1’s” on its inputs gives a logic “1” at the output. These two inputs can be at logic
level “1” or at logic level “0” giving us the Boolean expression of:  Q = (A ⊕ B) = A.B + A.B
The Exclusive-OR Gate function, or Ex-OR for short, is achieved by combining standard logic gates together
to form more complex gate functions that are used extensively in building arithmetic logic circuits,
computational logic comparators and error detection circuits.
The two-input “Exclusive-OR” gate is basically a modulo two adder, since it gives the sum of two binary
numbers and as a result are more complex in design than other basic types of logic gate. The truth table, logic
symbol and implementation of a 2-input Exclusive-OR gate is shown below.

The Digital Logic “Exclusive-OR” Gate

2-input Ex-OR Gate

Symbol Truth Table

B A Q

0 0 0

0 1 1

2-input Ex-OR Gate 1 0 1

1 1 0

Boolean Expression Q = A ⊕ B A OR B but NOT BOTH gives Q

 
Giving the Boolean expression of:  Q = AB + AB
The truth table above shows that the output of an Exclusive-OR gate ONLY goes “HIGH” when both of its
two input terminals are at “DIFFERENT” logic levels with respect to each other. If these two inputs, A and B
are both at logic level “1” or both at logic level “0” the output is a “0” making the gate an “odd but not the
even gate”. In other words, the output is “1” when there are an odd number of 1’s in the inputs.
This ability of the Exclusive-OR gate to compare two logic levels and produce an output value dependent upon
the input condition is very useful in computational logic circuits as it gives us the following Boolean
expression of:
Q = (A ⊕ B) = A.B + A.B
The logic function implemented by a 2-input Ex-OR is given as either: “A OR B but NOT both” will give an
output at Q. In general, an Ex-OR gate will give an output value of logic “1” ONLY when there are
an ODD number of 1’s on the inputs to the gate, if the two numbers are equal, the output is “0”.
Then an Ex-OR function with more than two inputs is called an “odd function” or modulo-2-sum (Mod-2-
SUM), not an Ex-OR. This description can be expanded to apply to any number of individual inputs as shown
below for a 3-input Ex-OR gate.

3-6. The Controlled Inverter


The controlled buffer and inverter, often called three-state buffers/inverters, each
have a one-bit "control" input pin on the south side. The value at this control pin
affects how the component behaves:

 When the value on this pin is 1, then the component behaves just like the
respective component (a buffer or a inverter (NOT gate)).
 When the value is 0 or unknown (i.e., floating), then the component's output is
also floating.
 When the value is an error value (such as would occur when two conflicting
values are being fed into the input), then the output is an error value.

Controlled buffers can be useful when you have a wire (often called a bus) whose
value should match the output of one of several components. By placing a controlled
buffer between each component output and the bus, you can control whether that
component's output is fed onto the bus or not.

Pins
Facing
The direction of the component (its output relative to its input).
West edge (input, bit width matches Bit Width attribute)
The component input that will be used to compute the output if the control
input is 1.
South edge (input, bit width 1)
The component's control input.
East edge (output, bit width matches Bit Width attribute)
The component's output, which will be floating if the control input is 0 or
floating, the error value if the control input is the error value, and will be
computed based on the west-side input if the control input is 1.

Attributes
Data Bits
The bit width of the component's inputs and outputs.

3-7. EXCLUSIVE-NOR Gates


Basically the “Exclusive-NOR” gate is a combination of the Exclusive-OR gate and the NOT gate but has a
truth table similar to the standard NOR gate in that it has an output that is normally at logic level “1” and goes
“LOW” to logic level “0” when ANY of its inputs are at logic level “1”.
However, an output “1” is only obtained if BOTH of its inputs are at the same logic level, either binary “1” or
“0”. For example, “00” or “11”. This input combination would then give us the Boolean expression
of:  Q = (A ⊕ B) = A.B + A.B
Then the output of a digital logic Exclusive-NOR gate ONLY goes “HIGH” when its two input terminals, A
and B are at the “SAME” logic level which can be either at a logic level “1” or at a logic level “0”. In other
words, an even number of logic “1’s” on its inputs gives a logic “1” at the output, otherwise is at logic level
“0”.
Then this type of gate gives and output “1” when its inputs are “logically equal” or “equivalent” to each other,
which is why an Exclusive-NOR gate is sometimes called an Equivalence Gate.
The logic symbol for an Exclusive-NOR gate is simply an Exclusive-OR gate with a circle or “inversion
bubble”, ( ο ) at its output to represent the NOT function. Then the Logic Exclusive-NOR Gate is the reverse
or “Complementary” form of the Exclusive-OR gate, (A ⊕ B) we have seen previously.

Ex-NOR Gate Equivalent

 
The Exclusive-NOR Gate, also written as: “Ex-NOR” or “XNOR”, function is achieved by combining
standard gates together to form more complex gate functions and an example of a 2-input Exclusive-NOR gate
is given below.

The Digital Logic “Ex-NOR” Gate

2-input Ex-NOR Gate

Symbol Truth Table

B A Q

0 0 1

0 1 0

1 0 0
2-input Ex-NOR Gate
1 1 1

Read if A AND B
Boolean Expression Q = A ⊕ B the SAME
gives Q

Giving the Boolean expression of:  Q = AB + AB


The logic function implemented by a 2-input Ex-NOR gate is given as “when both A AND B are the SAME”
will give an output at Q. In general, an Exclusive-NOR gate will give an output value of logic “1” ONLY
when there are an EVEN number of 1’s on the inputs to the gate (the inverse of the Ex-OR gate) except when
all its inputs are “LOW”.
Then an Ex-NOR function with more than two inputs is called an “even function” or modulo-2-sum (Mod-2-
SUM), not an Ex-NOR. This description can be expanded to apply to any number of individual inputs as
shown below for a 3-input Exclusive-NOR gate.

3-input Ex-NOR Gate

Symbol Truth Table

C B A Q

0 0 0 1

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0
3-input Ex-NOR Gate
1 0 1 1

1 1 0 1

1 1 1 0

Read as “any EVEN number of Inputs”


Boolean Expression Q = A ⊕ B ⊕ C
gives Q

 
Giving the Boolean expression of:  Q = ABC + ABC + ABC + ABC
We said previously that the Ex-NOR function is a combination of different basic logic gates Ex-OR and
a NOT gate, and by using the 2-input truth table above, we can expand the Ex-NOR function
to: Q = A ⊕ B = (A.B) + (A.B) which means we can realise this new expression using the following individual
gates.

Ex-NOR Gate Equivalent Circuit

 
One of the main disadvantages of implementing the Ex-NOR function above is that it contains three different
types logic gates the AND, NOT and finally an OR gate within its basic design. One easier way of producing
the Ex-NOR function from a single gate type is to use NAND gates as shown below.

Ex-NOR Function Realisation using NAND gates


 
Ex-NOR gates are used mainly in electronic circuits that perform arithmetic operations and data checking such
as Adders, Subtractors or Parity Checkers, etc. As the Ex-NOR gate gives an output of logic level “1”
whenever its two inputs are equal it can be used to compare the magnitude of two binary digits or numbers and
so Ex-NOR gates are used in Digital Comparator circuits.
Commonly available digital logic Exclusive-NOR gate IC’s include:
TTL Logic Ex-NOR Gates

 74LS266 Quad 2-input

CMOS Logic Ex-NOR Gates

 CD4077 Quad 2-input

74266 Quad 2-input Ex-NOR Gate

 
In the next tutorial about Digital Logic Gates, we will look at the digital Tri-state Buffer also called the non-
inverting buffer as used in both TTL and CMOS logic circuits as well as its Boolean Algebra definition and
truth table.

You might also like