Digital Logic Fundamentals Notes Unit 1 and 2
Digital Logic Fundamentals Notes Unit 1 and 2
Semester - 1
Unit-1: Introduction
Digital Systems – Binary Numbers – Conversions – Types – Codes – Storage and Registers – Binary Logic –
Boolean Algebra Theorems and Properties – Functions – Canonical andStandard Forms – Other Logic Operations
– Digital Logic Gates
Digital System
A Digital system is an interconnection of digital modules and it is a system that manipulatesdiscrete elements
of information that is represented internally in the binary form. Now a day’s digital systems are used in 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.
Number System-Binary, Octal, Decimal, Hexadecimal - Conversion from one system toanother number system.
Number :
The way of quantifying anything , represented through various combination of symbolsis called number.
Digit :
The various symbols representing a single number in any number system is called digit.
E.g. Decimal number system (Arabic numerals): Digits: 0,1,2,3,4,5,6,7,8,9.
Radix / Base (r) :
The maximum number of different digits of any number system. E.g Decimal NS, r =10
Number system:
The properly structured number formation is called Number system. In number systemthere are different
symbols and each symbol has an absolute value and also has place value.
In general a number in a system having base or radix ‘ r ’ can be written asNumber various
↑ Radix point
N10 = dnx rn + dn-1x rn-1 +...+ d1x r1 + d0x r0 + d-1x r-1 + d-2x r-2 +...+ d-mx r-m
* The right most digit of any number is called Least Significant Digit
* The lef most digit of any number is called Most Significant Digit
The decimal number system contain ten unique symbols 0,1,2,3,4,5,6,7,8 and 9.
Its base 8 = 23 , every 3- bit group of binary can be represented by an octal digit.
(a) Binary to decimal conversion:- In this method, each binary digit of the number is multiplied by its
positional weight and the product terms are added to obtain decimalnumber.
(b) Binary to Octal conversion:- For conversion binary to octal the binary numbers are divided into groups of 3
bits each, starting at the binary point and proceeding towards leftand right.
(c) Binary to Hexadecimal conversion:- For conversion binary to hexadecimal number the binary numbers
starting from the binary point, groups are made of 4 bits each, on either side of the binary point.
(a) Decimal to binary conversion:- In the conversion the integer number are converted to thedesired base using
successive division by the base or radix.
Decimal to octal conversion:- To convert the given decimal integer number to octal,successively divide the given
number by 8 till the quotient is 0.
(b) Decimal to hexadecimal conversion:-
(a) Octal to binary conversion:- To convert a given a octal number to binary, replace eachoctal digit by its 3-
bit binary equivalent.
(b) Octal to decimal conversion:- For conversion octal to decimal number, multiply each digitin the octal
number by the weight of its position and add all the product terms
(c) Octal to hexadecimal conversion:- For conversion of octal to Hexadecimal, first convert the given octal
number to binary and then binary number to hexadecimal
(4) HEXADECIMAL NUMBER SYSTEM :- (a)Hexadecimal to binary conversion:- For conversionof hexadecimal to
binary, replace hexadecimal digit by its 4 bit binary group
(b)Hexadecimal to decimal conversion:- For conversion of hexadecimal to decimal, multiplyeach digit in the
hexadecimal number by its position weight and add all those product terms.
((c) Hexadecimal to Octal conversion:- For conversion of hexadecimal to octal, first convertthe given
hexadecimal number to binary and then binary number to octal
2. BINARY SUBTRACTION:-
3. BINARY MULTIPLICATION:-
The binary division is very simple and similar to decimal number system.So we have only 2
rules 0 ÷ 1 = 0 1÷1=1
The 1’s complement of a binary number is obtained by changing each 0 to 1 and each 1 to0.
The 2’s complement of a binary number is a binary number which is obtained by adding 1 tothe 1’s complement
of a number.
In sign – magnitude form, additional bit called the sign bit is placed in front of the number.If the sign bit is 0,
the number is positive. If it is a 1, the number is negative.
1’s COMPLEMENT:-
In 1’s complement subtraction, add the 1’s complement of subtrahend to the minuend. If there is a carry out,
then the carry is added to the LSB. This is called end around carry. If theMSB is 0, the result is positive. If the
MSB is 1, the result is negative and is in its 1‘s complement form. Then take its 1’s complement to get the
magnitude in binary.
2’s COMPLEMENT:-
In 2’s complement subtraction, add the 2’s complement of subtrahend to the minuend. If there is a carry out,
ignore it. If the MSB is 0, the result is positive. If the MSB is 1, the resultis negative and is in its 2‘s complement
form. Then take its 2’s complement to get the magnitude in binary.
Digital Code & its Types
DIGITAL CODES:-
In practice the digital electronics requires to handle data which may be numeric, alphabets and special
characters. This requires the conversion of the incoming data into binary formatbefore it can be processed.
There is various possible ways of doing this and this process is called encoding. To achieve the reverse of it, we
use decoders.
1) Weighted binary codes : In weighted codes, for each position ( or bit) ,there is specific weight attached. For
example, in binary number, each bit is assigned particular weight 2n where ‘n’ is the bit number for n =
0,1,2,3,4 the weights are 1,2,4,8,16 respectively. Example
:- BCD
Non-weighted codes are codes which are not assigned with any weight to each digit position, i.e., each digit
position within the number is not assigned fixed value. Example:-Excess – 3 (XS -3) code and Gray codes
BINARY CODED DECIMAL (BCD):- BCD is a weighted code. In weighted codes, each successive digit from right
to left represents weights equal to some specified value and to get the equivalent decimal number add the
products of the weights by the corresponding binary digit. 8421 is the most common because 8421 BCD is the
most natural amongst theother possible codes.
BCD ADDITION:-
Addition of BCD (8421) is performed by adding two digits of binary, starting from least significant digit. In case
if the result is an illegal code (greater than 9) or if there is a carry outof one then add 0110(6) and add the
resulting carry to the next most significant.
BCD SUBTRACTION:-
The BCD subtraction is performed by subtracting the digits of each 4 – bit group of the subtrahend from
corresponding 4 – bit group of the minuend in the binary starting from theLSD. If there is no borrow from the
next higher group[ then no correction is required. If there is a borrow from the next group, then 6 (0110) is
subtracted from the difference term of this group.
EXCESS THREE(XS-3) CODE:-
The Excess-3 code, also called XS-3, is a non- weighted BCD code. This derives it name from the fact that each
binary code word is the corresponding 8421 code word plus 0011(3). It is a sequential code. It is a self
complementing code.
Excess-3 code is non-weighted and self complementary code. A self complementary binary codes are always
compliment themselves. The complement of a binary number can be obtained from that number by replacing
0’s with 1’s and 1’s with 0’s. The sum of binary number and its complement is always equal to decimal 9. In
other words, the 1’s complement of an excess-3 code is the excess-3 code for the 9’s complement of the
corresponding decimal number. For example, the excess-3 code for decimal number 5 is 1000 and 1’s
complement of 1000 is 0111, which is excess-3 code for decimal number 4, and it is 9’s complement of number
5.
ASCII CODE:-
The American Standard Code for Information Interchange (ASCII) pronounced as ‘ASKEE’ is widely used
alphanumeric code. This is basically a 7 bit code. The number of different bit patterns that can be created with
7 bits is 27 = 128 , the ASCII can be used to encode both the uppercase and lowercase characters of the
alphabet (52 symbols) and some special symbols in addition to the 10 decimal digits. It is used extensively for
printers and terminals that interface with small computer systems. The table shown below shows the ASCII
groups.
GRAY CODE:-
The gray code is a non-weighted code. It is not a BCD code. It is cyclic code because successive words in this
differ in one bit position only i.e it is a unit distance code. Gray codeis used in instrumentation and data
acquisition systems where linear or angular displacement is measured.
Law 2: A ( A + B) = A
Proof : A ( A + B)
=A∙A+A∙B
= A + AB
= A(1 + B)
=A∙1=A
Law 2: ¯𝐴¯¯.¯𝐵¯ = 𝐴¯ + 𝐵
¯
This law states that the complement of a product of variables is equal to the sum oftheir individual
complements.
Canonical and Standard Form
Canonical Form – In Boolean algebra, the Boolean function can be expressed as Canonical Disjunctive Normal
Form known as minterm and some are expressed as Canonical Conjunctive Normal Form known as maxterm.
In Minterm, we look for the functions where the output results in “1” while in Maxterm we look for functions
where the output results in “0”.
We perform the Sum of minterm also known as the Sum of products (SOP).
We perform Product of Maxterm also known as Product of sum (POS).
PRODUCTS FORM:-
This is also called disjunctive Canonical Form (DCF) or Expanded Sum of Products Formor Canonical Sum
of Products Form.
In this form, the function is the sum of a number of products terms where eachproduct term
contains all variables of the function either in complemented or uncomplemented form.
The or product term which contains all the variables of the functions either incomplemented
uncomplemented form is called a minterm.
The minterm is denoted as mo, m1, m2 … . An ‘n’ variable function can have 2n
minterms.
AND GATE:-
An AND gate has two or more inputs but only one output.
The output is logic 1 state only when each one of its inputs is at logic 1 state.
The output is logic 0 state even if one of its inputs is at logic 0 state.
OR GATE:-
An OR gate may have two or more inputs but only one output.
The output is logic 1 state, even if one of its input is 1
The output is logic 0 state, only when each one of its inputs is in logic state.
NAND GATE:-
NAND gate is a combination of an AND gate and a NOT gate.
The output is logic 0 when each of the input is logic 1 and for any other combinationof inputs, the
output is logic 1.
IC No.:- 7400 two input NAND gate
NOR GATE:-
NOR gate is a combination of an OR gate and a NOT gate.
The output is logic 1, only when each one of its input is logic 0 and for any othercombination of
inputs the output is a logic 0 level.
IC No.:- 7402 two input NOR gate
The simplification of Boolean expressions using Boolean algebraic rules is not unique and most of the cases,
the resultant expression is not in minimal form. In order to get the uniqueness and final minimal form, K-map
technique will be used.
The K- map is a chart or a graph, composed of an arrangement of adjacent cells, each representing a
particular combination of variables in sum or product form
. The K- map is systematic method of simplifying the Boolean expression.
Mapping of SOP Expression:-
The n variable K-map has 2n squares. These squares are called cells.
A ‘1’ is placed in any square indicates that corresponding minterm is included in the output expression,
and a 0 or no entry in any square indicates that the corresponding minterm does not appear in the
expression for output.
2 Variable K-map
There is a total of 4 variables in a 2-variable K-map. There are two variables in the 2-variable K-map. The
following figure shows the structure of the 2-variable K-map:
o In the above figure, there is only one possibility of grouping four adjacent minterms.
o The possible combinations of grouping 2 adjacent minterms are {(m0, m1), (m2, m3), (m0, m2) and (m1, m3)}.
The 3-variable K-map is represented as an array of eight cells. In this case, we used A, B, and C for the
variable. We can use any letter for the names of the variables. The binary values of variables A and B are along the
left side, and the values of C are across the top. The value of the given cell is the binary values of A and B at left side
in the same row combined with the value of C at the top in the same column. For example, the cell in the upper left
corner has a binary value of 000, and the cell in the lower right corner has a binary value of 101.
The 4-Variable Karnaugh Map
The 4-variable K-map is represented as an array of 16 cells. Binary values of A and B are along the left side,
and the values of C and D are across the top. The value of the given cell is the binary values of A and B at left side in
the same row combined with the binary values of C and D at the top in the same column. For example, the cell in the
upper right corner has a binary value of 0010, and the cell in the lower right corner has a binary value of 1010
We group the number of ones in the decreasing order. First, we have to try to make the group of eight, then for
four, after that two and lastly for 1.
In horizontally or vertically manner, the groups of ones are formed in shape of rectangle and square. We cannot
perform the diagonal grouping in K-map.
We can consider the 'don't care condition' only when they aid in increasing the group-size. Otherwise, 'don't
care' elements are discarded.
Step 4:
In the next step, we find the boolean expression for each group. By looking at the common variables in cell-labeling, we define the groups in terms
of input variables. In the below example, there is a total of two groups, i.e., group 1 and group 2, with two and one number of 'ones'.
In the first group, the ones are present in the row for which the value of A is 0. Thus, they contain the complement of variable A. Remaining two
'ones' are present in adjacent columns. In these columns, only B term in common is the product term corresponding to the group as A'B. Just like
group 1, in group 2, the one's are present in a row for which the value of A is 1. So, the corresponding variables of this column are B'C'. The overall
product term of this group is AB'C'.
Step 5:
Lastly, we find the boolean expression for the Output. To find the simplified boolean expression in the SOP form, we combine the product-terms of
all individual groups. So the simplified expression of the above k-map is as follows:
A'+AB'C'
Let's take some examples of 2-variable, 3-variable, 4-variable, and 5-variable K-map examples.
1. We will populate the K-map by entering the value of 0 to each sum-term into the K-map cell and fill the
remaining cells with one's.
2. We will make the groups of 'zeros' not for 'ones'.
3. Now, we will define the boolean expressions for each group as sum-terms.
4. At last, to find the simplified boolean expression in the POS form, we will combine the sum-terms of all
individual groups.
Let's take some example of 2-variable, 3-variable, 4-variable and 5-variable K-map examples
Example 1: Y=(A'+B')+(A'+B)+(A+B)
The Implementation of OR Gate from NAND Gate is executed by using De Morgan’s theorem, which asserts that
the complement of the AND operation is equivalent to the NAND operation, so that it can be used to construct
an OR gate by using NAND gates. So that We can effectively execute the functionality of an OR gate by
combining numerous NAND gates in a particular arrangement. So that we can implement an OR Gate by using
NAND Gates.
What is XOR Gate?
XOR gate is a logic gate that results in an output high with an odd number of high inputs. In other words, if the
number of 1’s is odd in the input then, the output of XOR is 1. XOR gate gives output 1 when all the inputs are
different. The XOR is represented as ⊕.
XOR Gate
In the above table if the inputs are different then the output is 1 otherwise 0.