Lab # 1
Lab # 1
Lab # 1
University of Karachi
MORNING PROGRAM
st st
MCS (1 Year 1 Semester) 2020
Course No 501 Fundamental of Digital Computer (2 + 1)
Roll Number: .
.
Checked by
CONTENTS Signature
EXPERIMENT-1
1-) OBJECTIVE :
To study the operation principles of basic digital logic gates AND, OR,
INVERTER, NAND, NOR and the representation of their functions by truth tables, logic
diagrams and Boolean algebra.
2-) THEORY :
In the Integrated Circuit’s (IC) inputs and outputs occur as voltage levels. These voltage
levels may be measured by some instruments and depending on the predefined voltage ranges
they are accepted as logic-1 or logic-0. The two digits in the binary system, 1 and 0, are
called bits, which is contraction of binary digit. During our experiments, any measured
voltage between 2.5 and 5.0 V will be considered as logic-1 and the voltage between –0.5 and
0.5 V will be accepted as logic-0. Due to the type of the ICs used, these ranges may vary
considering the supply voltage connected. Despite the difference in voltage levels, a basic
operation will be the same. As shown in Figure 1.1, each voltage range has an acceptable
deviation from each other by a transition region.
Volt
5.0
Tolerance allowed
Logic-1 3.75 for logic-1
2.5
Transition Region
0.5
Logic-0 0 Tolerance allowed
-0.5 for logic-0
Electronic digital circuits are also called logic circuits. Logic gates are the basic
building blocks for forming digital electronic circuitry. Logic circuits that perform the
7
Logic operations of AND, OR, NOT (Inverter), NAND and NOR are shown with their
graphics symbols, algebraic functions and truth tables in Table 1.1. Digital circuits,
switching circuits, logic circuits and logic gates are used in the same means.
Table 1.1 : Truth table, algebraic function and graphic symbol of basic 2-input logic
gates.
x y F
0 0 0
AND F F=x.y 0 1 0
y
1 0 0
1 1 1
x y F
0 0 0
x
OR F F=x+y 0 1 1
y 1 0 1
1 1 1
x F
NOT x F F=x’ 0 1
1 0
x y F
x 0 0 1
F
NAND y F=(x.y)’ 0 1 1
1 0 1
1 1 0
x y F
0 0 1
x
NOR y F F=(x+y)’ 0 1 0
1 0 0
1 1 0
8
The operation principles of basic five logic gates can be explained as follows:
2.1-) The AND Gate : The AND gate is one of the basic gates from which all functions
are constructed. It is a multi-input circuit that may have two or more than two inputs in
which the output is a logic-1 only if all inputs are logic-1. The output produces a logic-0
signal if any input is logic-0. The truth table, algebraic function (Boolean equation) and
graphic symbol of 2-input AND Gate are shown in Table 1.1.
2.2-) The OR Gate: The OR gate is another of the basic gates from which all logic
functions are constructed. It is also a multi-input circuit that may have two or more than
two inputs in which the output is a logic-1 when any of the inputs is a logic-1. Its output
becomes logic-0 if all input signals are logic-0. The truth table, algebraic function
(Boolean equation) and graphic symbol of 2-input OR Gate are shown in Table 1.1.
2.3-) The INVERTER (NOT) Gate : The inverter (NOT circuit) performs the operation
called inversion or complementation. The inverter changes one logic level to the opposite
level. In terms of bits, the output is logic-0 when input is logic-1, and the output is logic-1
when the input is logic-0. The truth table, algebraic function (Boolean equation) and
graphic symbol of an INVERTER (NOT) Gate are shown in Table 1.1.
2.4-) The NAND Gate : The NAND gate is a popular logic element because it can be used
as a universal gate; that is, NAND gates can be used in combination to perform the AND,
OR and inverter operations. The NAND gate is simply AND followed by INVERTER
gate. Therefore, NAND gate produces a logic-0 output only all inputs are logic-1. When
any of the inputs is logic-0, the output will be logic-1. The truth table, algebraic function
(Boolean equation) and graphic symbol of 2-input NAND Gate are shown in Table 1.1.
2.5-) The NOR Gate : The NOR gate, like the NAND gate, is a useful logic element
because it can also be used as a universal gate, that is, NOR gates can be used in
combination to perform the AND, OR and inverter operations. Then it is simply OR
followed by INVERTER gate. The truth table, algebraic function (Boolean equation) and
graphic symbol of 2-input NOR Gate are shown in Table 1.1.
The NAND and NOR functions are the complements of AND and OR functions,
respectively. The NAND and NOR gates are extensively used as standard logic gates.
9
2.6-) VOLTAGE TABLE : Representation for the measured voltages at the indicated
points on a logic circuit for every possible combination of the inputs.
2.7-) TRUTH TABLE : Representation of the output logic levels of a logic circuit for
every possible combination of the inputs. This is the best done by means of a systematic
tabulation. The truth tables of some logic gates are given in Table 1.1.
The basic logic gates are available as integrated circuits (ICs). The logic behaviors of
various basic IC gates are given as:
7404 Hex inverters
7408 Quadruple 2-input AND gates
7432 Quadruple 2-input OR gates
7400 Quadruple 2-input NAND gates
7402 Quadruple 2-input NOR gates
Figure 1 .3:Basic digital gates in IC packages with identification number and pin
assignments.
3-) EXPERIMENTAL PROCEDURE :
For each part of the experiment apply the indicated voltage which is given below
and make voltage measurements at the points indicated to complete the voltage tables. Use
the Cathode Ray Oscilloscope (CRO) to measure the voltage. Use CRO in a sensitivity of
1 V/div and make measurements to within 0.1 Volt.
Important Note : Apply Vcc= + 5.0 Volt is to the pin-14 and 0.0 (ground) apply to the
pin-7 for all ICs.
Pin 1 Pin 2
0 1
+5 1
Pin 1 Pin 2
0 1
1 1
1. AND Gate
The AND gate is a digital logic gate with ‘n’ i/ps one o/p, which perform logical conjunction
based on the combinations of its inputs. The output of this gate is true only when all the inputs
are true. When one or more inputs of the AND gate’s i/ps are false, then only the output of the
AND gate is false. The symbol and truth table of an AND gate with two inputs is shown
below.
2. OR Gate
The OR gate is a digital logic gate with ‘n’ i/ps and one o/p, that performs a logical
conjunction based on the combinations of its inputs.The output of the OR gate is true only
when one or more inputs are true. If all the i/ps of the gate are false, then only the output of
the OR gate is false. The symbol and truth table of an OR gate with two inputs is shown
below.
The NOT gate is a digital logic gate with one input and one output that operates an inverter
operation of the input.The output of the NOT gate is the reverse of the input. When the input
of the NOT gate is true then the output will be false and vice versa. The symbol and truth
table of a NOT gate with one input is shown below. By using this gate, we can implement
NOR and NAND gates
4.4-) Realize NAND and NOR functions using only AND, OR and INVERT gates.
Ans:
NAND gate as Universal Gate
The below diagram is of a two input NAND gate. The first part is an AND gate and second
part is a dot after it represents a NOT gate. So it is clear that during the operation of NAND
gate, the inputs are first going through AND gate and after that, the output gets reversed,
and we get the final output. Now we will look at the truth table of NAND gate.
We will consider the truth table of the above NAND gate i.e. a two-input gate. The two
inputs are A and B.
The above diagram is of an OR gate made by only using NOR gates. The output of this
gate is exactly similar to that of a single OR gate. We can see the circuit arrangement of
OR gate using, NOR gate is similar to that of AND gate using NAND gates.
4.7-) If we were to build a truth table for a 16-input AND gate, how many different
combinations of inputs would we have?
Ans: Suppose we were build a truth table for 16 input AND gate so 2 n where n =
no of inputs. Therefore 2 16 = 65536 combination of input gates.
Truth Table:
A B Á C (B.C) D ´ B( F)
A+ F
0 0 1 0 1 1
0 1 1 1 0 1
1 0 0 0 0 0
1 1 0 0 0 0