0% found this document useful (0 votes)
10 views

Logic gates

IFT211-Logic gates
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Logic gates

IFT211-Logic gates
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

LOGIC GATES

MRS NANCY IPOLE-ADELAIYE


Binary Logic
• 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.
The Three Operations
• 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ʹ==z is interpreted as NOT x =z meaning that z is what x is not x
• 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 Gates
• 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.
Truth Table for AND-Gate
• 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.
Truth Table for 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.
Truth Table for NOT-Gate
• The truth table for an inverter looks like this:
• x | y -----
•0 | 1
•1 | 0
• The NOT function, as it is called, is necessary 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. Here are 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:
Truth Table for NAND-Gate
• 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 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:
Truth Table for NOR-Gate
• 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:
Truth Table for EXOR-Gate
• 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:
Truth Table for EXNOR-Gate
• 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

You might also like