Digital Computer Fundamentals( Unit-II)
Digital Computer Fundamentals( Unit-II)
______________________________________________
UNIT – II
Digital Circuits - Logic Gates
Digital electronic circuits operate with voltages of two logic levels namely Logic Low and
Logic High.
The range of voltages corresponding to Logic Low is represented with ‘0’. Similarly, the range
of voltages corresponding to Logic High is represented with ‘1’.
The basic digital electronic circuit that has one or more inputs and single output is known
as Logic gate.
Hence, the Logic gates are the building blocks of any digital system. We can classify these
Logic gates into the following three categories.
Basic gates
Universal gates
Special gates
Now, let us discuss about the Logic gates come under each category one by one.
Basic Gates
AND gate
An AND gate is a digital circuit that has two or more inputs and produces an output, which is
the logical AND of all those inputs.
1
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
The following table shows the truth table of 2-input AND gate.
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
Here A, B are the inputs and Y is the output of two input AND gate.
If both inputs are ‘1’, then only the output, Y is ‘1’. For remaining combinations of inputs, the
output, Y is ‘0’.
The following figure shows the symbol of an AND gate, which is having two inputs A, B and
one output, Y.
OR gate
An OR gate is a digital circuit that has two or more inputs and produces an output, which is the
logical OR of all those inputs.
2
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
A B Y=A+B
0 0 0
0 1 1
1 0 1
1 1 1
Here A, B are the inputs and Y is the output of two input OR gate.
If both inputs are ‘0’, then only the output, Y is ‘0’. For remaining combinations of inputs, the
output, Y is ‘1’.
The following figure shows the symbol of an OR gate, which is having two inputs A, B and one
output, Y.
NOT gate
A NOT gate is a digital circuit that has single input and single output. The output of NOT gate
is the logical inversion of input. Hence, the NOT gate is also called as inverter.
A Y = A’
0 1
1 0
3
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
If the input, A is ‘0’, then the output, Y is ‘1’. Similarly, if the input, A is ‘1’, then the output, Y
is ‘0’.
The following figure shows the symbol of NOT gate, which is having one input, A and one
output, Y.
This NOT gate produces an output YY, which is the complement of input, A.
Universal gates
NAND gate
NAND gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical AND of all those inputs.
The following table shows the truth table of 2-input NAND gate.
A B Y = (A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
Here A, B are the inputs and Y is the output of two input NAND gate.
4
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
When both inputs are ‘1’, the output, Y is ‘0’. If at least one of the input is zero, then the output,
Y is ‘1’.
The following image shows the symbol of NAND gate, which is having two inputs A, B and
one output, Y.
NAND gate operation is same as that of AND gate followed by an inverter. That’s why the
NAND gate symbol is represented like that.
NOR gate
NOR gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical OR of all those inputs.
The following table shows the truth table of 2-input NOR gate
A B Y = (A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
Here A, B are the inputs and Y is the output. If both inputs are ‘0’, then the output, Y is ‘1’.
5
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
If at least one of the input is ‘1’, then the output, Y is ‘0’. This is just opposite to that of two
input OR gate operation.
The following figure shows the symbol of NOR gate, which is having two inputs A, B and one
output, Y.
NOR gate operation is same as that of OR gate followed by an inverter. That’s why the NOR
gate symbol is represented like that.
Special Gates
Ex-OR & Ex-NOR gates are called as special gates. Because, these two gates are special cases
of OR & NOR gates.
Ex-OR gate
The full form of Ex-OR gate is Exclusive-OR gate. Its function is same as that of OR gate
except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-OR gate.
A B Y = A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
6
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Here A, B are the inputs and Y is the output of two input Ex-OR gate.
The truth table of Ex-OR gate is same as that of OR gate for first three rows. The only
modification is in the fourth row. That means, the output YY is zero instead of one, when both
the inputs are one, since the inputs having even number of ones.
Therefore, the output of Ex-OR gate is ‘1’, when only one of the two inputs is ‘1’. And it is
zero, when both inputs are same.
Below figure shows the symbol of Ex-OR gate, which is having two inputs A, B and one
output, Y.
Ex-OR gate operation is similar to that of OR gate, except for few combinations of inputs.
That’s why the Ex-OR gate symbol is represented like that. The output of Ex-OR gate is ‘1’,
when odd number of ones present at the inputs. Hence, the output of Ex-OR gate is also called
as an odd function.
Ex-NOR gate
The full form of Ex-NOR gate is Exclusive-NOR gate. Its function is same as that of NOR gate
except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-NOR gate.
A B Y = A⊙B
0 0 1
0 1 0
1 0 0
1 1 1
7
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Here A, B are the inputs and Y is the output. The truth table of Ex-NOR gate is same as that of
NOR gate for first three rows. The only modification is in the fourth row. That means, the
output is one instead of zero, when both the inputs are one.
Therefore, the output of Ex-NOR gate is ‘1’, when both inputs are same. And it is zero, when
both the inputs are different.
The following figure shows the symbol of Ex-NOR gate, which is having two inputs A, B and
one output, Y.
Ex-NOR gate operation is similar to that of NOR gate, except for few combinationss of inputs.
That’s why the Ex-NOR gate symbol is represented like that. The output of Ex-NOR gate is ‘1’,
when even number of ones present at the inputs. Hence, the output of Ex-NOR gate is also
called as an even function.
From the above truth tables of Ex-OR & Ex-NOR logic gates, we can easily notice that the Ex-
NOR operation is just the logical inversion of Ex-OR operation.
Positive Logic
In positive logic representation Bit 1 represents Logic high and Bit 0 represent a Logic low as
shown in fig 2 a and b.
8
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Negative Logic
In Negative logic representation Bit 1 represents logic low and Bit 0 represents logic high as
shown in Fig 3 a and b.
In terms of voltage level, bit 1 can be represented as +5V and bit 0 can be represented as 0 V or -
5 Volts
9
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Integrated Circuit
An integrated circuit is electronic circuit or device that has electronic components on a small
semiconductor chip.
It has functionality of logic AND or amplifying of a signal. These are mainly two types of
circuits: Digital or Analog.
Analog ICs handle continuous signals such as audio signals and Digital ICs handle discrete
signals such as binary values.
Digital Integrated Circuits handle discrete signals such as binary values (0 and 1).
These circuits use digital logic gates, multiplexers, flip flops etc.These circuits are easier
to design and economical.
Analog Integrated Circuits handle contiguous signals. These are two types: linear
integrated circuits (Linear ICs) and Radio frequency integrated circuits (RF ICs).
Mixed Integrated Circuits are obtained by the combination of analog and digital
integrated circuits. Therefore it have analog to digital (A/D) converter, digital to analog
(D/A) converter, and clock/timing integrated circuits.
Basic Boolean functions such as AND, OR, and NOT are essential in building functionality for
modern digital systems.
10
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
These Boolean functions are implemented using transistors. A transistor is a semiconductor
device( conduct electricity under some conditions) used to amplify or switch electronic signals
and electrical power.
For example, internal transistor structure of a NAND gate is given in following figure.
There might ten billion or more transistors in modern digital circuit. So, we need Integrated
Circuits (ICs) that combine a small or large number of these transistors to achieve particular
functionality. These circuits provide benefiting students, very low cost and higher level of
reliability.
Boolean Algebra
Algebra is a branch of mathematics dealing with symbols and the rules for manipulating those
symbols.
Boolean algebra is the category of algebra in which the variable’s values are the truth
values, true and false, ordinarily denoted 1 and 0 respectively.
It is used to analyze and simplify digital circuits. It is also called as Binary Algebra or logical
Algebra.
11
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
It has been fundamental in the development of digital electronics and is provided for in all
modern programming languages.
The important operations performed in boolean algebra are – conjunction (∧), disjunction (∨)
and negation (¬).
Hence, this algebra is far way different from elementary algebra where the values of variables
are numerical and arithmetic operations like addition, subtraction is been performed on them.
Disjunction or OR operation
Below is the table defining the symbols for all three basic operations.
OR + (or) ∨ Lowest
Suppose A and B are two boolean variables, then we can define the three operations as;
12
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
A conjunction B or A AND B , satisfies A ∧ B = True, if A = B = True or else A ∧ B
= False.
A B A∧B A∨B
A ¬A
True False
False True
Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.
13
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
OR-ing of the variables is represented by a plus (+) sign between them. For example OR-
ing of A, B, C is represented as A + B + C.
Logical AND-ing of the two or more variable is represented by writing a dot between
them such as A.B.C. Sometimes the dot may be omitted like ABC.
Commutative law
Associative law
Distributive law
AND law
OR law
Inversion law
Commutative Law
Any binary operation which satisfies the following expression is referred to as a commutative
operation. Commutative law states that changing the sequence of the variables does not have
any effect on the output of a logic circuit.
A. B = B. A
A+B=B+A
14
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Associative Law
It states that the order in which the logic operations are performed is irrelevant as their effect is
the same.
( A. B ). C = A . ( B . C )
( A + B ) + C = A + ( B + C)
Distributive Law
Distributive law states the following conditions:
A. ( B + C) = (A. B) + (A. C)
A + (B. C) = (A + B) . ( A + C)
AND Law
These laws use the AND operation. Therefore they are called AND laws.
A .0 = 0
A.1=A
A. A = A
A.A¯=0
15
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
OR Law
These laws use the OR operation. Therefore they are called OR laws.
A +0=A
A+1=1
A+A=A
A+A¯=1
Inversion Law
This law uses the NOT operation. The inversion law states that double inversion of variable
results in the original variable itself.
A+A¯¯=1
Boolean Function
Boolean algebra deals with binary variables and logic operation. A Boolean Function is
described by an algebraic expression called Boolean expression which consists of binary
variables, the constants 0 and 1, and the logic operation symbols. Consider the following
example.
Here the left side of the equation represents the output Y. So we can state equation no. 1
16
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Truth Table Formation
A truth table represents a table having all combinations of inputs and their corresponding result.
It is possible to convert the switching equation into a truth table. For example, consider the
following switching equation.
The output will be high (1) if A = 1 or BC = 1 or both are 1. The truth table for this equation is
shown by Table (a). The number of rows in the truth table is 2 n where n is the number of input
variables (n=3 for the given equation). Hence there are 2 3 = 8 possible input combination of
inputs.
Literal
A Literal signifies the Boolean variables including their complements. Such as B is a boolean
variable and its complements are ~B or B', which are the literals.
17
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Minterm
The product of all literals, either with complement or without complement, is known
as minterm.
Example
1. A.B
2. A.~B
3. ~A.B
The complement variables ~A and ~B can also be written as A' and B' respectively. Thus, we can
write the minterm as:
1. A.B'
2. A'.B
1. If the variable value is 1, we will take the variable without its complement.
2. If the variable value is 0, take its complement.
Example
Let's assume that we have three Boolean variables A, B, and C having values
A=1
B=0
C=0
18
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Now, we will take the complement of the variables B and C because these values are 0 and will
take A without complement. So, the minterm will be:
Minterm=A.B'C'
Let's take another example in which we have two variables B and C having the value
B=0
C=1
Minterm=B'C
o In the first step, we will write the term consisting of all the variables
o Next, we will write 0 in place of all the complement variables such as ~A or A'.
o We will write 1 in place of all the non-complement variables such as A or b.
o Now, we will find the decimal number of the binary formed from the above steps.
o In the end, we will write the decimal number as a subscript of letter m(minterm). Let's
take some example to understand the theory of shorthand notation
______________________________________________
o We will write 1 in place of non-complement variable A.
Minterm = 10
o The binary number of the minterm AB' is 10. The decimal point number of (10) 2 is 2. So,
the shorthand notation of AB' is
Minterm = m2
Maxterm
The sum of all literals, either with complement or without complement, is known as maxterm.
Example:
1. A+B
2. A+~B
3. ~A+B
We know that the complement variables ~A and ~B can be written as A' and B' respectively. So,
the above maxterm can be written as
20
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
1. A+B'
2. A'+B
1. If the variable value is 1, then we will take the variable without a complement.
Example
Let's assume that we have three Boolean variables A, B., and C having values
A=1
B=0
C=0
Now, we will take the complement of the variables B and C because these values are 0 and will
take A without complement. So, the maxterm will be:
Maxterm=A+B'+C'
Let's take another example in which we have two variables B and C having the value
B=0
C=1
Maxterm=B'+C
o In the first step, we will write the term consisting of all the variables
21
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
o Next, we will write 0 in place of all the complement variables such as ~A or A'.
o We will write 1 in place of all the non-complement variables such as A or b.
o Now, we will find the decimal number of the binary formed from the above steps.
o In the end, we will write the decimal number as a subscript of letter Here, M denotes
maxterm.
Maxterm = A+B'
Maxterm = A+B'+C'
A+B'+C' is M4.
22
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
De Morgan's Theorems
De Morgan has suggested two theorems which are extremely useful in Boolean Algebra. The
two theorems are discussed below.
Theorem 1
The left hand side (LHS) of this theorem represents a NAND gate with inputs A and B,
whereas the right hand side (RHS) of the theorem represents an OR gate with inverted
inputs.
23
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Theorem 2
The LHS of this theorem represents a NOR gate with inputs A and B, whereas the RHS
represents an AND gate with inverted inputs.
24
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Universal Building Blocks (UBB)
They are called as “Universal Gates” because-
1. NAND Gate
A NAND Gate is constructed by connecting a NOT Gate at the output terminal of the AND
Gate.
The output of NAND gate is high (‘1’) if at least one of its inputs is low (‘0’).
The output of NAND gate is low (‘0’) if all of its inputs are high (‘1’).
Logic Symbol-
25
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Truth Table-
A B Y = (A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
Timing Diagram-
26
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
2. NOR Gate
A NOR Gate is constructed by connecting a NOT Gate at the output terminal of the OR Gate.
The output of OR gate is high (‘1’) if all of its inputs are low (‘0’).
The output of OR gate is low (‘0’) if any of its inputs is high (‘1’).
Logic Symbol-
The logic symbol for NOR Gate is as shown below-
Truth Table-
The truth table for NOR Gate is as shown below-
A B Y=A+B
0 0 1
0 1 0
1 0 0
1 1 0
27
III- BCA Digital Computer Fundamentals Unit-II
______________________________________________
Timing Diagram-
+++++++++++++++++++++++++++++++++++++++++++
28