Digital Logic Syllabus and Paper
Digital Logic Syllabus and Paper
Pokhara University
Faculty of Science and Technology
1. Course Description
This course covers the various concepts of digital logic systems. This course emphasizes on
fundamental concept, principles and properties of Boolean algebra and its application in
simplification, circuit analysis and gate implementation. It covers the use of flip flops in the design
of synchronous and asynchronous sequential logic circuits. It also covers the ALU design.
2. General Objective
The main objectives of the course are
• To provide basic knowledge of logic systems.
• To introduce the basic tools to design various digital logic circuits.
• To design a basic digital computer.
3. Methods of Instruction
• Lecture
• Tutorial
• Laboratory work
4. Contents in Detail
2.1.3 Octal
2.1.4 Hexadecimal
• To trace the simplification Unit 3 : Boolean Algebra and Logic Gates ( 4 hrs)
process using Boolean
Algebra. 3.1 Boolean algebra (definition, properties, postulates and
• To implement the simplified theorems)
functions using logic gates.
3.2 Logic gates, truth tables and Boolean function
8. 3 Asynchronous counters
• Describe about read and write Unit 9 : Memory Unit and ALU (6hrs)
operation in RAM.
• Design arithmetic circuit and 9.1 Random access memory
logic unit.
9.2 Design of arithmetic logic unit
• Describe about the processor
unit and its diagram. 9.3 Accumulator
9.4 Shifter and status register
Note: The figures in the parentheses indicate the approximate periods for the respective units.
5. Laboratory work:
• Familiarization with logic gates.
• Familiarization with Boolean functions.
• Design of simple combinational circuits.
• Adder and subtractor
• Encoder and decoder
• Multiplexer and demultiplexer
• Design of flip flops.
• Registers and counters
Internal Evaluation
In addition to the formal exam(s), the internal evaluation of a student may consist of quizzes,
assignments, lab reports, projects, class participation, etc. The tabular presentation of the internal
evaluation is as follows. The components may differ according to the nature of the subject.
Student Responsibilities:
Each student must secure at least 45% marks in internal evaluation with 80% attendance in the class in
order to appear in the Semester End Examination. Failing to get such score will be given NOT
QUILIFIED (NQ) and the student will not be eligible to appear the End-Term examinations. Students
are advised to attend all the classes and complete all the assignments within the specified time period. If
a student does not attend the class(es), it is his/her sole responsibility to cover the topic(s) taught during
the period. If a student fails to attend a formal exam, quiz, test, etc. there won’t be any provision for re-
exam.
Text Book
1. M. Morris Mano, Digital Logic and Computer Design Pearson India, 2017.
Reference Books
1. M. Rafiquzzaman, Steven A. McNinch, Digital Logic, John Wiley and Sons, 2019.
2. M. Morris Mano, Digital Design, Prentice Hall of India, 1998.
Introduction Unit 1
A signal is an electromagnetic or electrical current that carries data from one system or network to
another. In electronics, a signal is often a time-varying voltage that is also an electromagnetic wave
carrying information, though it can take on other forms such as current. There are two main types
of signals used in electronics: analog and digital signals.
1 Analog Signal
An analog signal is time-varying and generally bound to a range(e.g. +12V to -12V), but there is
an infinite number of values within that continuous range. An analog signal uses a given property
of the medium to convey the signal’s information, such as electricity moving through a wire. In an
electrical signal, the voltage, current, or frequency of the signal may be varied to represent the
information. Analog signals are often calculated responses to changes in light, sound, temperature,
position, pressure, or other physical phenomena. When plotted on a voltage vs time graph, an
analog signal produces a continuous curve. There should not be any discrete value changes as
shown in figure 1.
2 Digital Signal
A digital signal is a signal that represents data as a sequence of discrete values. A digital signal
can only take on one value from a finite set of possible values at a given time. With digital signals,
the physical quantity representing the information can be many things:
3 Digital System
A digital system is an interconnection of digital modules and it is a system that manipulates discrete
elements of information that are represented internally in binary form. Now a day’s digital systems
are used in a wide variety of industrial and consumer products such as automated industrial
machinery, pocket calculators’ microprocessors, digital computers, digital watches, TV games,
and signal processing, and so on.
4 Analog System
Analog system process information that varies continuously i.e; they process time-varying signals
that can take on any values across a continuous range of voltage, current, or any physical
parameter.
3. High speed
Digital processing of data ensures a high speed of operation which is possible due to advances in
digital signal processing.
4. High Reliability
Digital systems are highly reliable one of the reasons for that is the use of error correction codes.
5. Design is easy
The design of digital systems which requires the use of Boolean algebra and other digital
techniques is easier compared to analog designing.
7 Number Representation
There are several number systems that we normally use, such as decimal, binary, octal,
hexadecimal, etc. Amongst them, we are most familiar with the decimal number system. These
systems are classified according to the values of the base of the number system. The number
The leftmost bit, which has the greatest weight is called the Most Significant Bit (MSB). And the
rightmost bit which has the least weight is called the Least Significant Bit (LSB).
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Review Questions
1. Explain different coding methods used to represent data.
2. Describe the characteristics of digital and analog signals?
3. Compare digital and analog systems? Which one is better and why?
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
1
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
1.3 Decimal-to-hexadecimal Conversion
The same steps are repeated to convert a number in decimal to a number in hexadecimal.
Only here we have to divide the decimal number by 16 repeatedly, until the quotient of
zero is obtained.
Example 1.3. Convert 34810 into a hexadecimal number.
Solution
Division Quotient Generated remainder
348 21 12
16
21 1 5
16
1 0 1
16
Hence the converted hexadecimal number is 15C16.
1.4 Binary-to-decimal Conversion
To convert binary, octal, or hexadecimal numbers to decimal numbers we have to keep in mind
that each number systems is a positional number system and has a positional weight.
Example Convert 101102 into a decimal number.
Solution
The binary number given 1 0 1 1 0
Positional weights 43210
The positional weights for each of the digits are written in italics below each digit.
Hence, we find that here, for the sake of conversion, we have to multiply each bit with
its positional weights depending on the base of the number system.
1.5 Octal-to-decimal Conversion
Example Convert 34628 into a decimal number.
Solution
The octal number given is 3 4 6 2
Positional weights 3210
The positional weights for each of the digits are written in italics below each digit.
2
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Hence the decimal equivalent number is given as:
3 × 83 + 4 × 82 + 6 × 81 + 2 × 80
= 1536 + 256 + 48 + 2
= 184210
The positional weights for each of the digits are written in italics below each digit.
Hence the decimal equivalent number is given as:
4 × 163 + 2 × 162 + 10 × 161 + 13 × 160
= 16384 + 512 + 160 + 13
= 1706910.
2 Fractional Conversion
If the number contains the fractional part we have to deal in a different way when
converting the number from a different number system (i.e., binary, octal, or
hexadecimal) to a decimal number system or vice versa.
Example Convert 1010.0112 into a decimal number.
Solution
The binary number given is 1 0 1 0. 0 1 1
Positional weights 3 2 1 0 -1-2-3
The positional weights for each of the digits are written in italics below each digit. Hence
the decimal equivalent number is given as:
The positional weights for each of the digits are written in italics below each digit.
Hence the decimal equivalent number is given as:
3 × 82 + 6 × 81 + 2 × 80 + 3 × 8–1 + 5 × 8–2
3
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
= 192 + 48 + 2 + 0.375 + 0.078125
= 242.45312510.
The positional weights for each of the digits are written in italics below each digit.
Hence the decimal equivalent number is given as:
2 1 0 –1 –2
4 × 16 + 2 × 16 + 10 × 16 + 1 × 16 + 1 × 16
= 1024 + 32 + 10 + 0.0625 + 0.00390625
= 1066.0664062510.
1 0 1
i.e., (0.625)10 = (0.101)2
4
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Solution
Division Quotient Generated remainder
34 4 2
8
4 0 4
8
Therefore, (34)10 = (42)8
Fractional Part
0.525 0.200 0. 600
×8 ×8 ×8
4.200 1.600 1.200
4 1 1
Therefore, (92)10=(5C)16
Fractional Part
0. 85 0.60
×16 ×16
13.60 9.60
13 9
i.e., (0.85)10 = (0.D9)16
5
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Therefore, (92.85)10 = (5C.D9)16
Since at the time of grouping the three digits in t h e above example starting from the
LSB, we find that the third group cannot be completed, since only one 1 is left out in
the third group, so we complete the group by adding two 0s in the MSB side. This is
called the left padding of the number with 0.
Now if the number has a fractional part then there will be two different classes of
groups—one for the integer part starting from the left of the decimal point and
proceeding toward the left and the second one starting from the right of the decimal
point and proceeding toward the right. If for the second class, and 1 is left out, we
complete the group by adding two 0s on the right side. This is called right-padding.
6
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Solution
Given octal number is 2 4 7
Binary equivalent is 010 100 111
= 010100111
Forming groups of 4 bits from the LSB 1010 0111
Hexadecimal equivalent A 7
3 Complements
Complements are used in digital computers for simplifying the subtraction operation
and for logical manipulations. There are two types of complements for each number
system of base - r:
1. The radix complements or r’s complement
2. The diminished radix complements or (r-1)’s complement
When we deal with a binary system the value of r is 2 and hence the complements
are 2’s and 1’s complements. Similarly, for a decimal system, the value of r is 10 and
we get 10’s and 9’s complements. With the same logic if the number system is octal
we get 8’s and 7’s complement, while it is 16’s and 15’s complements for t h e
hexadecimal system.
3.1 The r’s Complement or Radix Complement
If a positive number N is given in base r with an integer part of n digits, the r’s complement of N
is given as:
𝑟 𝑛 − 𝑁 𝑓𝑜𝑟 𝑁 ≠ 0
r's complement = { }
0 𝑓𝑜𝑟 𝑁 = 0
7
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Integer part of digits (n) = total number of positive digits = 5
Given number (N) = 52520
0
The 10’s complement of (0.3245)10 is 10 – 0.3245 = 0.6755.
Similarly, for 23.324
2
The 10’s complement of (23.324)10 is 10 – 23.324 = 76.676.
= (6553610 – 1899210)
= 4654410
= B5D016
8
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Here, r = 10, n = 5, m = 0 (no fractional part) and N= (23450)10
The 9’s complement is given by 𝑟 𝑛 − 𝑟 −𝑚 − 𝑁
Therefore, (23450)10 is 105 – 100 – 23450 = 76549.
Example Find 9’s complement of (0.3245)10
Here, r = 10, n = 0(number of integer part), m = 4 (number of fractional part) and N=
(0.3245)10
The 9’s complement is given by 𝑟 𝑛 − 𝑟 −𝑚 − 𝑁
Therefore, (0.3245)10 is 100 – 10-4 – 0.3245 = 0.6754.
Example Find 9’s complement of (23.324)10
Here, r = 10, n = 2(number of integer part), m = 3 (number of fractional part) and N=
(23.324)10
The 9’s complement is given by 𝑟 𝑛 − 𝑟 −𝑚 − 𝑁
Therefore, (23.324)10 is 102 – 10-3 – 23.324= 76.675
9
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
➢ r's complement can be obtained from the (r-1)’s complement after the addition of r-m to the
least significant digit.
4 Binary Subtraction
Binary subtraction is also carried out in a similar method to decimal subtraction. Binary
subtraction between two numbers can be performed in three ways.
1. the direct method,
2. the r’s complement method, and
3. the (r – 1)’s complement method.
4.1 Direct Method
In this method, we borrow a 1 from a higher significant position when the minuend digit
is smaller than the corresponding subtrahend digit.
Example Using the direct method to perform the subtraction 1001 – 1000.
Solution
1 0 0 1
(–) 1 0 0 0
0 0 0 1
4.2 Subtraction with r’s Complements
When subtraction is implemented in a digital system, complement methods is found to be more
efficient as it uses only complement hardware and adder unit.
The subtraction of two positive numbers (M — N), both of base r, may be done as follows:
1. Add the minuend M to the r’s complement of the subtrahend N.
2. Inspect the result obtained in step 1 for an end carry:
a. If an end carry occurs, discard it.
b. If an end carry does not occur, take the r’s complement of the number obtained in step
1 and place a negative sign in front.
Example Using 10’s complement, subtract 72532 – 3250.
Solution
Here, M = 72532, N= 3250
10
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
= 169282
Here, 1 is end carry value so it is discarded. Then the required answer = 69282
11
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
The subtraction of two positive numbers M-N, both of base r may be done as follows.
1. Add the minuend M to (r-1)’s complement of N
2. Inspect the result obtained in step 1
a. If an end carry occurs, add 1 to the least significant digit (end – around carry). The
result is answer
b. If an end carry doesn’t occurs, take (r-1)’s complement of number obtained in step
1 and placed negative (-ve) sign.
Subtract using (r-1)’s complement
Example using (r-1)’s complement performs 72532-3250
Here, M = 72532, N= 3250
12
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Now, M+N(r-1)’s = 1000100 + 0101011 = 11011112
Here, no end carry is present so, (r-1)’s complement of M+N(r-1)’s is
(27- 20)10 – (1101111)2 = (1111111)2-(1101111)2
= (10000)2
Therefore, the required solution is (-10000)2
The code is also known as 8-4-2-1 code. This is because 8, 4, 2, and 1 are the weights of the four
bits of the BCD code. The weight of the LSB is 20 or 1, that of the next higher order bit is 21 or 2,
that of the next higher order bit is 22 or 4, and that of the MSB is 23 or 8. Since four binary bits are
used the maximum decimal equivalent that may be coded is 1510 (i.e., 11112). But the maximum
decimal digit available is 910. Hence the binary codes 1010, 1011, 1100, 1101, 1110, 1111,
representing 10, 11, 12, 13, 14, and 15 in decimal are never being used in BCD code. So these six
codes are called forbidden codes and the group of these codes is called the forbidden group in BCD
code.
13
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Example Give the BCD equivalent for the decimal number 589.
Solution
The decimal number is 589
BCD code is 0101 1000 1001
Example Give the BCD equivalent for the decimal number 69.27.
Solution.
The decimal number 69.27
BCD code is 0110 1001 . 0010 0111
84-2-1 Code
It is also possible to assign negative weights to decimal codes, as shown by the 84-
2-1 code. In this case, the bit combination 0101 is interpreted as the decimal digit 3, as
obtained from 0 × 8 + 1 × 4 + 0 × (–2) + 1 × (–1) = 3. This is a self-complementary
code, that is, the 9’s complement of the decimal number is obtained just by changing
the 1s to 0s and 0s to 1s, or in effect by getting the 1’s complement of the
corresponding number. For example, if we change the 1s to 0s and 0s to 1s in the previous
example we have 1010, which is interpreted as decimal 6, as obtained from 1 × 8 + 0
× 4 + 1 × (–2) + 0 × (–1) = 6. And 6 is the 9’s complement of 3. This property is
useful when arithmetic operations are done internally with decimal numbers (in a binary
code) and subtraction is calculated by means of 9’s complement.
2421 Code
Another weighted code is 2421 code. The weights assigned to the four digits are 2, 4,
2, and 1. The 2421 code is the same as that in BCD from 0 to 4; however, it varies
from 5 to 9. For example, in this case the bit combination 0100 represents decimal 4;
whereas the bit combination 1101 is interpreted as the decimal 7, as obtained from 2
× 1 + 1 × 4 + 0 × 2 + 1 × 1 = 7. This is also a self-complementary code, that is, the
9’s complement of the decimal number is obtained by changing the 1s to 0s and 0s to 1s.
5.2 Non-weighted Codes
These codes are not positionally weighted. It basically means that each position
of the binary number is not assigned a fixed value. Excess-3 codes and Gray codes
are such non-weighted codes.
14
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Excess-3 Code
A decimal code that has been used in some old computers is Excess-3 code. This is a non-
weighted code. This code assignment is obtained from the corresponding value of 4-bit
binary code after adding 3 to the given decimal digit. Here the maximum value may
be 11002. Since the maximum decimal digit is 9 we have to add 3 to 9 and then get the
BCD equivalent. Like 84-2-1 and 2421 codes Excess-3 is also a self-complementary code,
that is, the 9’s complement of the decimal number is obtained by changing the 1s to 0s
and 0s to 1s. This self-complementary property of the code helps considerably in
performing subtraction operation in digital systems.
Converting the above sum into 4-bit binary equivalent, we have a 4-bit binary
equivalent of 0110 1001 1010
Hence, the Excess-3 code for (367)10 = 0110 1001 1010
Converting the above sum into 4-bit binary equivalent, we have a 4-bit binary
equivalent of 1000 1011 0111 0110
Hence, the Excess-3 code for (367)10 = 10001011.01110110
Table 1 Binary Code for Decimal Numbers
Decimal (BCD)
digit 8421 84-2-1 2421 Excess-3
0 0000 0000 0000 0011
15
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
1 0001 0111 0001 0100
2 0010 0110 0010 0101
3 0011 0101 0011 0110
4 0100 0100 0100 0111
5 0101 1011 1011 1000
6 0110 1010 1100 1001
7 0111 1001 1101 1010
8 1000 1000 1110 1011
9 1001 1111 1111 1100
16
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Conversion of a Binary Number into Gray Code
Any binary number can be converted into equivalent Gray code by the following
steps:
➢ The MSB of the Gray code is the same as the MSB of the binary number;
➢ The second bit next to the MSB of the Gray code equals the Ex-OR of the
MSB and the second bit of the binary number; it will be 0 if there are same
binary bits or it will be 1 for different binary bits;
➢ The third bit for Gray code equals the exclusive-OR of the second and third
bits of the binary number, and similarly, all the next lower-order bits follow the
same mechanism.
Example Convert (101011)2 into Gray code.
Step 1. The MSB of the Gray code is the same as the MSB of the binary number.
1 0 1 0 1 1 Binary
1 Gray
Step 2. Perform the ex-OR between the MSB and the second bit of the binary.
The result is 1, which is the second bit of the Gray code.
1 ⨁ 0 1 0 1 1 Binary
1 1 Gray
Step 3. Perform the ex-OR between the second and the third bits of the binary. The
result is 1, which is the third bit of the Gray code.
1 0 ⨁ 1 0 1 1 Binary
1 1 1 Gray
Step 4. Perform the ex-OR between the third and the fourth bits of the binary.
The result is 1, which is the fourth bit of the Gray code.
1 0 1 ⨁ 0 1 1 Binary
1 1 1 1 Gray
17
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Step 5. Perform the ex-OR between the fourth and the fifth bits of the binary.
The result is 1, which is the fifth bit of the Gray code.
1 0 1 0 ⨁ 1 1 Binary
1 1 1 1 1 Gray
Step 6. Perform the ex-OR between the fifth and the sixth bits of the binary.
The result is 0, which is the last bit of the Gray code.
1 0 1 0 1 ⨁ 1 Binary
1 1 1 1 1 0 Gray
After completing the conversion, the Gray code of binary 101011 is 111110.
Solution
Step 1. Convert the decimal 564 into equivalent binary.
Decimal number 564
Binary number 1000110100
Step 2. Convert the binary number into equivalent Gray code.
1 ⨁ 0 ⨁ 0 ⨁ 0⨁ 1 ⨁ 1 ⨁ 0 ⨁ 1 ⨁ 0 ⨁ 0 Binary
1 1 0 0 1 0 1 1 1 0 Gray
18
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Example Convert the Gray code 101101 into a binary number.
Solution
Step 1. The MSB of the binary number is the same as the MSB of the Gray code.
1 0 1 1 0 1 Gray
1 Binary
Step 2. Perform the ex-OR between the MSB of the binary number and the second bit
of the Gray code and so on till last bit
1 0 1 1 0 1 Gray
⨁ ⨁ ⨁ ⨁ ⨁
1 1 0 1 1 0 Binary
After completing the conversion, the binary number of the Gray code 101101 is 110110
Alphanumeric
An alpha-numeric code is a binary code of a group of elements consisting of ten decimal digits.
The 26 letter of alphabets and certain number of special symbols such as #,& etc. The total number
of elements in an alpha-numeric code is greater than 36. It must be coded with the minimum of 6
bits. Two mostly used alpha-numeric code ra ASCII and EBCDIC.
ASCII (American Code for Information Interchange) Code
The ASCII code are widely used alpha-numeric code. It is basically a 7-bit code since it can create
27 = 128-bit pattern. The ASCII code can be used to encode both the lower case and upper-case
characters of alphabet and some symbol ‘#’, ‘&’ etc.
A→ 65 a→97 0→48 blank→32 and so on.
EBCDIC (Extended Binary Coded Decimal Interchange) Code
It is an 8-it alpha-numeric code. It can create 28 = 256 different bit patterns. EBCDIC cade can
encode all the symbols and characters found in ASCII code. It also encodes many other symbols
which are not encoded by ASCII code. In fact, many of the bit patterns in EBCDIC code are
unassigned.
A→193 a→129 0→240 blank → 64
19
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Character 7-bit 8-bit
ASCII code EBCDIC code
A 1000001 11000001
B 1000010 11000010
C 1000011 11000011
D 1000100 11000100
E 1000101 11000101
F 1000110 11000110
G 1000111 11000111
H 1001000 11001000
I 1001001 11001001
J 1001010 11010001
K 1001011 11010010
L 1001100 11010011
M 1001101 11010100
Instruction Code
An instruction code is a group of bits that instruct the computer to perform the specific operations.
It is divided into two parts: op-code and operands.
The most basic part of an instruction code is its operation part called as “op-code”. The operation
code of an instruction is a group of bits that defines particular operation add, substract, multiply,
divide etc. the number of bits required for the operation code of an instruction depends on the total
number of operation available in the computer. The operation code must consist of atleast n bits
for given 2n distinct operators.
Consider a computer with 64 distinct operation. One of then is add operation. The operation code
consist of six(6) bits with the bit configuration of “110010” assigned to the add operation. When
this operation is decoded in the control unit, the computer issue control signal to reas operatnd
from memory and add operand to the processor resistance.
Solved Problems
Example Encode the following decimal numbers in BCD code:
(a) 45 (b) 273.98 (c) 62.905
Solution
(a) Decimal number is 4 5
BCD code is 0100 0101
Hence the BCD coded form of 4510 is 0100 0101
20
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
(b) Decimal number is 2 7 3 9 8
BCD code is 0010 0111 0011 1001 1000 Hence the
BCD coded form of
273.9810 is 0010 0111 0011.1001 1000
21
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Hence the Excess-3 coded form of 471.7810 is 0111 1010 0100.1010 1011
(c) Decimal number is 2 3 1 0 5
BCD code is 0010 0011 0001 0000 0101
Now adding 3 +0011 +0011 +0011 +0011 +0011
Excess-3 code is 0101 0110 0100 0011 1000
Hence the Excess-3 coded form of 23.10510 is 0101 0110.0100 0011 1000
Example Express the following Excess-3 codes as decimal numbers:
(a) 0101 1011 1100 0111 (b) 0011 1000 1010 0100 (c) 0101 1001 0011
Solution
(a) Excess-3 code is 0101 1011 1100 0111
Subtracting 3 from each digit 0011 –0011 –0011 –0011
BCD number is 0010 1000 1001 0100
Decimal number is 2 8 9 4
Hence the decimal number is 2894.
(b) Excess-3 code is 0011 1000 1010 0100
Subtracting 3 from each digit 0011 –0011 –0011 –0011
BCD number is 0000 0101 0111 0001
Decimal number is 0 5 7 1
Hence the decimal number is 571.
(c) Excess-3 code is 0101 1001 0011
Subtracting 3 from each digit 0011 –0011 –0011
22
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
BCD number is 0010 0110 0000
Decimal number is 2 6 0
Hence the decimal number is 260.
Solution
23
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
Review Questions
1. Convert the following decimal numbers to binary: 12.0625, 104 , 673.23, and 1998. 1-5.
2. Convert the following binary numbers to decimal: 10.10001, 101110.0101, 1110101.110,
1101101.111
3. Convert the following numbers from the given base to the bases indicated
(a) decimal 225.225 to binary, octal, and hexadecimal
(b) binary 11010111.110 to decimal, octal, and hexadecimal
(c) octal 623.77 to decimal, binary, and hexadecimal
(d) hexadecimal 2AC5.D to decimal, octal, and binary
4. Obtain the l’s and 2’s complement of the following binary numbers: 1010101, 0111000,
0000001, 10000, 00000.
5. Perform the subtraction with the following decimal numbers using (1) 10’s complement
and (2) 9’s complement. Check the answer by straight subtraction.
a. 5250 - 321
b. 753 – 864
c. 3570 - 2100
d. 20 – 1000
6. Represent the decimal number 8620 (a) in BCD, (b) in excess-3 code, (c) in 2, 4, 2, 1 code,
and (d) as a binary number.
7. Convert the following decimal numbers to the indicated bases.
a. 7562.45 to octal
b. 1938.257 to hexadecimal
24
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Number System and Codes Unit 2
c. 175.175 to binary
8. Convert the following hexadecimal number to decimal and octal numbers
a. 0FFF
b. 3FFF
9. Subtract (1010100 – 1000100) using 1’s complement.
10. Using 2’s complement, subtract (1000100-1010100).
11. Why is Gray code called the reflected code? Explain
12. What are the different types of Binary codes? Explain each in brief
13. How can you find the r’s complement using (r-1)’s complement? Explain with example
14. Excess 3 code is self-complementary code, verify the statement?
15. What do you mean by the Gray code? What are its application?
16. What is decimal code? Differentiate between BCD and excess-3 code.
Declaration: This document is prepared only for academic purposes, contents from different
sources are subject to their own copyright.
25
Compiled By: Deepesh Prakash Guragain |Unit 2 | References: Morris Mano
Boolean Algebra and Logic Gates Unit 3
Binary logic deals with variables that have two discrete values—1 for TRUE and 0 for
FALSE. A simple switching circuit containing active elements such as a diode and
transistor can demonstrate the binary logic, which can either be ON (switch closed) or
OFF (switch open).
The switching functions can be expressed with t h e Boolean equation. Boolean
Algebra, was invented by the mathematician George Boole in 1854. Boolean Algebra
deals with the rules by which logical operations are carried out.
1 Basic Definition
Boolean algebra may be defined with a set of elements, a set of operators, and a number of
assumptions and postulates. A set of elements refers to the collection of objects having common
properties.
6. Distributive Law: If * and (.) are two binary operators on a set S, * is said
to be distributive over (.), whenever A*(B.C) = (A*B).(A*C).
2. The complement of variables are represented by a bar over letters or oblique, near letter
e.g. (𝐴̅ 𝑜𝑟 𝐴′ ).
5. The addition of variables in Boolean algebra involves the variable either a zero or one.
6. Multiplication in Boolean algebra follows the same basic rules that are in binary
operations. e.g. 0.0=0, 0.1=0, 1.0=0, 1.1=1
2. The second theorem states that the complement of a sum is equal to the product
of the complements. In equation form, this can be expressed as
(A + B) = A. B
a. Replace the operator (+) with (.) and (.) with (+) given in the expression.
1. Parentheses→()
2. NOT→'
3. AND→.
4. OR→+
In other words, the expression inside the parentheses must be evaluated before all other operations.
The next operation that holds precedence is the complement, then follows the AND, and finally
the OR.
Example: (a+b.c).d' → here we first evaluate ‘b.c’ and OR it with ‘a’ followed by ANDing with
complement of ‘d’.
Example Find the dual of the following Boolean Expression
1. A + AB = A
2. A + 𝐴̅B = A + B
3. A+𝐴̅ =1
4. (A+B) (A+C) = A+B+C
A B F
0 0 0
OR F = A + B 0 1 1
1 0 1
1 1 1
A F
Inverter F = A 0 1
or NOT 1 0
A F
Buffer F = A 0 0
1 1
A B F
0 0 1
NAND F = (AB) 0 1 1
1 0 1
1 1 0
A B F
0 0 1
NOR F = (A + B) 0 1 0
1 0 0
1 1 0
A B F
0 0 0
Exclusive-OR F = AB + AB 0 1 1
(XOR) = A B 1 0 1
1 1 0
Equivalence A B F
Or F = AB + AB 0 0 1
Exclusive-NOR = A B 0 1 0
(XNOR) 1 0 0
1 1 1
Hence, we have to bring the given Boolean expression into this form.
When input A = B
Q = ̅̅̅̅̅
𝐴. 𝐵 = ̅̅̅̅̅
𝐴. 𝐴
We know, A.A = A
Therefore, Q = 𝐴̅
B. AND gate using NAND gate
The Boolean expression for an AND gate is Q = A.B
̿̿̿̿̿
Taking double inversion of RHS we have Q = 𝐴. 𝐵
7 Boolean function
Binary variables have two values, either 0 or 1. A Boolean function is an expression
formed with binary variables, the two binary operators AND and OR, one unary operator
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
8 Reduce the following Boolean expression
̅. 𝑪 = 𝟎
1. A.𝑨
2. ABCD+ABD = ABD(C+1) = ABD
3. xy+xyz+xy𝒛̅+𝒙 ̅𝒚𝒛
= xy+ xy𝑧̅ + xyz + 𝑥̅ 𝑦𝑧
= xy(1+𝑧̅) + yz(x+ 𝑥̅ )
=xy + yz
=y(x+z)
4. AB + ̅̅̅̅ ̅ 𝑪(𝑨𝑩 + 𝑪)
𝑨𝑪 + 𝑨𝑩
̅̅̅̅ + 𝐴𝐵̅ 𝐶𝐴𝐵 + 𝐴𝐵̅ 𝐶𝐶
= AB + 𝐴𝐶
= AB + ̅̅̅̅
𝐴𝐶 + 0 + 𝐴𝐵̅ 𝐶
= A(B+𝐵̅ 𝐶) + 𝐴𝐶̅̅̅̅
̅̅̅̅
= A(B+C) + 𝐴𝐶 [ B+𝐵̅ 𝐶 = 𝐵 + 𝐶]
=AB+AC+ ̅̅̅̅𝐴𝐶
=AB+1 [AC+ 𝐴𝐶 ̅̅̅̅ = 1]
̅𝒀
4. 𝑿 ̅+𝑿 ̅ 𝒀 + 𝑿𝒀 = 𝑿 ̅+𝒀
LHS = 𝑋̅ 𝑌̅ + 𝑋̅ 𝑌 + 𝑋𝑌 = (𝑋̅ 𝑌 + 𝑋̅ 𝑌̅) + (𝑋̅ 𝑌 + 𝑋𝑌)
= 𝑋̅ (𝑌 + 𝑌̅) + Y(𝑋 + 𝑋̅ )
= 𝑋̅ + 𝑌
5. 𝑨 ̅ 𝑪̅ + 𝑨𝑩 + 𝑩
̅𝑩 + 𝑩 ̅𝑪 = 𝟏
LHS = (𝐴̅ 𝐵 + 𝐴𝐵) + ( 𝐵̅ 𝐶̅ + 𝐵̅ 𝐶 )
= B(𝐴̅ + 𝐴) + 𝐵̅ ( 𝐶̅ + 𝐶)
=B + 𝐵̅
=1
̅ 𝒁 + 𝑿𝒀̅ = 𝑿 + 𝒀 + 𝒁
6. 𝒀 + 𝑿
LHS = 𝑌 + 𝑋̅ 𝑍 + 𝑋𝑌 = (𝑌 + 𝑋)(𝑌 + 𝑌̅ ) + 𝑋̅ 𝑍
=(𝑌 + 𝑋) + 𝑋̅ 𝑍
Review Questions
1. “ 8 4 -2 -1” code is self-complementary code” . Justify the statement
2. Determine the value of base x if (321)x =(57)8
3. Reduce the give expression in minimum number of literals using Boolean algebra and
derive the truth table and implement in NAND logic. A + B[AC + B{AC+(B+C’)D}]
4. Explain the universal property of NOR gate with appropriate logic gates.
5. State and prove De-Morgan’s theorem. List out the factors to be considered while
constructing the Logic gates.
6. Design the three bit EX-OR circuit using only Universal gates?
7. Simplify the following expressing using Boolean algebra.
a. (AB’ + AB’C’)’ + A(B’+AB’)
b. [(BC’+A’D)(AB’+C’D’)]’
c. A’B’+BC + A’BC’= A’+BC
d. XY’+YZ’+ZX’=X’Y+Y’Z+Z’X
8. Implement XNOR gate using only NAND gates and XOR gate using NOR gate only
9. Why NAND and NOR are called Universal gates? Construct F=AB+CD using universal
gates
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
3 Minterms
It is a product term containing all n variables of the function in either true or
complemented form. Each minterm is obtained by an AND operation of the variables in
true or complemented form. So, if the number of variables is n, then the possible
number of minterms is 2n.
➢ Represents exactly one combination in the truth table
➢ Denoted by mj where j is the decimal equivalent of the minterm’s corresponding
binary combination (bj).
➢ A variable in mj is complemented if its value in bj is 0, otherwise is
uncomplemented.
4 Maxterms
It is a sum term containing all n variables of the function in either true or complemented
form. Each maxterm is obtained by an OR operation of the variables in their true form
or complemented form. So, if the number of variables is n, then the possible number of
maxterms is 2n. The main property of a maxterm is that it possesses the value of 0 for
only one combination of n input variables and the rest of the 2n –1 combinations have the
logic value of 1.
➢ Represents exactly one combination in the truth table
➢ Denoted by Mj where j is the decimal equivalent of the maxterm’s corresponding
binary combination (bj).
➢ A variable in Mj is complemented if its value in bj is 1, otherwise is
uncomplemented.
Truth table notation for Minterms and Maxterms
A B C Minterm Maxterm
0 0 0 A’B’C’= m0 A + B + C =M0
0 0 1 A’B’C= m1 A + B + C’=M1
0 1 0 A’BC’= m2 A + B’ + C=M2
0 1 1 A’BC= m3 A + B’ + C’=M3
1 0 0 AB’C’= m4 A’ + B + C=M4
1 0 1 AB’C= m5 A’ + B + C’=M5
1 1 0 ABC’= m6 A’ + B’ + C=M6
1 1 1 ABC= m7 A’ + B’ + C’=M7
Example Obtain the canonical sum of product form of the following function.
F (A, B) = A + B
Solution
The given function contains two variables A and B. The variable B is missing from the
first term of the expression and the variable A is missing from the second term of
the expression. Therefore, the first term is to be multiplied by (B + B) and the
second term is to be multiplied by (A + A) as demonstrated below.
F (A, B) = A + B
= A.1 + B.1
= A (B + B) + B (A + A)
= AB + AB + AB + AB
= AB + AB + AB (as AB + AB = AB)
Hence the canonical sum of the product expression of the given function is
F(A,B) = AB + AB + AB.
Example Obtain the canonical sum of t h e product form of the following function.
F (A, B, C, D) = AB + ACD
Solution
F (A, B, C, D) = AB + ACD
= AB (C+C) (D+D) + ACD(B+B)
= (ABC+ABC) (D+D) + ABCD + ABCD
= ABCD + ABCD + ABCD + ABCD + ABCD + ABCD
= ABCD + ABCD + ABCD + ABCD + ABCD
Hence above is the canonical sum of the product expression of the given function.
Example Obtain the canonical product of the sum form of the following function.
F(A,B,C) = (A + B) (B + C) (A + C)
Solution
In the above three-variable expression, C is missing from the first term, A is missing
from the second term, and B is missing from the third term. Therefore, CC is to be
added with first term, AA is to be added with the second, and BB is to be added
with the third term. This is shown below.
F (A,B,C) = (A+B) (B+C) (A+C)
= (A+B+0) (B+C+0) (A+C+0)
= (A+B+CC) (B+C+AA) (A+C+BB)
= (A+B+C) (A+B+ C) (A+ B + C) (A+ B + C) (A+ B +C) (A+B+C) [using
the distributive property, as X + YZ = (X + Y)(X + Z)]
= (A+B+C)(A+B+C)(A+B+C)(A+B+C)(A+B+C) [as (A + B + C) (A +
B + C) = A + B + C]
Hence the canonical product of the sum expression for the given function is
F(A,B,C) = (A + B + C) (A + B + C) (A + B + C) (A + B + C) (A + B + C)
7 Minimization Technique
The complexity of digital logic gates to implement a Boolean function is directly related
to the complexity of algebraic expression. Also, an increase in the number of variables
results in an increase in complexity.
5 Group may wrap around the table. The leftmost cell in a row may be grouped with
rightmost cell and the top cell in a column may be grouped with bottom cell
➢ K-MAP simplification.
A pair eliminates one variable and its complement, a quad eliminates two variables
and their complements, and octets eliminates three variables and their
complements. Because of this we have to use octets first then quad and in last go
for pair.
➢ Overlapping Group
We can use same 1 more than once, so always overlap the group if possible.
➢ Rolling groups
We can roll the map if it is possible. If there is a pair and rolling is possible at that
place to form a quad then we follow a rolling method.
➢ Redundant group
When there is a redundant group eliminate it.
Solution:
Here, Y=A’B’C’+A’BC’+A’BC+AB’C filling the K-map with relevant 1’s
A simplified Boolean expression can now be deduced as: Y= A’C’ + A’B + AB’C
4. A logic expression representing a logic circuit is Y =∑m( 0 , 1 , 2 , 5 , 1 3 , 1 5 )
Draw the K-map and find the minimized logical expression.
Solution:
Here, Y =∑m( 0 , 1 , 2 , 5 , 1 3 , 1 5 )
Y= A’B’D’+ A’C’D+ABD
5. Minimize the following Boolean expression using
K-Map
F(A,B,C,D) =∑m( 1,3,5,9,11,13)
Solution:
F(A, B,C,D) =∑m( 1,3,5,9,11,13)
Solution
Solution:
Example Using the Karnaugh map method obtain the minimal product of the sums expression
for the function.
F(A,B,C,D) = ∑ (0, 2, 3, 6, 7) +d (8, 10, 11, 15)
Solution:
Example:
Simplify the given function of five variables using K-Map. f(A,B,C,D,E) = ∑ (0,4,6,7,8,
11,12,16,20,22,23,24,26,27,28,30,31).
Review Questions
1. Simplify the following Boolean function in (a) sum of products and (b) product of sums.
F (A, B, C, D) = ∑(0, 1, 2, 5, 8, 9, 10)
2. Implement the following function with NAND gates and NOR gates:
F(x, y, z) = ∑ (0, 6)
3. Simplify the following equation by K-Map
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
Solution
Step 1: Understand the problem ok, here circuit has 4 inputs and 2 outputs. Out of two, outputs
one is high when majority of inputs are high i.e Y1 = 1, when number of 1 in input is high. The
second output is high Y2 =1 when inputs = 0000 or 1111
Step 2: Here, the number of inputs are 4 and outputs are 2.
Step 3: Let 4 inputs be A,B,C,D and outputs be Y1 and Y2
4: Step Truth table construction and finding relationship
Inputs Outputs
A B C D Y1 Y2
0 0 0 0 0 1
0 0 0 1 0 0
0 0 1 0 0 0
0 0 1 1 0 0
0 1 0 0 0 0
0 1 0 1 0 0
0 1 1 0 0 0
0 1 1 1 1 0
1 0 0 0 0 0
1 0 0 1 0 0
1 0 1 0 0 0
1 0 1 1 1 0
1 1 0 0 0 0
1 1 0 1 1 0
1 1 1 0 1 0
1 1 1 1 1 1
Sum
Inputs Outputs
Carry
Inputs Outputs
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Sum = A B
Carry = AB
Limitation:
The addition of three bits is not possible to perform using half-adder
3.2 Full Adder
➢ A Full adder is an arithmetic adder that sums three input bits.
➢ It has three inputs and two outputs
S= A’B’C+ABC+A’BC’+AB’C’
S= C(A’B’+AB) + C’(A’B+AB’)
S=C(AB)’+C’(AB)
S=ABC
C= AC+BC+AB
S=ABC
C= AC+BC+AB
Proof:
Here, Sum = (AB)Cin
= ABCin
This is the same as that obtained for a full adder.
Now, COUT = (AB)CIN + AB
= (A’B+AB’)CIN+AB = A’BCIN+AB’CIN+AB = A’BCIN+AB’CIN+AB(1+CIN)
= A’BCIN+AB’CIN+AB+ABCIN = BCIN(A’+A) + AB’CIN+AB
BCIN+ AB’CIN+ AB(1+CIN) = BCIN+ AB’CIN+ AB+ABCIN
= BCIN + AB + ACIN(B+B’) = AB+BCIN+ACIN
3.3.1 Application
A full adder acts as the basic building blocks of 4 bit / 8 bit binary/BCD adder IC.
A Difference
Half Subtractor
B Borrow
Figure 4 Half Subtractor
D = A’B+AB’
D= AB
B =A’B
D = A’B’C+ A’BC’+ABC+AB’C’
D= A’B’C+ABC + A’BC’+ AB’C’
D=C(A’B’+AB) + C’(A’B+AB’)
Let A’B+AB’ = X
Therefore, D= C(X’)+C’(X)
D = C X = ABC
4.2.3 K-map for Borrow Output:
B0 = A’B+BC+A’C
D = ABBin
B0 = (AB)’Bin + A’B = (A’B+AB’)’Bin + A’B
= (A’B’ +AB)Bin + A’B = A’B’Bin + ABBin + A’B
= A’B’Bin + ABBin + A’B(1+Bin)
= A’B’Bin + BBin(A+A’) + A’B
= A’B’Bin + BBin + A’B
= A’B’Bin + BBin + A’B(1+Bin)
= A’B’Bin + BBin + A’B + A’BBin
= A’Bin(B’ + B) + BBin + A’B
B0 = A’Bin + BBin + A’B
5 Design of Binary to Gray Code Converter
B3 G3
B2 Binary-to-Gray G2
B1 Code G1
B0 G0
G2 = B3’B2 + B3B2’ G3 = B3
G2 = B3 B2
G3 B3
G2 Gray – to- Binary B2
Conversion
G1 B1
G0 B0
B3 = G3
W = A + BC+BD
Z = D’
Logic Circuit
8 Analysis Procedure
The design of combinational circuit starts from the verbal specification of a required function and
completes with set of outputs Boolean functions or a logic diagram. The analysis of a
combinational circuit is somewhat the reverse process. It starts wit a given logical diagram and
ends with sets of a Boolean functions, a truth table or a verbal explanation of the circuit operation.
1. Label with arbitrary symbols all gate outputs that are function of the input variables. Obtain
the Boolean function for each gate.
Example Realize the following function by NAND gates only, F = B(A + CD) + AC
Solution:
The equivalent diagram from the function
C
D
F
A
A
C
Example F = (A + B) (C + D)
This concept can also be explained by Boolean algebra and DeMorgan’s theorem.
F = (A + B) (C + D)
= (((A + B) (C + D))′)′ - complement to complement operation
= ((A + B)′ + (C + D)′)′ - applying DeMorgan’s theorem
Example Realize the following function by NOR gates only, F = A(B + CD) + BC’
P = ABC
9.4 The above truth table can be simplified using K-map as shown below
Some Solved
1. Design a combinational circuit that accepts a three-bit number and generates an output
binary number equal to the square of the input number.
Truth Table
Inputs Outputs
X Y Z a b c d e f
0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1
0 1 0 0 0 0 1 0 0
0 1 1 0 0 1 0 0 1
1 0 0 0 1 0 0 0 0
1 0 1 0 1 1 0 0 1
1 1 0 1 0 0 1 0 0
1 1 1 1 1 0 0 0 1
K-map
a = xy C = x y z + x yz
c = z( x y )
b = x y + xz d = y z’
Logical Circuit
Truth Table
K-map
A = XY B = XY′+WX′
C = W′Y + WY′ D = Z.
Logical Circuit
3. Design a combinational circuit that converts 2421 code to 84-2-1 code, and also the converter
circuit for 84-2-1 code to 2421 code.
Truth Table
K-map
a = A + CD + BD + B′D′ b = B′ + C′D′ + CD
Review Questions
1. Design even parity when a 3-bit message contains cycle code.
2. Reduce the given equation in minimum numbers of literals using Boolean algebra and
derive the truth table and implement in NAND logic. A +B[AC+B{AC + (B+C’)D}]
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
The number to be subtracted (B) is first passed through inverters to obtain its 1’s complement.
Then 1 is added to 1’s complement of B, by making Cin = 1. Thus we obtain 2’s complement of B.
The 4-bit adder then adds A and 2’s complement of B to produce the subtractor. Also, S3S2S1S0
represents the result of binary subtraction(A-B) and carry output Cout represents the polarity of the
result. If A> B, then Cout =0, and the result is in true binary form but if A<B, then Cout = 1, and
the result is in the 2’s complement form.
=1
When C=1, it is necessary to add binary 0110 to the binary sum and provide an o/p carry to the
next stage. A correction is needed when the binary sum has an o/p carry K=1. Binary 1010-1111
need correction and have a 1 in position Z8. To distinguish them from binary 1001, which also
have a 1 in Z8 position, we specify further that either Z4 or Z2 must have a 1. The condition for
the correction and o/p carry can be
C = K+ Z8Z4+Z8Z2 =1
2 Magnitude Comparator
A magnitude comparator is a combinational circuit that compares two numbers, A and B and
determines their relative magnitude. The outcome of the comparison is specified by three binary
variables that indicate whether A > B, A = B or A < B.
A = A3A2A1A0
B = B3B2B1B0
Case 1: A = B
The two number are equal if all pairs of significant digits are equal i.e. if A3 = B3 and A2= B2 and
A1=B1 and A0 = B0. The equality relation of each pair of bits can be expressed logically with an
equivalence function.
Where, Xi = 1 only if the pair of bits in position i are equal i.e. if both are 1’s or both are 0’s.
For equality conditions to exists, all Xi variables must be equal to 1. This dictate an AND
operation of all variables:
(A = B) = X3X2X1X0
The binary variable (A = B) is equal to 1 only if all pairs of digits of the two numbers are equal.
To determine if A is greater than or less than B, we inspect the relative magnitude of pairs of
significant digits starting from the most significant position. If the two digits are equal, we compare
the next lower significant pair of digits. This comparison continues until a pair of unequal digits is
reached. If the corresponding digits of A is 1 and that of B is 0, we conclude that A > B. If the
X2
X1
X0
3 Multiplexers
Multiplexing means transmitting a large number of information over a smaller number of channels
or lines. A digital multiplexer is a combinational circuit that selects binary information from one
of many inputs lines and directs it to a single output line. The selection of a particular input lime
is controlled by a set of selection lines. Normally, there are 2n input lines and n selection lines
whose bit combinations determine which input is selected.
3.1 Application
1. It is used as a data selector to select one out of many data inputs
2. It is used for simplification of digital design.
➢ In general, a multiplexer contains, n data lines one output line, and m selector lines.
➢ To select n inputs, we need m select lines such that 2m = n
2:1 Multiplexer
Enable i/p (E) Select i/p (S) Output (Y)
0 X 0
1 0 D0
1 1 D1
4:1 Multiplexer
Inputs Outputs
S0 S1 S2 S3 Y
0 0 0 0 D0
0 0 0 1 D1
0 0 1 0 D2
0 0 1 1 D3
0 1 0 0 D4
0 1 0 1 D5
0 1 1 0 D6
0 1 1 1 D7
1 0 0 0 D8
1 0 0 1 D9
1 0 1 0 D10
1 0 1 1 D11
1 1 0 0 D12
1 1 0 1 D13
1 1 1 0 D14
1 1 1 1 D15
Solution:
Variables, n= 3 (A, B, C) Select lines= n-1 = 2 (S1, S0) 2n-1 to MUX i.e., 22 to 1 = 4 to 1
MUX Input lines= 2n-1 = 22 = 4 (D0, D1, D2, D3)
The function can be implemented with a 4-to-1 multiplexer, as shown in Fig. below. Two of
the variables, A and B, are applied to the selection lines in that order, i.e., A is connected to
S1 and B to S0. The inputs of the multiplexer are 0, 1, C, and C'.
Multiplexer Implementation
Solution:
Implementation table: Multiplexer Implementation
Variables, n= 4 (A, B, C, D) Select lines= n-1 = 3 (S2, S1, S0) 2n-1 to MUX i.e., 23 to 1 = 8:1 MUX
Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
Implementation Table
Multiplexer Implementation
Solution:
Variables, n= 4 (P, Q, R, S) Select lines= n-1 = 3 (S2, S1, S0) 2n-1 to MUX i.e., 23 to 1 = 8 to 1
MUX Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
Multiplexer Implementation
5 Demultiplexers
A multiplexer takes several inputs and transmits one of them to the output. A demultiplexer
performs the reverse operation; it takes a single input and distributes it over several outputs, so
demultiplexers can be thought of as a ‘distributor’ since it transmits the same data to different
destinations. A demultiplexer is the logic circuit that receives information through a single input
line and transmits the same information over one of the possible 2n output lines.
A B C
Solution:
Since there are three variables, therefore a demultiplexer with three select inputs is required i.e.
1:8 demultiplexer is required. The 1:8 demultiplexer can be configured as below to implement the
given Boolean expression.
Truth Table
Since there are four variables, therefore a demultiplexer with four select inputs is required i.e. 1:16
demultiplexer is required. The 1:6 demultiplexer can be configured as below to implement given
Boolean expression.
6 Decoder
A decoder is a combinational circuit that converts binary information from n input lines to a
maximum of 2n unique output lines. If the n-bit decoded information has unused or don’t care
combination, the decoder output will have less than 2n outputs.
➢ Code Converters
➢ BCD TO 7 Segment decoder
➢ Nixie tube decoders
➢ Relay actuators
A logic symbol for 3x8 decoder with inputs and outputs is shown in the figure above. The binary
decimal label indicates that the binary inputs make the corresponding output active.
D0
D1
D2
D3
D4
D5
D6
D7
Solution:
No. of inputs = 3
Decoder size = 3:23 = 3:8
Number of Outputs = 1
F(A,B,C) = F (A,B,C) = Σ (1,3,5,6)
No. of OR gate = 1
F (A,B,C) = Σ (1,3,5,6) = (m1 + m3 + m5 + m6)
= A’B’C + A’BC + AB’C + ABC’
Since the above function has three input variables, a 3-to-8 line decoder may be employed. It is
the sum of products of the min-terms m1, m3, m5, m6 and so decoder output D1, D3, D5, and D6
Solution:
For full adder number of inputs = 3 i.e (A, B, C)
Decoder size = 3:23 = 3:8 (n:2n)
From the truth table as illustrated
Sum = 𝚺(𝟏, 𝟐, 𝟒, 𝟕)
Carry = 𝚺(𝟑, 𝟓, 𝟔, 𝟕)
Example: Construction of 4:16 line decoder using 2:4-line decoder with enable
Enable
Encoder convert four signals into two, it can be understood by taking a look at the truth table
below. It is also important to know that an ordinary Encoder like the one shown here has a rule
that at given time only one input pin should be high so in the following truth table only one input
will be high.
Boolean Expression:
O1 = I3 + I2
O0 = I3 + I1
A priority 4:2 Encoder has 4 inputs and 2 outputs, but we will add another output called V which
stands for a valid bit. This valid bit will check if all the four input pins are low (0) if low the bit
will also make itself low stating that the output is not valid.
Boolean Expression:
O0
O1
O1 = I3 + I2
O0 = I2 I1’ + I3
V = I3 + I2 + I1 + I0
From the above table, the output Y2 becomes 1 if any of the digits D4 or D5 or D6 or D7 is one.
Thus, we can write its expression as
Y2 = D4 + D5 + D6 + D7
Y1 = D2 + D3 + D6 + D7 and
Y0 = D1 + D3 + D5 + D7
Also, it is to be observed that D0 does not exist in any of the expressions so it is considered as
don’t care. From the above expressions, we can implement the octal to binary encoder using set of
OR gates as shown in figure below.
D
0
A block diagram of a ROM is shown in the figure below. It consists of n input lines and m outputs
lines. Each bit combination of the input variable is called a word. The
number of bits per word is eual to the number of output lines m. an
address is essentially is equal to the number of output lines m. an
address is essentially a binary number that denotes one of the
minterms of n variable. The number of distinct addresses possible
with n input variables is 2n. an output word can be selected by a
unique address s and since there are 2n distinct addresses in a ROM,
there are 2n distinct words which are said to be stored in the unit. The
word available on the output lines at any given time depends on the
address value applied to the input lines. A ROM is characterized byy the number of words 2n and
the number of bits per word m.
Internally, the ROM is a combinational circuit with AND gates connected as a decoder and a
number of OR gates equal to the number of outputs in the unit.
PROMs: Programmable read-only memory or PROM units contain all 0's (or all 1's) in every bit
of the stored words. The approach called field programming is applied for fuses in the PROM
EPROMs: The hardware procedure for programming ROMs or PROMs is irreversible and, once
programmed, the fixed pattern is permanent and cannot be altered. Once a bit pattern has been
established, the unit must be discarded if the bit pattern is to be changed. A third type of unit
available is called erasable PROM, or EPROM. EPROMs can be restructured to the initial value
(all 0's or all 1's) even though they have been changed previously. When an EPROM is placed
under a special ultraviolet light for a given period of time, the shortwave radiation discharges the
internal gates that serve as contacts. After erasure, the ROM returns to its initial state and can be
reprogrammed.
EEPROMs: Certain ROMs can be erased with electrical signals instead of ultraviolet light, and
these are called electrically erasable PROMs, or EEPROMs.
Solution:
First we have to decide that which decoder has been used to implement given example. We have
3 variable functions, so 3-to-8 decoder will be used.
The given two functions are in the sum of products form. The number of product terms present in
the given Boolean functions A & B are two and three respectively. One product term, XZ’ is
common in each function.
So, we require four programmable AND gates & two programmable OR gates for producing those
two functions. The corresponding PLA is shown in the following figure.
The programmable AND gates have the access of both normal and complemented inputs of
variables. In the above figure, the inputs X, X′, Y, Y′, Z & Z′, are available at the inputs of each
AND gate. So, program only the required literals in order to generate one product term by each
AND gate.
All these product terms are available at the inputs of each programmable OR gate. But, only
program the required product terms in order to produce the respective Boolean functions by each
OR gate. The symbol ‘X’ is used for programmable connections.
Here, two boolean functions are given in terms of minterms. To obtain the expression, the given
function is implemented using Karnaugh map.
PLA implements the functions in their sum of products form (standard form, not necessarily
canonical as with ROM). Each product term in the expression requires an AND gate. It is necessary
to simplify the function to a minimum number of product terms in order to minimize the number
of AND gates used. The simplified functions in sum of products are obtained from the following
maps:
There are three distinct product terms in this combinational circuit: AB’, AC and BC. The circuit
has three inputs and two outputs; so, the PLA can be drawn to implement this combinational
circuit.
Programming the PLA means, we specify the paths in its AND-OR-NOT pattern. A typical PLA
program table consists of three columns.
Review Questions
1. Derive a PLA program table for the combinational circuit that squares 3-bit numbers to
minimize the number of product terms.
2. Differentiate between PLA and ROM. Implement the given four Boolean functions using
8x4 PLA.
A(x,y,z) = ∑(1,2,4,6)
B(x,y,z) = ∑(0,1,6,7)
C(x,y,z) = ∑(2,6)
D(x,y,z) = ∑(1,2,3,5,7)
3. Design a combinational circuit with four input lines that represent decimal digits in BCD
and four output lines that generate the 9’S complement of the input digits.
4. Design a combinational circuit which takes three input numbers and produces an output
equal to square of inputs.
5. A combinational circuit is defined by the following three functions
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
2. Memory unit is not required in 2. Memory units are required to store the past
combinational circuits. history of the input variables in sequential
circuits.
3. Combinational circuits are fasters because 3. Sequential circuits are slower than
the delay between the input and the output combinational circuits in output.
is due to the propagational delay of gates
only.
4. Combinational circuits are comparatively 4. Sequential circuits are comparatively harder
easy to design. to design and debug.
1.4 Clock
It is a control signal that periodically makes a transition from zero to one (0 to 1) and then back to
zero (0) again. We usually denote the clock by the symbol clk, cp.
2 Flip-Flops
The memory elements used in clocked sequential circuits are called flip-flops. These circuits are
binary cells capable of storing one bit of information. A flip-flop circuit has two outputs, one for
➢ A flip-flop circuit can maintain a binary state indefinitely (as long as power is delivered to
the circuit) until directed by an input signal to switch states.
➢ The major differences among various types of flip-flops are in the number of inputs they
possess and in the manner in which the inputs affect the binary state.
➢ The NAND gate is equivalent to an active LOW OR gate, an active LOW S-R latch using
OR gates may also be resented.
➢ The operation of this latch is the reverse of the operation of the NOR gate latch.
➢ If the 0s are replaced by 1s and 1s by 0s, we get the same truth table as that of NOR gate
latch.
➢ The SET and RESET inputs are normally resting in the HIGH state and one of them will
be pulsed LOW, whenever we want to change the latch output.
➢ It differs from the S-R latch in that it has only one input in addition to EN.
➢ The J-K flip-flop is very versatile and also the most widely used.
➢ The functioning of the J-K flip-flop is identical to that of the S-R flip-flop, except that it
has no invalid state like that of the S-R flip-flop.
➢ When J=0 and K=0, no change of state place even if a clock pulse is applied.
➢ When J=0 and K=1, the flip-flop resets at the HIGH level of the clock pulse.
➢ When J=1 and K=0, the flip-flop sets at the HIGH level of the clock pulse.
➢ When J=1 and K=1, the flip-flop toggles, i.e goes to the opposite state at a HIGH level of
the clock pulse.
➢ We can make edge-triggered flip-flops as well as by using positive and negative edges of
the clock instead of HIGH and LOW levels.
➢ As shown in figure, the external control inputs J and K are applied to the master section.
3 Triggering of flip-flop
The state of a flip-flop is switched by a momentary change in the input signal. This momentary
change is called a trigger and the transition it causes is said to trigger the flip-flop. Asynchronous
flip-flops require an input trigger defined by a change of signal level clocked flip-flops are
triggered by pulses. There are two types of triggering:
4 Master-slave Flip-Flop
A master-slave flip-flop is constructed from two separate flip-flops. One circuit serves as a master
and the other as a slave, and the overall circuit is referred to as a master-slave flip-flop.
It consists of a master flip-flop, a slave flip-flop, and an inverter. When the clock pulse CP is 0,
the output of the inverter is 1. Since the clock input of the slave is 1, the flip-flop is enabled and
output Q is equal to Y, while Q' is equal to Y'. The master flip-flop is disabled because CP = 0.
When the pulse becomes 1, the information then at the external R and S inputs is transmitted to
the master flip-flop. The slave flip-flop, however, is isolated as long as the pulse is at its 1 level
because the output of the inverter is 0. When the pulse returns to 0, the master flip-flop is isolated;
this prevents the external inputs from affecting it. The slave flip-flop then goes to the same state
as the master flip-flop.
Operation
➢ The clock input is normally 0, which prevents the J and K inputs from affecting the master
flip-flop.
➢ The slave flip-flop is a clocked RS type, with the master flip-flop supplying the inputs and
the clock input being inverted by gate 9.
➢ When the clock is 0, Q = Y, and Q' = Y'.
➢ When the positive edge of a clock pulse occurs, the master flip-flop is affected and may
switch states.
➢ The slave flip-flop is isolated as long as the clock is at the 1 level
➢ When the clock input returns to 0, the master flip-flop is isolated from the J and K inputs
and the slave flip-flop goes to the same state as the master flip-flop.
Step 4: Truth table of the required flip-flip (combining truth table and excitation table)
S = TQ'
and R = TQ.
Step 6 Logic Diagram of the converted Flip-flop
From the state table, we can reformulate the state table along with the flip-flop and Final
circuit diagram.
1. State the word description of the circuit behavior. It may be a state diagram, a timing diagram,
or other pertinent information.
2. From the given information about the circuit, obtain the state table.
3. Apply state-reduction methods if the sequential circuit can be characterized by input-output
relationships independent of the number of states.
4. Assign binary values to each state if the state table obtained in steps 2 or 3 contains letter
symbols.
5. Determine the number of flip-flops needed and assign a letter symbol to each. (6) Choose the
type of flip-flop to be used.
6. From the state table, derive the circuit excitation and output tables.
7. Using the map or any other simplification method, derive the circuit output functions and the
flip-flop input functions.
8. Draw the logic diagram.
Example: The state diagram is shown below. Design the circuit with an appropriate flip-flop.
Example
Consider a sequential circuit with the following specification. States marked inside the circles are
denoted by letter symbols instead of by their binary values.
Consider the input sequence 01010110100 starting from the initial state a. Each input of 0 or 1
produces an output of 0 or 1 and causes the circuit to go to the next state. From the state diagram,
we obtain the output and state sequence for the given input sequence as follows:
Algorithm:
"Two states are said to be equivalent if, for each member of the set of inputs, they give exactly the
same output and send the circuit either to the same state or to an equivalent state. When two states
are equivalent, one of them can be removed without altering the input-output relationships."
➢ Look for two present states that go to the same next state and have the same output for both
input combinations. State g and e are two such states: they both go to states a and f and
have outputs of 0 and 1 for x=0 and x=1, respectively. Therefore, states g and e are
equivalent; one can be removed.
➢ Final reduced table and state diagram for the reduced table consists of only five states.
Review Questions
1. Explain in detail about the positive edge triggered J.K flip-flop. Write its advantages over
the S-R flip-flop.
2. With a suitable example explain state reduction and assignment. Also, write the advantages
of state reduction and assignment.
3. Explain the operation of the RS flip-flop with its logic diagram, truth table, and excitation
table.
4. Explain the operation of the JK flip-flop with its logic diagram, truth table, and excitation
table. Why JK flip-flop is preferred over the RS flip-flop?
5. What is the significance of a flip-flop? Explain the J-K flip-flop along with its logic
diagram truth table and excitation table.
6. Differentiate between latches and Flip-flop. Draw JK flip-flop circuit to further convert it
into T flip-flop with state table and state equation.
7. Explain the negative edge triggered S-R flip-flop with the necessary logic diagram,
characteristic table, characteristic equation, and waveform.
13. Design a sequential circuit corresponding to the given state diagram using S-R flip-flop for
the following state diagram.
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
A 4-bit register with a load control input using RS flip-flop is shown in figure above. The CP input
of the register receive continuous synchronized pulses which are applied to all flip-flops. The
inverter in the CP path causes all flip-flop to be triggered by the negative edge of the incoming
pulses.
Generally, shift registers operate in one of four different modes with the basic movement of data
through a shift register being:
➢ Serial-in to Parallel-out (SIPO) - the register is loaded with serial data, one bit at a time,
with the stored data being available in parallel form.
➢ Serial-in to Serial-out (SISO) - the data is shifted serially "IN" and "OUT" of the register,
one bit at a time in either a left or right direction under clock control.
➢ Parallel-in to Serial-out (PISO) - the parallel data is loaded into the register simultaneously
and is shifted out of the register serially one bit at a time under clock control.
➢ Parallel-in to parallel-out (PIPO) - the parallel data is loaded simultaneously into the
register, and transferred together to their respective outputs by the same clock pulse.
The effect of data movement from left to right through a shift register can be presented graphically
as:
What's the point of a SISO shift register if the output data is exactly the same as the input data?
→Commonly available IC's include the 74HC595 8-bit Serial-in/Serial-out Shift Register all with
3-state outputs.
→Advantage: As this type of shift register converts parallel data, such as an 8-bit data word into
serial format, it can be used to multiplex many different input lines into a single serial DATA
stream which can be sent directly to a computer or transmitted over a communications line.
→Commonly available IC's include the 74HC166 8-bit Parallel-in/Serial-out Shift Registers.
The PIPO shift register is the simplest of the four configurations as it has only three connections,
the parallel input (PI) which determines what enters the flip-flop, the parallel output (PO) and the
sequencing clock signal (Clk). Similar to the Serial-in to Serial-out shift register, this type of
register also acts as a temporary storage device or as a time delay device, with the amount of time
delay being varied by the frequency of the clock pulses. Also, in this type of register, there are no
interconnections between the individual flip-flops since no serial shifting of the data is required.
2 Counters
Counters are one of the simplest types of sequential networks. A counter is usually constructed
from one or more flip-flops that change state in a prescribed sequence when input pulses are
received. A counter driven by a clock can be used to count the number of clock cycles. Since the
clock pulses occur at known intervals, the counter can be used as an instrument for measuring time
and therefore period of frequency. Counters can be broadly classified into three categories:
It uses four negative edge triggered JK flip-flop. All the flip-flop will operate in the toggle mode
because there J and K input are tied to Vcc. The clock pulse are applied to the flip-flop A. The
output of flip-flop A drives clock input of flip-flop B, the output of flip-flop B drives clock input
of flip-flop C and the output of flip-flop C drives clock input of flip- flop D. Since all flip-flop are
negative edge triggered flip-flop they require a transition of 1 to 0 at their clock input to toggle or
change the state.
Operation of Counter
Initially all the flip-flop are cleared by using a common low clear signal. Therefore
DCBA = 0000
On the first clock pulse A flip-flop will toggle from 0 to 1 this will not trigger B flip-flop
because it requires a change in 1 to 0 in A. Therefore B remain in last state and since B does
change its state also C and D remain in last state. Hence on the first clock pulse we get output
as,
DCBA = 0001
On the second clock pulse A flip-flop again toggles from 1 to 0. This now triggers B flip-flop,
Mod 7 counter can be constructed from nearest highest modulus counter i.e. mod8 but skipping 1
of state. Fig. Shows mod7 counter with some feedback to skip one of the state. It is convenient to
skip last state i.e. CBA=111 in natural count sequence of the counter. The arrangement is shown
in fig.
During count 7 CBA= 111, if CBA are connected to NAND gate, whenever 111 occurs at the input
of NAND gate the output of NAND gate is low(0). If the output of NAND gate is connected to all
clear inputs of all the flip-flop, as soon as CBA=111 occurs immediately all the flip-flop will clear.
Therefore the counter progress from 110 to 000 and count 111 is skipped. Since remaining states
are only 7 it is called as mod7 counter. fig. Shows the waveform for mod7 counter.
By using the same idea of truncating counter-output sequences, the above circuit could easily be
1. Binary Counter
2. Binary-up-down counter
3. BCD decade synchronous counter
Step 2: From the state table, write the count sequences in the form of a table as shown in Table.
In order to design such counter, which has ten distinct states, the number of flip-flops required can
be found using the equation, (2n-1 = N ‘number of distinct states’) where n is the number of flip-
flops required and N is the number of states present in the counter. For N = 10, from the above
equation,
Step 5: Prepare K-maps for each flip-flop input in terms of flip-flop outputs as the input variables
Step 6: Connect the circuit using flip-flops and other gates corresponding to the minimized
expressions
4 Binary Counter
The design of synchronous binary counters is so simple that there is no need to go through a
rigorous sequential-logic design process. In a synchronous binary counter, the flip-flop in the
lowest-order position is complemented with every pulse. This means that it’s J and K inputs must
be maintained at logic-1. A flip-flop in any other position is complemented with a pulse provided
all the bits in the lower-order positions are equal to 1, because the lower-order bits (when all 1's)
will change to 0's on the next count pulse.
Synchronous binary counters have a regular pattern and can easily be constructed with
complementing flip-flops and gates. The regular pattern can be clearly seen from the 4-bit counter
depicted in Fig by side.
The CP terminals of all flip-flops are connected to a common clock-pulse source. The first stage
A1 has its J and K equal to 1 if the counter is enabled. The other J and K inputs are equal to 1 if
all previous low-order bits are equal to 1 and the count is enabled. The chain of AND gates
generates the required logic for the J and K inputs in each stage. The counter can be extended to
any number of stages, with each stage having an additional flip-flop and an AND gate that gives
an output of 1 if all previous flip-flop outputs are 1's.
The circuit shown in Figure below consists of four flip-flops and their outputs are QA, QB, QC, and
QE respectively. The PRESET input of the last fl ip-fl op and the CLEAR inputs of the other three
fl ip-fl ops are connected together. Now, by applying a LOW pulse at this line, the last fl ip-fl op
is SET and all the others are RESET, i.e., QAQBQCQE = 0001. Hence, from the circuit it is clear
that DA = 1, DB = 0, DC = 0, and DE = 0. Therefore, when a clock pulse is applied, the first flip-
flop is set to 1, while the other three flip-flops are reset to 0 i.e., the output of the ring counter is
QAQBQCQE = 1000. Similarly, when the second clock pulse is applied, the 1 in the
The main advantage of this type of ring counter is that it only needs half the number of flip-flops
compared to the standard ring counter i.e its modulo number is halved. So a “n-stage” Johnson
counter will circulate a single data bit giving sequence of 2n different states and can therefore be
considered as a “mod-2n counter”.
Operation:
This inversion of Q before it is fed back to input D causes the counter to “count” in a different
way. Instead of counting through a fixed set of patterns like the normal ring counter such as for a
4-bit counter, “0001”(1), “0010”(2), “0100”(4), “1000”(8) and repeat, the Johnson counter counts
up and then down as the initial logic “1” passes through it to the right replacing the preceding logic
“0”.
Now we take into consideration the propagation delays through the gates. The change in x1 will
probably be observed at point p before it will be seen at point q. This is since the path from x1 to
q has an extra NOT gate in it. Hence the signal at p will become 0 before the signal at q becomes
equal to 1. Thus, for a short time both p and q will be zero. This causes f to drop to 0 before it can
recover back to 1. This gives rise to a static 1-hazard.
1. Design a synchronous counter that counts the sequence 0,2,3,7 and so on.
Solution:
Note: Usually unused states are either directed to starting of the counter or end of counter
Step 2: The flip-flops is three and let us assume that J-K flip flops are used.
Three flip-flops are required to represent eight unique states.
Step 3: The excitation table is basically a truth table that gives the necessary J and K inputs to
enable a change in the current output Q to next state Q+. The table below shows the general
excitation table for a J-K flip-flop (with don’t care conditions, X).
Step 4: Using the excitation table, we can obtain the K-maps for each input as shown in the figure
below where present states should be used to draw the K-maps.
K-map construction
Excitation table
Review Questions
1. What is a shift register? Explain the operation of the Serial-In Serial-Out shift register with
its circuit diagram and timing diagram.
2. Design a 3-bit synchronous binary up counter using JK flip-flop.
3. Describe the read and write operation in RAM with a diagram. Draw a circuit for a 6-bit
SIPO shift register.
4. Design a counter with the following binary sequence 0,1,3,2,6,4,5,7 and repeat. Using T
flip-flop.
5. Design a BCD synchronous up counter using a T-flip-flop.
6. What is a counter? Differentiate between serial in serial out register and parallel in serial
out register with associated diagram.
7. What are the major five differences between synchronous and asynchronous counters?
Design a 4-bit up-down binary counter.
8. Design a MOD 11 asynchronous counter using J K flip-flop and show its working, counting
sequence, and timing diagram.
9. Design a synchronous 4-bit binary up counter using a T flip-flop that counts all possible
odd numbers.
19. Design a sequential circuit using T flop-flip the state diagram is shown below.
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.
Figure 1 Block diagram of a memory unit showing communication with the environment
2 Random-access Memories
The internal construction of random-access memory of m words with n bits per word consists
of m × n binary storage cells and the associated logic for selecting individual words. The binary
storage cell is the basic building block of a memory unit. IC RAMs are constructed internally with
cells having a wired-OR capability. The figure below shows an IC RAM which consists of 2 words
of 3 bits each, for a total of 6 binary cells.
3 Processor Unit
The processor is an important part of a digital computer that performs the various operations in the
system. It may consist of Arithmetic, logical units, control unit, and registers. Different operations
are executed by arithmetic and logic units stored in the register using the instruction set
architecture.
The four data inputs from A are combined with the four inputs from B to generate an operation at
the F outputs. The mode selects inputs S2 distinguishes between arithmetic and logic operations.
the two functions’ select inputs S1 and S0 specify the particular arithmetic or logic operations to
be generated. With three selection variables, it is possible to specify four arithmetic operations
(with S2 in one state) and four logic operations (with S2 in another state). The input and output
carries have meaning only during arithmetic operations.
4 Arithmetic Circuit design
Design and adder subtractor circuit with one selection variable and two inputs A and B where S=0,
the circuit performs A+B, and when S=1 circuit performs A-B.
Step 1: General Circuit
Xi Yi Xi Yi
S A B Xi Yi
0 0 0 0 1
0 0 1 0 0
0 1 0 1 1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 0
1 1 0 1 1
1 1 1 1 0
AB 00 01 11 10
S
0 0 1 1 0
1 1 0 0 1
Yi = S’B+SB’=S XOR B
Xi = A
S= Cin
Step 5: Final Circuit Diagram
Example: Design a logic circuit, which can perform following logic operation.
1. OR 5. NOT A
2. NOR 6. NOT B
3. AND 7. X-OR
4. NAND 8. X-NOR
Solution:
For 8 function we use 3 selection line, i.e S2, S1,S0 and input A, B.
Function Table:
Function Output Function
Selection Equals
S2 S1 S0
0 0 0 A+B OR
0 0 1 ̅̅̅̅̅̅̅̅
𝐴+𝐵 NOR
0 1 0 A.B AND
0 1 1 ̅̅̅̅̅
𝐴. 𝐵 NAND
1 0 0 𝐴̅ NOT A
1 0 1 𝐵̅ NOT B
1 1 0 𝐴⨁𝐵 XOR
1 1 1 𝐴⨀𝐵 XNOR
The circuit whose one stage is given in the below diagram provides 8 arithmetic operations, 4 logic
operations, and 2 shift operations, and Each operation is selected by the 5 variables S3, S2, S1, S0,
and Cin. The table shows the 14 operations perform by the Arithmetic Logic Unit:
➢ Bit C is set if the output carry of the ALU is 1. It is cleared if the output carry is 0.
➢ Bit S is set if the highest-order bit of the result in the output of the ALU is 1. It is cleared
if the highest-order bit is 0.
➢ Bit Z is set if the output of the ALU contains all 0’s and cleared otherwise.
➢ Bit V is set if exclusive-OR of carries C8 and C9 is 1, and cleared otherwise. This is the
condition for overflow when the numbers are in sign 2’s complement representation. For
the 8-bit ALU, V is set if the result is greater than 127 or less than -128.
4.6 Shifter:
The shift unit attached to a processor transfers the output of the ALU onto the output bus. The
shifter may transfer the information directly without a shift or it may shift the information to the
4.7 Accumulator
Some processor unit distinguish one register from all other and called the accumulator register.
Accumulator register is essentially bi-directional shift register with parallel load which is corrected
to an ALU, the accumulator register and its associated logic when taken as one unit constitute a
sequential circuit. The register A in the figure is referred to as accumulator and is sometimes
denoted by the symbol AC. The external input to the accumulator are the data inputs and ontrol
variables determine the micro-operation for the register. An accumulator is a multifunction register
that by itself can be made to perform all the micro-operation of the processor unit.
Solution:
The basic components of logical circuit are AND, OR, XOR and NOT gate circuits connected
accordingly. Below figure shows a circuit that generates four basic logic micro-operations. It
consists of four gates and a multiplexer. Each of four logic operations is generated through a gate
that performs the required logic. The two selection input S1 and S0 choose one of the data inputs
of the multiplexer and directs its value to the output. Functional table lists the logic operations.
Below figure shows a combined circuit of ALU where n data input from A are combined with n
data input from B to generate the result of an operation at the G output line. ALU has a number of
selection lines used to determine the operation to be performed. The selection lines are decoded
with the ALU so that selection lines can specify distinct operations. The mode select S2
differentiate between arithmetic and logical operations. The two functions select S1 and S0 specify
the particular arithmetic and logic operations to be performed. With three selection lines, it is
possible to specify arithmetic operation with S2 at 0 and logical operation with S2 at 1.
Review Questions
1. Design a 4-bit arithmetic circuit that performs eight different operations. With the help of
a diagram explain how Read/Write operations is performed in RAM.
2. Design an arithmetic circuit with one selection variable and two data inputs A and B, when
S=0, the circuit performs the addition operation F=A+B when S=1, the circuit performs the
addition operation F=A+1(only show the block diagram).
7. What do you mean by ALU? Design an arithmetic circuit to implement the following
function table A and B are 4 bit binary numbers
8. Explain the process how does binary value of 4 flags in status register change with
necessary diagram.
1. Status Register
2. Nibble Adder
3. Master Slave F/F
4. PLA
5. Output Hazards Races
Declaration: This document is prepared for academic purposes only, contents from different
sources are subject to their own copyright.