100% found this document useful (1 vote)
55 views

PHY 4308 (Logic Cct. & Lab.) Lecture Notes

This document provides lecture notes on logic circuits and laboratory for PHY 4308. It covers topics including number systems, binary codes, Boolean algebra, logic gates, digital coding, and binary operations. Conversion between decimal, binary, octal, and hexadecimal number systems are demonstrated through examples. Binary addition, subtraction using 1's and 2's complements, and representation of binary numbers as electrical signals are also discussed. Binary coded decimal code and excess-3 code are explained as methods of digital coding.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
55 views

PHY 4308 (Logic Cct. & Lab.) Lecture Notes

This document provides lecture notes on logic circuits and laboratory for PHY 4308. It covers topics including number systems, binary codes, Boolean algebra, logic gates, digital coding, and binary operations. Conversion between decimal, binary, octal, and hexadecimal number systems are demonstrated through examples. Binary addition, subtraction using 1's and 2's complements, and representation of binary numbers as electrical signals are also discussed. Binary coded decimal code and excess-3 code are explained as methods of digital coding.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

PHY 4308: Logic circuit & Laboratory

COURSE OUTLINES: Number systems: Radix of a number system, Decimal system, binary system,
octal system and Hexagonal systems, their conversions and arithmetic’s. Binary Codes: Types of
binary codes, BCD codes, 8421 BCD codes; Excess three codes, Gray codes, Alpha numeric codes.
Error detecting and correcting codes. Boolean Algebra and Logic Gates: Basics Boolean operators
such as AND operator, AND gate, AND truth table, AND law, OR gate, OR truth table, Exclusive
OR (XOR), XOR gate, OR law, NOT operator NOT gate (Inverter), NOT laws. Boolean algebraic
rules and laws. Boolean laws and rules. Systematic reduction of Boolean algebraic functions using
Boolean laws. Conversion of Boolean algebraic expression to a logic circuit diagram, logic diagram
to Boolean expression. Introduction to the Design of combinational logic circuits. Kanough Mapping:
Two, three and four variables K-map. Examples of digital systems design using practical applications
in the areas of security, control and management. Logic families: diode logic, RTL, DTL, TTL, ECL,
MOS and MOS of digital integrated circuits. Interfacing between various logic families. Concepts of
small, medium large and very large-scale integration and their consequences, some digital building
blocks.
Reference
B. L. Theraja, & Theraja, A. K. (2005). Electrical Technology (Vol. All Volumes): S. Chand and
Company LTD.
Hayakawa, H., Yoshikawa, N., Yorozu, S., & Fujimaki, A. (2004). Superconducting digital
electronics. Proceedings of the IEEE, 92(10), 1549-1563.
Jain, R. Modern Digital Electronics. disp, 1(10), 5V.
Nair, B. S. (2002). Digital electronics and logic design: PHI Learning Pvt. Ltd.

Number System: In this section, we are to revise on the number systems and conversion from one
number system to another. There are four systems of arithmetic which are often used in digital circuits.
These systems are:
➢ Decimal, it has a base (or radix) of 10 (i.e. it uses 10 different symbols to represent numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9).
➢ Binary, it has a base of 2 (i.e. it uses only two different symbols: 0 and 1).
➢ Octal, it has a base of 8 (i.e. it uses eight different symbols: 0, 1, 2, 3, 4, 5, 6, 7).

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 1
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

➢ Hexadecimal, it has a base of 16 (i.e. it uses sixteen different symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8,


9, A, B, C, D, E, F). All these systems use the same type of positional notation except that
which are often used in digital circuits (Jain).

Decimal numbers are used to represent quantities which are outside the digital system. Binary
system is extensively used by digital systems like digital computers which operate on binary
information. Octal system has certain advantages in digital work because it requires less circuitry to
get information into and out of a digital system (Nair, 2002). Moreover, it is easier to read, record and
print out octal numbers than binary numbers. Hexadecimal number system is particularly suited for
microcomputers.

Radix Conversions:

Example 1. Convert the binary number 110012 to its equivalent decimal number.

Solution: 110012 = 1 × 24 + 1 × 23 + 0 × 22 + 0 × 21 + 1 × 20 = 𝟐𝟓𝟏𝟎

Example 2. Convert the binary fraction 0.1012 into its decimal equivalent.

Solution: 0.1012 = 1 × 2−1 + 0 × 2−2 + 1 × 2−3 = 𝟎. 𝟔𝟐𝟓𝟏𝟎

Example 3. Find the decimal equivalent of the 6-bits binary number 101.1012 .

Solution: 101.1012 = 1 × 22 + 0 × 21 + 1 × 20 + 1 × 2−1 + 0 × 2−2 + 1 × 2−3 = 𝟓. 𝟔𝟐𝟓𝟏𝟎

Example 4. Convert the decimal number 2510 to its binary equivalent.

Solution:

Example 5: Convert octal 206.1048 into its decimal equivalent number.


Solution:
PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 2
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

206.1048 = 2 × 82 + 0 × 81 + 6 × 80 + 1 × 8−1 + 0 × 8−2 + 4 × 8−3 = 𝟏𝟑𝟒. 𝟏𝟑𝟐𝟖𝟏𝟐𝟓𝟏𝟎

Binary Operations: We will now consider the following four binary operations:
➢ Addition
➢ subtraction
➢ multiplication
➢ division

Addition is the most important of these four operations. In fact, by using ‘complements’, subtraction
can be reduced to addition. Most digital computers subtract by complements. It leads to reduction in
hardware because only adding type of circuits are required. Similarly, multiplication is nothing but
repeated addition and, finally, division is nothing but repeated subtraction.
Example 6: Add 1100112 𝑡𝑜 1011012 .
Solution:
110011
+
1 0 1 1 0 1 → 110011 + 101101 = 𝟏𝟏𝟎𝟎𝟎𝟎𝟎 .
2 2 𝟐
1100000

Example 7: Subtract 010112 𝑓𝑟𝑜𝑚 101102 .


Solution:
10110
− 0 1 0 1 1 → 10110 − 01011 = 𝟎𝟏𝟎𝟏𝟏 .
2 2 𝟐
01 0 1 1

Complement of a Number: In digital work, two types of complements of a binary number are used
for complemental subtraction.
➢ 1’s complement: The 1’s complement of a binary number is obtained by changing its each 0
into a 1 and each 1 into a 0. It is also called radix-minus-one complement. For example, 1’s
complement of 1002 is 0112 and of 11102 is 00012 .
➢ 2’s complements: The 2’s complement of a binary number is obtained by adding 1 to its 1’s
complement. 2’𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡 = 1’𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡 + 1. It is also known as true
complement. Suppose we are asked to find 2’s complement of 10112 . Its 1’s complement is
01002 . Next, add 1 to get 01012 . Hence, 2’s complement of 10112 is 01012 . The complement

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 3
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

method of subtraction reduces subtraction to an addition process. This method is popular in


digital computers because;
➢ Only adder circuits are needed thus simplifying the circuitry,
➢ It is easy with digital circuits to get the complements.

Representation of Binary Numbers as Electrical Signals: The two electrical signals chosen to
represent 1 and 0 must meet very rigid requirements.
➢ they must be suitable for use in high-speed circuitry,
➢ the signals should be very easy to tell apart,
➢ they must be hard to confuse with each other.
It is found that all transistor circuits distort, to some extent, the electrical signals that pass through
them. Sometime, these distorted signals can look confusingly alike. Hence, this effect of distortion or
degradation has to be kept in mind while selecting the two signals (Hayakawa et al., 2004).
In Fig. 1. are shown several signal pairs that meet the above requirements, while Fig. 2. shows how
signal pairs can be used to represent different binary numbers. It will be noted that it is impossible to
distort a positive pulse (representing 1) to look like the no pulse or negative pulse (representing 0).

Figure 1.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 4
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Figure 2.

Digital Coding: In digital logic circuits, each number or piece of information is defined by an
equivalent combination of binary digits. A complete group of these combinations which represents
numbers, letters or symbols is called a digital code. In modern digital equipment, codes are used to
represent and process numerical information. These codes enable the computers to determine whether
the information that was coded and transmitted is received correctly and, if there is an error, to correct
it (B. L. Theraja & Theraja, 2005).

Binary Coded Decimal (BCD) Code: It is a binary code in which each decimal digit is represented
by a group of four bits. Since the right-to-left weighting of the 4-bit positions is 8-4-2-1, it is also
called an 8421 code. It is a weighted numerical code. As said above, here each decimal digit from 0
through 9 requires a 4-bit binary-coded number. For example, the decimal number 5 in BCD code is
0101. The coding of some decimal digits is given in Table No. 1. Lest you think that BCD code is the
same thing as binary numbers, consider the following. In the binary system, ten is represented by 1010
but in BCD code, it is 0001 0000. Seventeen in binary is 10001 but in BCD code, it is 0001 0111.
Actually, the confusion is due to the fact that the first nine numbers in BCD and binary are exactly
similar. After that, they become quite different (Table No.1). It should be realized that with four-bits,
sixteen numbers (24) can be represented although in the BCD code only ten of these are used. The
following six combinations are invalid in the BCD code: 1010, 1011, 1100, 1101, 1110 and 1111.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 5
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

The main advantage of BCD code is that it can be read and recognized easily, although special
adders are needed for arithmetic operations. Any decimal number can be expressed in BCD code by
replacing each decimal digit by the appropriate 4-bit combination. Conversely, a BCD number can be
easily converted into a decimal number by dividing the coded number into groups of four bits (starting
with LSB) and then writing down the decimal digit represented by each four-bit group.
S/N Decimal BCD Decimal BCD
1 0 0000 26 0010 0110
2 1 0001 59 0101 1001
3 2 0010 673 0110 0111 0011
4 3 0011 2498 0010 0100 1001 1000
5 4 0100
6 5 0101
7 6 0110
8 7 0111
9 8 1000
10 9 1001

Example 8:
Typically, digital thermometers use BCD to drive their digital displays. (a) How many BCD bits are
required to drive a 3-digit thermometer display? (b) What 12 bits are sent to display for a temperature
of 157 degrees.
Solution:
(a) There are 12 BCD bits required to drive a 3-digit thermometer display because each BCD digit is
represented by a group of four bits.
(b) In order to display a temperature of 157 degrees, we have to send 12-bits. These bits can be
determined by replacing each decimal digit by its equivalent four-bit binary. Thus,
1 5 7
157 = → 15710 = 𝟎𝟎𝟎𝟏𝟎𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝐁𝐂𝐃
0001 0101 0111

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 6
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Octal Coding: It involves grouping the bits in threes. E.g.; (1756)8 = (001 111 101 110)2 .
Similarly, the 24-bits number stored in the computer memory such as;
101 010 011 100 010 111 000 110 can be read in the octal as;
101 010 011 100 010 111 000 110
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
5 2 3 4 2 7 0 6
Apart from ease of recognition and conversion to binary, one important feature of the octal code is
that its numbers are straight binary numbers which can be manipulated mathematically. For example,
octal 25 expressed in octal code is 010 101 which can be read as binary 010101.
(25)8 = 2 × 81 + 5 × 80 = (𝟐𝟏)𝟏𝟎
(010101)2 = 0 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = (𝟐𝟏)𝟏𝟎 .
You might recall that in BCD code, the resulting number is always a 4-bit group and a special adder
is needed to convert it into decimal. In octal coding, 3-bit grouping is used but the resulting binary
number can be considered a single number in natural binary form.
Hexadecimal Coding: The advantage of this coding is that four bits are expressed by a single
character. However, the disadvantage is that new symbols have to be used to represent the values from
1010 𝑡𝑜 1111 binary. The binary number 1010 0101 is hex number A5. Similarly, hexadecimal
number C7 is (11000111)2 . To prove that the resulting binary number is the same as the hexadecimal
value, consider the following example:
(3𝐷)16 = 3 × 161 + 𝐷 × 160 = 3 × 16 + 13 × 1 = (𝟔𝟏)𝟏𝟎

(3𝐷)16 = (00111101)2 = 1 × 25 + 1 × 24 + 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = (𝟔𝟏)𝟏𝟎 .

Excess-3 Code: It is an unweighted code and is a modified form of BCD. It is widely used to represent
numerical data in digital equipment. It is abbreviated as XS-3. As its name implies, each coded number
in XS-3 is three larger than in BCD code. For example, six is written as 1001. As compared to BCD,
the XS-3 has poorer recognition but it is more desirable for arithmetic operations. A few numbers
using Excess-3 code are given in Table 2.
Table 2
Decimal XS-3
3 0110

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 7
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

26 0101 1001
629 1001 0101 1100
3274 0110 0101 1010 0111

Gray Code: It is an unweighted code for numbers 0 through 9 and is largely used in mechanical
switching systems. As seen from Table No. 3, only a single bit changes between each successive word.
Because of this, the amount of switching is minimized and the reliability of the switching system is
improved.
Excess-3 Gray Code: This is the original gray code shifted by three binary combinations. It exhibits
the same properties as the Gray Code as depicted in Table No. 3.
Table No. 3
Decimal Gray Code Excess-3 Gray Code
0 0000 0010
1 0001 0110
2 0010 0111
3 0011 0100
4 0110 0100
5 0111 1100
6 0101 1101
7 0100 1111
8 1100 1110
9 1101 1010

Example 9: Express the number 4310 in XS-3 code.


Solution: Let us first represent each decimal digit by its 4-bit XS-3 code.
4 = 0111, 3 = 0110 ∴ 4310 = 𝟎𝟏𝟏𝟏𝟎𝟏𝟏𝟎𝐗𝐒−𝟑

Example 10: The number 0110 1001 is expressed in XS-3 code. What is its decimal value?
Solution: Starting from least significant bit (LSB), the given number is first separated into groups
of four and then each group is replaced by its equivalent value i.e. actual value decreased by 3.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 8
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

0110 = 6 − 3 = 3; 1001 = 9– 3 = 6 ∴ 01101001𝐗𝐒−𝟑 = (𝟑𝟔)𝟏𝟎 .


ASCII Code:
The ASCII code (Pronounced “askee) is a seven-bit code, and so it has 27 (= 128) possible code
groups. This is more than enough to represent all of the standard keyboard characters as well as control
functions such as the (RETURN) and LINEFEED) functions.

Logic Gate:
A logic gate is an electronic circuit which makes logic decisions. It has one output and one or
more inputs. The output signal appears only for certain combinations of input signals. Logic gates
are the basic building blocks from which most of the digital systems are built up. They implement the
hardware logic function based on the logical algebra developed by George Boole which is called
Boolean algebra. These gates are available today in the form of various IC families. The most popular
families are:

➢ Transistor-transistor logic (TTL),


➢ Emitter-coupled logic (ECL),
➢ Metal-oxide-semiconductor (MOS)
➢ Complementary metal-oxide-semiconductor (CMOS).

In this section, we will consider the OR, AND, NOT, NOR, NAND, exclusive OR (XOR) and exclusive
NOR (XNOR) gates along with their truth tables.

Positive and Negative Logic: In computing systems, the number symbols 0 and 1 represent two
possible states of a circuit or device. It makes no difference if these two states are referred to as ON
and OFF, CLOSED and OPEN, HIGH and LOW PLUS and MINUS or TRUE and FALSE depending
on the circumstances. Main point is that they must be symbolized by two opposite conditions. In
positive logic, a 1 represents:

1. an ON circuit,
2. a CLOSED switch,
3. a HIGH voltage,
4. a PLUS sign,
5. a TRUE statement. Consequently, a 0 represents:

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 9
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

1. an OFF circuit,
2. an OPEN switch,
3. a LOW voltage,
4. a MINUS sign,
5. a FALSE statement. In negative logic, just opposite conditions prevail.

Suppose, a digital system has two voltage levels of 0V and 5V. If we say that symbol 1 stands for
5V and symbol 0 for 0V, then we have positive logic system. If, on other hand, we decide that a 1
should represent 0 V and 0 should represent 5V, then we will get negative logic system.
Main point is that in positive logic, the more positive of the two voltage levels represents the 1
while in negative logic, the more negative voltage represents the 1.
The OR Gate: The electronic symbol for a two-input OR gate is shown in Fig. 3 (a) and its equivalent
switching circuit in Fig. 3 (b). The two inputs have been marked as A and B and the output as X. It is
worth reminding the reader that as per Boolean algebra, the three variables A, B and X can have only
one of the two values i.e. either 0 or 1.
Logic Operation: The OR gate has an output of 1 when either A or B or both are 1 In other words, it
is an any-or-all gate because an output occurs when any or all the inputs are present.

Figure 3: The electronic symbol for a two-input OR gate and its equivalent switching circuit.

The lamp will light up (logic 1) when either switch A or B or both are closed (Fig. 3b). Obviously, the
output would be 0 if and only if both its inputs are 0. The OR gate represents the Boolean Equation A
+ B = X. The meaning of this equation is that X is true when either A is true or B is true or both are
true. Alternatively, it means that output X is 1 when either A or B or both are 1.
The above logic operation of the OR gate can be summarized with the help of the truth table given
in table 4. A truth table may be defined as a table which gives the output state for all possible input
PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 10
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

combinations. The OR Table 4 gives outputs for all possible A B inputs of 00, 01, 10 and 11. An OR
gate is equivalent to a parallel circuit in its logic function. Another point worth remembering is that
the above OR gate is called inclusive OR gate because it includes the case when both inputs are true.

Table 4: OR Truth table

A B X

0 0 0

0 1 1

1 0 1

1 1 1

Equivalent Relay Circuit of an OR Gate: In Fig. 4, the relay contacts have been wired in parallel.
When +5V is applied to A, relay 𝐾1 is energized and pulls M down thereby closing the contact. Hence,
supply voltage of +5V appears at the output X. Similarly, when +5V are applied to input B, 𝐾2 is
energized and pulls N down thereby bringing X in contact with S. Of course, when both A and B are
at +5V, X is at +5V. Incidentally, when inputs at A and B are 0, X is also 0.

Figure 4: Equivalent Relay Circuit of an OR Gate.


PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 11
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Diode OR Gate: Fig. 5. shows the diode OR gate consisting of two ideal diodes D1 and D2
connected in parallel across the output X.
1. When A is at +5𝑉, D1 is forward-biased and hence conducts. The circuit current flows via R
dropping 5𝑉 across it. In this way, point X achieves potential of +5𝑉.
2. When +5𝑉 is applied to B, D2 conducts causing point X to go to +5𝑉.
3. When both A and B are +5𝑉, the drop across R is 5𝑉 because voltages of A and B are in parallel.
Again, point X is driven to +5𝑉.
4. Obviously, when there is no voltage either at A or B, output X remains 0.

Figure 5: Equivalent circuit of Diode or Gate

Transistor OR Gate: Fig. 6, illustrates a possible transistor OR gate consisting of three interconnected
transistors Q1 , Q2 and Q3 supplied from a common supply VCC = +5V.
1. When +5𝑉 is applied to A, Q1 is forward-biased and so it conducts. Assuming that Q1 is saturated,
entire VCC = 5V drops across R1 thus causing N to go to ground. This, in turn, cuts off Q3 thereby
causing X to go to VCC i. e. + 5V.
2. When +5𝑉 is applied to B, Q2 conducts thereby driving N to ground i.e. 0V. With no forward
bias on its base, Q3 is cut-off thus driving X again to VCC i. e. + 5V.
3. If both inputs A and B are grounded, Q1 and Q2 are cut-off driving N to +5𝑉. As a result, Q3
becomes forward-biased and conducts fully. In that case, entire VCC drops across R 2 driving M
and hence X to ground.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 12
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Figure 6:

The AND Gate:


The electronic (or logic) symbol for a 2-input AND gate is shown in Fig. 7 (a) and its equivalent
switching circuit in Fig. 7 (b). It is worth reminding the readers once again that the three variables A,
B, C can have a value of either 0 or 1.

Figure 7: The logic symbol for a 2-input AND gate and its equivalent switching circuit.

Logic Operation:
1. The AND gate gives an output only when all its inputs are present.
2. The AND gate has a 1 output when both A and B are 1. Hence, this gate is an all-or-nothing gate
whose output occurs only when all its inputs are present.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 13
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

3. In True/False terminology, the output of an AND gate will be true only if all its inputs are true. Its
output would be false if any of its inputs is false. The AND gate works on the Boolean algebra:
𝐴 × 𝐵 = 𝑋 or 𝐴 . 𝐵 = 𝑋 or 𝐴 𝐵 = 𝑋.
It is a logical multiplication and is different from the arithmetic multiplication. Often the sign ‘ × ’ is
replaced by a dot which itself is generally omitted as shown above. The logical meaning of the above
equation is that:
1. Output X is 1 only when both A and B are 1.
2. Output X is true only when both A and B are true.
As seen from Fig. 7 (b), the lamp would be ON when both switches A and B are closed. Even when
one switch is open, the lamp would be OFF. Obviously, an AND gate is equivalent to a series
switching circuit.

Table 5: Shows truth table for a 2-input and a 3-input AND gate. As seen, X is at logic 1 only when
all inputs are at logic 1, not otherwise.

Table 5: The truth table for a 2-input and a 3-input AND gate

(a)

(b)

The NOT Gate:


It is so called because its output is NOT the same as its input. It is also called an inverter because it
inverts the input signal. It has one input and one output as shown in Fig. 8 (a). All it does is to invert

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 14
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

(or complement) the input as seen from its truth table of Fig. 8 (b). The schematic symbol for inversion
is a small circle as shown in Fig. 8 (a). The logical symbol for inversion or negation or
complementation is a bar over the function to indicate the opposite state. Sometimes, a prime is also
̅̅̅̅̅̅̅̅̅̅
used as A′. For example, 𝐴̅ means not-A. Similarly, (𝐴 + 𝐵) means the complement of (A + B).

Figure 8: The schematic symbol, the logical symbol and the truth table for one input NOT gate

Equivalent Circuits for a NOT Gate:


The relay circuit of Fig. 9 (a) is a physical realization of the complementation operation of the Boolean
algebra. When +5 V is applied to input A, K is energized and opens the normally closed contact
thereby driving output X to 0 V. Of course, when A is at 0V, X has the supply voltage of +5 V applied
to it because the relay contact is normally closed. In the equivalent transistor circuit of Fig. 9 (b) when
+5V is applied to A, the transistor will be fully turned ON, drawing maximum collector current. Hence,
whole of 𝑉𝐶𝐶 = 5𝑉 will drop across R thereby sending X to 0 V. With 0 V applied at A, the transistor
will be cut OFF and the output X, therefore, will go to 𝑉𝐶𝐶 𝑖. 𝑒. +5𝑉. Obviously, in each case, output
is the opposite of input.

Figure 9: The relay circuit of NOT gate.


PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 15
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

The NOT Operation: It is a complementation operation and its symbol is an overbar. It can be defined
as under: 0̅ means taking the negation or complement of 0 which is 1. 0̅ = 1, 1̅ = 0
It should also be noted that complement of a value can be taken repeatedly. For example; 1̿ = 0̅ =
1 𝑜𝑟 0̿ = 1̅ = 0.

Laws of Boolean Algebra:


Boolean algebra is a system of mathematics based on logic. It has its own set of fundamental laws
which are necessary for manipulating different Boolean expressions
1. OR Laws: there are four basic OR-Laws as:

Figure 1: OR-Laws
➢ Law 1. 𝐴 + 0 = 𝐴
➢ Law 2. 𝐴 + 1 = 1
➢ Law 3. 𝐴 + 𝐴 = 𝐴
➢ Law 4. 𝐴 + 𝐴̅ = 1.
The expression given in Law 4 can be understood with the help of Fig. 1. Consider the following two
possibilities:
(a) When 𝐴 = 0, then 𝐴̅ = 1, ∴ 𝐴 + 𝐴̅ = 0 + 1 = 1.
(b) When 𝐴 = 1, then 𝐴̅ = 0, ∴ 𝐴 + 𝐴̅ = 0 + 1 = 1.

2. AND Laws:

Figure 2: AND-Laws
➢ Law 5. 𝐴. 0 = 0
PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 16
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

➢ Law 6. 𝐴. 1 = 𝐴
➢ Law 7. 𝐴. 𝐴 = 𝐴
➢ Law 8. 𝐴. 𝐴̅ = 0.
The expression for Law 8 can be easily understood with the help of the logic circuit of Fig. 2.
Consider the following two possibilities;
(c) When 𝐴 = 0, then 𝐴̅ = 1, ∴ 𝐴. 𝐴̅ = 0.1 = 0.
(d) When 𝐴 = 1, then 𝐴̅ = 0, ∴ 𝐴. 𝐴̅ = 1.0 = 0.
3. Laws of Complementation:
➢ Law 9: 0̅ = 1
➢ Law 10: 1̅ = 0
➢ Law 11: If 𝐴 = 0, then 𝐴̅ = 1
➢ Law 12: If 𝐴 = 1, then 𝐴̅ = 0
➢ Law 13: 𝐴 = 0.
4. Commutative Laws: These laws allow change in the position of variables in OR and AND
expressions.
➢ Law 14: 𝐴 + 𝐵 = 𝐵 + 𝐴
➢ Law 15: 𝐴. 𝐵 = 𝐵. 𝐴
These two laws express the fact that the order in which a combination of terms is performed
does not affect the final result of the combination.
5. Associative Laws: These laws allow removal of brackets from logical expression and
regrouping of variables.
➢ Law 16: 𝐴 + (𝐵 + 𝐶) = (𝐴 + 𝐵) + 𝐶
➢ Law 17: (𝐴 + 𝐵) + (𝐶 + 𝐷) = 𝐴 + 𝐵 + 𝐶 + 𝐷
➢ Law 18: 𝐴 . (𝐵 . 𝐶) = (𝐴 . 𝐵) . 𝐶
6. Distributive laws: These laws permit factoring or multiplying out of an expression.
➢ Law 19: 𝐴(𝐵 + 𝐶) = 𝐴𝐵 + 𝐴𝐶
➢ Law 20: 𝐴 + 𝐵𝐶 = (𝐴 + 𝐵)(𝐴 + 𝐶)
➢ Law 21: 𝐴 + 𝐴. 𝐵 = 𝐴 + 𝐵
7. Absorptive Laws: These enable us to reduce a complicated logic expression to a simpler form
by absorbing some of the terms into existing terms.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 17
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

➢ Law 22: 𝐴 + 𝐴𝐵 = 𝐴
➢ Law 23: 𝐴. (𝐴 + 𝐵) = 𝐴
➢ Law 24: 𝐴. (𝐴̅ + 𝐵) = 𝐴𝐵
The above laws can be used to prove any given Boolean identity and also for simplifying
complicated expressions.

Example 11: Find the Boolean equation for the output X of Fig. 10. Evaluate X when (i) 𝐴 = 0,
𝐵 = 1, 𝐶 = 1 (ii) 𝐴 = 1, 𝐵 = 1, 𝐶 = 1.

Figure 10.

Solution: The output of the AND gate is AB. It then becomes one of the inputs for the 2 input OR
gate. When AB is ORed with C, we get (AB+ C). ∴ 𝑋 = 𝐴𝐵 + 𝐶.

(𝑖) X = 0.1 + 1 = 0 + 1 = 𝟏.
(𝑖𝑖) X = 1.1 + 1 = 1 + 1 = 𝟏.

Figure 11.

Example 12: Find the Boolean expression for the output of Fig. 12 and evaluate it when (i) A = 0, B
= 1, C = 1, (ii) A = 1, B = 1, C = 0.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 18
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Figure 12.

Solution: The output of the OR gate is (A + B). Afterwards, it becomes the input of the AND gate.
When ANDed with C, it becomes (𝐴 + 𝐵). 𝐶.
∴ 𝑋 = (𝐴 + 𝐵). 𝐶 → (i)𝑋 = (0 + 1). 1 = 1.1 = 𝟏.
(ii) 𝑋 = (1 + 1).0 = 1.0 = 𝟎.

Figure 13.

Example 13: Find the Boolean expression for the output of Fig. 14 and compute its value when
A = B = C = 1 and D = 0.

Figure 14.
Solution: The circuit is made up of three AND gates. Obviously, it is equivalent to a single 4-input
AND gate i.e. an AND gate with a fan-in of four. Output of the first gate is AB, that of the second is
ABC and that of the third is ABCD. Hence, final output is X = ABCD. Substituting the given values,
we get;
X = 1.1.1.0 = 1.1.0 = 1.0 = 𝟎.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 19
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Example 14: Find the Boolean expression for the output X of Fig. 15 and compute its value when (i)
A = 0, B = 1 (ii) A = 1, B = 0.

Figure 15.
Solution: As seen, one of the inputs to the OR gate is inverted i.e. A becomes 𝐴̅ as shown in Fig. 16.
Hence, output is given by 𝑋 = 𝐴̅ + 𝐵.
(𝑖) X = 0̅ + 1 = 1 + 1 = 𝟏.
(𝑖𝑖) X = 1̅ + 0 = 0 + 0 = 𝟎.

Figure 16.

Example 15: What is the Boolean expression for the output X of Fig. 17? Compute the value of X
when (𝑖) 𝐴 = 0, 𝐵 = 0 (𝑖𝑖) 𝐴 = 1, 𝐵 = 1.

Figure 17.

Solution: As seen, in this case, both inputs to the OR gate have been inverted. Hence as shown
in Fig.18, the inputs become 𝐴̅ and 𝐵̅. Therefore, Boolean expression for the output becomes 𝑋 =
𝐴̅ + 𝐵̅. (𝑖) 𝑋 = 0̅ + 0̅ = 1 + 1 = 1. (𝑖𝑖) 𝑋 = 1̅ + 1̅ = 0 + 0 = 𝟎.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 20
(PhD)
PHY 4308: Logic Circuit & Laboratory, Lecture notes prepared by Nura Liman Chiromawa (PhD)

Figure 18.

Example 16: Write down the Boolean equation for the output X of Fig. 19 (a). Compute its value
when (i) A = 0, B = 0 (ii) A = 0, B = 1 (iii) A = 1, B = 0 (i) A = 1, B = 1.

Figure 19.

Solution: As seen, inputs to the AND gate are A and B Fig. 20. The output of the AND gate is A.B.
However, this output is inverted by the second inverter connected in the output. Hence, final output
̅ B.
equation is X = A

Figure 20.

(𝑖) 𝑋 = ̅̅̅̅̅
0̅. 0 = 1.0
̅̅̅̅ = 0̅ = 𝟏 (𝑖𝑖) 𝑋 = ̅̅̅̅̅ ̅̅̅̅ = 1̅ = 𝟎 (𝑖𝑖𝑖) 𝑋 = ̅̅̅̅̅
0̅. 1 = 1.1 1̅. 0 = ̅̅̅̅
0.0 = 0̅ = 𝟏
(𝑖𝑣) 𝑋 = ̅̅̅̅̅
1̅. 1 = 0.1
̅̅̅̅ = 0̅ = 𝟏.
While evaluating expressions of the above type, you must remember the following two points:
1. take the NOT i.e. inversion of the individual term first.
2. When a NOT or inversion is applied to more than one term (like 1.0), you should work out the
OR (or AND) operation first and then take the NOT of the result so obtained.

PHY 4308: Logic Circuit & Lab, Lecture notes prepared by Nura Liman Chiromawa 21
(PhD)

You might also like