DPCO Unit 1 Notes
DPCO Unit 1 Notes
Number Systems - Arithmetic Operations - Binary Codes- Boolean Algebra and Logic Gates - Theorems and
Properties of Boolean Algebra - Boolean Functions - Canonical and Standard Forms - Simplification of Boolean
Functions using Karnaugh Map - Logic Gates – NAND and NOR Implementations.
Introduction
Basically there are two types of signals in electronics,
i) Analog
ii) Digital
Digital systems
Advantages:
❖ The usual advantages of digital circuits when compared to analog circuits are:Digital systems
interface well with computers and are easy to control with software. New features can often be added
to a digital system without changing hardware.
❖ Often this can be done outside of the factory by updating the product's software. So, the product's
design errors can be corrected after the product is in a customer's hands.
❖ Information storage can be easier in digital systems than in analog ones. The noise- immunity of
digital systems permits data to be stored and retrieved without degradation.
❖ In an analog system, noise from aging and wear degrade the information stored.
❖ In a digital system, as long as the total noise is below a certain level, the information can be recovered
perfectly.
Disadvantages:
❖ In some cases, digital circuits use more energy than analog circuits to accomplish the same tasks, thus
producing more heat as well. In portable or battery-powered systems this can limit use of digital
systems.
❖ Digital circuits are sometimes more expensive, especially in small quantit ies.The sensed world is
analog, and signals from this world are analog quantities.
❖ Digital circuits are sometimes more expensive, especially in small quantities. The sensed world is
analog, and signals from this world are analog quantities.
❖ For example, light, temperature, sound, electrical conductivity, electric and magnetic fields are
analog.
Page 1
REVIEW OFNUMBER SYSTEMS
Many number systems are in use in digital technology. The most common are the decimal, binary,
octal, and hexadecimal systems. The decimal system is clearly the most familiar to us because it is tools
that we use every day.
Page 2
Code Conversion:
❖ Convertingfromonecodeformtoanothercodeformiscalledcodeconversion,likeconvertingfrom binaryto
decimal orconverting from hexadecimal to decimal.
Binary-To-DecimalConversion:
Anybinarynumbercanbeconvertedtoitsdecimalequivalent simplybysummingtogether
theweights of the variouspositions in the binarynumber whichcontaina1.
Binary Decimal
110112
=24+23+01+21+20 =16+8+0+2+1
Result 2710
Binary to octal:
Example: 100 1110102=(100)(111)(010)2=4 7 28
Octal to Binary:
Decimal to octal:
Division Result Binary
177/8 =22+remainder of1 1 (LeastSignificantBit)
22/ 8 =2 +remainder of6 6
2/8 =0 +remainder of2 2 (Most Significant Bit)
Result 17710 =2618
Binary =0101100012
Page 3
Octal to Decimal:
Example:
Decimal to Hexadecimal:
Binary-To-Hexadecimal:
Example: 1011 0010 11112= (1011) (0010) (1111)2=B2F16
Hexadecimal to binary:
Octal Hexadecimal
=2 6 5 0
= 010 110101000 =0101 1010 1000(Binary)
Result =(5A8)16
Page 4
Hexadecimal to octal:
Hexadecimal Octal
(5A8)16 =0101 1010 1000(Binary)
=010 110101000(Binary)
Result =2 6 5 0(Octal)
❖ Complements are used in digital computers to simplify the subtraction operation and for logical
manipulation.
❖ ThereareTWOtypesofcomplementsforeachbase-rsystem: theradixcomplementand the diminished
radix complement.
❖ The first is referred to as there’s complement and the second as the (r-
1)'scomplement,whenthevalueofthebaserissubstitutedinthename.Thetwo typesarereferredtoasthe
2's complement and 1's complement for binary numbers and the 10’s complement and 9's
complement for decimal numbers.
Note:
▪ The1 ’ scompl ement ofabinarynumberi sthenumbert hat result sw henw echangeall 1
’ s to zeros and the zeros t o ones.
▪ The2 ’ s complement is the bi nary number t hat result s whenweadd 1 t o the 1’ s
compl ement .
▪ I t is used t o represent negati venumbers.
0111
Page 5
Radix Complement:
The r’s complement of an n-digit number N in base r is defined as rn - N for N≠0 and as 0
for N = 0.
For examples:
The10’scomplementof 012398 is 987602
The10’scomplementof246700 is 753300
Model 2:
Using10’scomple ment, subtract3250-72532.
M = 03250
10>s comp le me ntofN = +27468
Sum = 30718
Model 3:
Given the two binary numbers X = 1010100andY= 1000011, performthesubtraction
(a)X-Y and (b) Y-Xbyusing2’scomple ments. [NOV – 2019]
(a) X= 1010100
2’s comp le me ntofY= + 0111101
Sum = 10010001
Discard endcarry27 = -10000000
Answer:X-Y= 0010001
(b) Y= 1000011
Page 6
Model 4:
Given the two binary numbers X=1010100 and Y= 1000011, perform the subtraction (a) X-Y and
(b) Y-X by using 1’s complements. (Dec 2009)
(a)X-Y= 1010100-1000011
X= 1010100
1’s complementofY= +0111100
Sum = 10010000
End around carry = + 1
Answer:X-Y= 0010001
(b)Y-X= 1000011-1010100
Y= 1000011
1’s complement of X= +0101011
Sum = 1101110
There is no end carry. Therefore ,the answer is Y- X=-(1’s comp le me ntof1101110)=
-0010001.
**********************************************
ARITHMETIC OPERATIONS
Binary Addition:
Example:
Add: 00011010+00001100=00100110
1 1
0 0 0 1 1 0 1 0
+0 0 0 0 1 1 0 0
0 0 1 0 0 1 1 0
Page 7
Binary Subtraction:
• 0 -0 =0
• 0 -1 =1,and borrow 1fromthe nextmoresignificantbit
• 1 -0 =1
• 1 -1 =0
Example:
Sub: 00100101-00010001= 00010100
0 0 1 0 0 1 0 1
-0 0 0 1 0 0 0 1
0 0 0 1 0 1 0 0
Binary Multiplication:
RulesofBinaryMultiplication
• 0 x 0 =0
• 0 x 1 =0
• 1 x 0 =0
• 1 x 1 =1,andnocarryorborrowbits
Page 8
Binary Division:
Binarydivisionisthe repeatedprocess ofsubtraction,justasindecimaldivision.
Example: Divide the following
************************************************
BINARYCODES
Explain the various codes used in digital systems with an example.(or)Explain in detail about Binary
codes with an example
➢ In digital systems a variety of codes are used to serve different purposes, such as data entry, arithmetic
operation, error detection and correction, etc.
➢ Selection of a particular codedepends on the requirement.
➢ Binarycodesarecodeswhicharerepresentedinbinarysystemwithmodification from the original ones.
➢ Codes can be broadly classified into five groups.
(i) Weighted Binary Codes
(ii) Non-weighted Codes
(iii) Error-detection Codes
(iv) Error-correcting Codes
(v) Alphanumeric Codes
Weighted Binary Codes
➢ If each position of a number represents a specific weight then the coding scheme is called weighted
binary code.
BCD Code or 8421 Code:
➢ The full form of BCD is ‘Binary-Coded Decimal’. Since this is a coding scheme relating decimal and
binary numbers, four bits are required to code each decimal number.
Page 9
➢ A decimal number in BCD (8421) is the same as its equivalent binary number only when the number
is between 0 and 9. A BCD number greater than 10 looks different from its equivalent binary number,
even though both contain 1’s and 0’s. Moreover,the binary combinations 1010 through 1111 are not
used and have no meaning in BCD.
➢ Consider decimal 185 and its corresponding value in BCD and binary:
➢ For example, (35)10 is represented as 0011 0101 using BCD code, rather than (100011)2
➢ Example: Give the BCD equivalent for the decimal number 589.
The decimal number is 5 8 9
BCD code is 0101 1000 1001
Hence, (589)10 = (010110001001)BCD
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 from5 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.
BCD Addition:
Examples:
❖ Consider the addition of 184 + 576 = 760 in BCD:
❖ Add the following BCD numbers: (a) 1001 and 0100, (b) 00011001 and 00010100
Page 10
Non-weighted Codes
➢ 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.
Excess-3 code:
❖ Excess-3isanon- weightedcodeusedtoexpressdecimalnumbers.Thecodederivesitsnamefrom
the fact that each binary code is the corresponding 8421 code plus 0011(3).
Page 11
Gray code:
❖ The gray code belongs to a class of codes called minimum change codes, in which
only one bit in the code changes when moving from one code to the next.
❖ The Gray code is non-weighted code, as the position of bit does not contain any
weight. In digital Gray code has got a special place.
Decimal Binary Code Gray
Number Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
❖ The gray code is a reflective digital code which has the special property that any two
subsequent numbers codes differ by only one bit. This is also called a unit-distance code.
❖ Important when an analog quantity must be converted to a digital representation. Only one bit
changes between two successive integers which are being coded.
Example:
Binary to Gray Code Conversion:
Any binary number can be converted into equivalent Gray code by the following steps:
i) the MSB of the Gray code is the same as the MSB of the binary number;
ii) the second bit next to the MSB of the Gray code equals the Ex-OR of the MSB and 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;
iii) 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.
Page 12
Gray Code to Binary Code Conversion:
Any Gray code can be converted into an equivalent binary number by the following steps:
i. The MSB of the binary number is the same as the MSB of the Gray code.
ii. the second bit next to the MSB of the binary number equals the Ex-OR of the MSB of the binary
number and second bit of the Gray code; it will be 0 if there are same binary bits or it will be 1
for different binary bits;
iii. the third bit for the binary number equals the exclusive-OR of the second bit of the binary number
and third bit of the Gray code, and similarly all the next lower order bits follow the same
mechanism.
Twotypes ofparity
➢ Evenparity:Checksifthereisanevennumberofones;ifso,paritybitiszero.Whenthenumberof
one’sisoddthenparitybitissetto 1.
➢ OddParity:Checksifthereisanoddnumberofones;ifso,paritybitiszero. Whenthenumberof
one’siseventhenparitybitis set to 1.
Errorcorrectingcode
➢ Error-correctingcodesnotonlydetecterrors,butalsocorrectthem.
➢ Thisisused normallyinSatellite communication,whereturn-arounddelayisveryhighasisthe
Page 13
probabilityofdata gettingcorrupt.
Hamming codes
➢ Hammingcodeaddsaminimumnumberofbitstothedatatransmitted inanoisychannel,tobeableto
correct everypossible one-bit error.
➢ It candetect(not correct)two-biterrorsandcannotdistinguish between1-bitand2-bits
inconsistencies. Itcan't- ingeneral-detect 3(ormore)-bits errors.
Alphanumeric Codes
➢ An alphanumeric code is a binary code of a group of elements consisting of ten decimal digits, the
26 letters of the alphabet (both in uppercase and lowercase), and a certain number of special
symbols such as #, /, &, %, etc.
EBCDIC codes
➢ EBCDICstandsforExtendedBinary CodedDecimalInterchange.
➢ It is also an alphanumeric code generally used in IBM equipment and in large computersfor
communicating alphanumeric data.
➢ For the different alphanumeric characters the code grouping in this code is different from the
ASCII code. It is actually an 8-bit code and a ninth bit is added as the parity bit.
******************************************************
Page 14
Boolean Algebra and Theorems
Page 15
a . (b + c) = (a . b) + (a . c)
Duality Principle:
The duality principle states that every algebraic expression deducible from the postulates of
Boolean algebra remains valid if the operators and identity elements are interchanged. If the dual of an
algebraic expression is desired, we simply interchange OR and AND operators and replace 1’s b y 0’s and
0’s by 1’s.
DeMorgan’s theorem:
1. The complement of product is equal to the sum of their complements. (X.Y)’=X’+Y’
2. The complement of sum is equal to the product of their complements. (X+Y)’ = X’.Y’
Basic Theorems:
State and prove postulates and theorems of Boolean algebra.
Page 16
***************************************
Page 17
Boolean Functions
❖ Boolean algebra is an algebra that deals with binary variables and logic operations. A Boolean
function described by an algebraic expression consists of binary variables, the constants 0 and 1, and
the logic operation symbols.
❖ For a given value of the binary variables, the function can be equal to either 1 or 0.
Complement of a function:
The complement of a function F is obtained from an interchange of 0’s for 1’sand 1’s for 0’s in the value
of F.
Example:
1.
Page 18
2. Find the complement of the functions F1 = x’yz’ + x’y’z and F2 = x(y’z’ + yz).
By applying DeMorgan’s theorems as many times as necessary, the complements areobtained as
follows:
3. Find the complement of the functions F1 = x’yz’ + x’y’z and F2 = x(y’z’ + yz) by taking their
duals and complementing each literals.
Solution:
****************************************************
Canonical and Standard forms:
Explain canonical SOP & POS form with suitable example.
➢ Binary logic values obtained by the logical functions and logic variables are in binary form. An
arbitrary logic function can beexpressed in the following forms.
(i) Sum of the Products (SOP)
(ii) Product of the Sums (POS)
➢ Boolean functions expressed as a sum of minterms or product of maxterms are said to be in
canonical form.
Product term:
The AND function is referred to as a product. The variable in a product term can appear either in
complementary or uncomplimentary form. Example: ABC’
Sum term:
The OR function is referred to as a Sum. The variable in a sum term can appear either in
complementary or uncomplimentary form. Example: A+B+C’
Sum of Product (SOP):
The logical sum of two or more logical product terms is called sum of product expression. It is
basically an OR operation of AND operated variables. Example: Y=AB+BC+CA
Product of Sum (POS):
The logical product of two or more logical sum terms is called product of sum expression. It is
basically an AND operation of OR operated variables. Example: Y=(A+B).(B+C).(C+A)
Page 19
Minterm:
A product term containing all the K variables of the function in either complementary or
uncomplimentary form is called Minterm or standard product.
Maxterm:
A sum term containing all the K variables of the function in either complementary or
uncomplimentary form is called Maxterm or standard sum.
Page 20
Combining all terms, we have
F = A + B’C =ABC + ABC’ + AB’C + AB’C’ + A’B’C
But AB’C appears twice, and according to theorem 1 (x + x = x), it is possible toremove one of
those occurrences. Rearranging the minterms in ascending order, wefinally obtain
F = A’B’C + AB’C’+ AB’C + ABC’ + ABC= m1 + m4 + m5 + m6 + m7
F(A, B, C) = ∑(1, 4, 5, 6, 7)
Example:Obtain the canonical sum of product form of the following function. (May 2014)
Page 21
Example:
Obtain the canonical product of the sum form of the following function.
F (A, B, C) = (A + B′) (B + C) (A + C′) (Dec 2012)
Solution:
*********************************
❖ Using Boolean algebra to simplify Boolean expressions can be difficult. The Karnaugh map provides
a simple and straight- forward method of minimizing Boolean expressions which represent
combinational logic circuits.
❖ A Karnaugh map is a pictorial method of grouping together expressions with common factors and
then eliminating unwanted variables.
❖ A Karnaugh map is a two-dimensional truth-table. Note that the squares are numbered so that the
binary representations for the numbers of two adjacent squares differ in exactly one position.
• If A is a variable that has value 0 in all of the squares in the grouping, then the complemented
form A is in the product term.
• If A is a variable that has value 1 in all of the squares in the grouping, then the true form A is in
the product term.
Page 22
• If A is a variable that has value 0 for some squares in the grouping and value 1 for others, then it
is not in the product term
K-Maps of 2 Variables:
K-Maps of 3 Variables:
❖ Simplify the boolean function F (x, y, z) =
Page 23
K-Maps of 4 Variables:
Page 24
Note:
The Karnaugh map uses the following rules for the simplification of expressions by grouping
together adjacent cells containing ones
Page 25
• Groups must contain 1, 2, 4, 8, or in general 2n cells. That is if n = 1, a group will contain
two 1's since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.
Page 26
• Groups may overlap.
• There should be as few groups as possible, as long as this does not contradict any of the
previous rules.
Summmary:
1. No zeros allowed.
2. No diagonals.
3. Only power of 2 numbers of cells in each group.
4. Groups should be as large as possible.
5. Everyone must be in at least one group.
6. Overlapping allowed.
7. Wrap around allowed.
8. Fewest numbers of groups possible.
In certain digital systems, some input combinations never occur during the process of normal
operation because those input conditions are guaranteed never to occur. Such input combinations are
don’t care conditions.
Page 27
Completely specified functions:
If a function is completely specified, it assumes the value 1 for some input combinations and the
value 0 for others.
There are functions which assume the value 1 for some combinations and 0 for some other and
either 0 or 1 for the remaining combinations. Such a functions are called incompletely specified .
Prime Implicants:
**************************************
✓ From the set of prime implicants, a set of essential implicants must be determined by
preparing a prime implicant chart.
✓ The minterm which are not covered by the essentia l implicants are taken into
consideration and a minimum cover is obtained from the remaining prime implicants.
Step:1
Page 28
Step:2
Page 29
Step:3
Step:4
*************************************************
Logic gates
Explain about different types of logic gates.(OR) What are Universal gates? Construct any four basic
gates using only NOR gates and using only NAND gates. (May 2011)[NOV – 2019]
❖ A logic gate is an idealized or physical device implementing a Boolean function; that is, it performs a
logical operation on one or more logical inputs, and produces a single logical output.
Page 30
Truth Table
A truth table lists all possible combinations of input binary variables and the corresponding
outputs ofa logic system.
Universal Gates
❖ The OR, AND and NOT gates are the three basic logic gates as they together can be used to
construct the logic circuit for any given Boolean expression.
❖ The NOR and NAND gates have the property that they individually can be used to hardware-
implement a logic circuit corresponding to any given Boolean expression.
❖ That is, it is possible to use either only NAND gates or only NOR gates to implement any
Boolean expression. This is so because a combination of NAND gates or a combination of NOR
gates can be used to perform functions of any of the basic logic gates. It is for this reason that
NAND and NOR gates are universal gates.
Page 31
NAND gatesandNOR gatesarecalleduniversalgates or universalbuildingblocks, as any
type of gates or logic functions can be implemented by these gates. Figures
Symbolshowshow variouslogic functionscan be realizedby NAND gatesandFigures
Symbolshow therealizationofvariouslogic gatesby NOR gates.
NAND–NOR implementations:
AND gate:
Page 32
OR gate:
AND gate:
OR gate:
NAND–NOR implementations:
➢ Digital circuits are frequently constructed with NAND or NOR gates rather than with AND and
OR gates.
➢ NAND and NOR gates are easier to fabricate with electronic components and are the basic gates
used in all IC digital logic families.
➢ Because of the prominence of NAND and NOR gates in the design of digital c ircuits, rules and
procedures have been developed for the conversion from Boolean functions given in terms of
AND, OR, and NOT into equivalent NAND and NOR logic diagrams.
Page 33
NAND Implementation Procedure:
✓ Draw the AOI logic of given Boolean expression.
✓ Add bubble on input of OR gate & output of AND gate.
✓ Add an Inverter on each line that received bubbles.
✓ Eliminate double inversions
✓ Replace all by NAND gates
Example:
1. Implement F = AB + CD using only NAND gate.
2. Implement the following Boolean function with NAND gates:F (x, y, z) = (1, 2, 3, 4, 5, 7) (Apr
2018)
Page 34
3. Implement the function F = (AB’ + A’B)(C + D’) using only NAND gate.
Page 35
Page 36
Page 37
NOR Implementation Procedure:
Page 38
✓ Draw the AOI logic of given Boolean expression.
✓ Add bubble on input of AND gate & output of OR gate.
✓ Add an Inverter on each line that received bubbles.
✓ Eliminate double inversions
✓ Replace all by NOR gates
Example:
1. Implement F = (A + B)(C + D)E using only NOR gate. (Apr 2018)
Page 39
Page 40
Page 41
Page 42