1. ECE103 Logic Design
and Switching Theory
Text: Digital Design byText: Digital Design by
M. Morris Mano, 2M. Morris Mano, 2ndnd
EditionEdition
Prentice-Hall International, Inc.Prentice-Hall International, Inc.
2. Course Description
⢠This course presents the basic tools for
the design of digital circuits and provides
methods and procedures suitable for a
variety of digital design applications.
Course Pre-requisites
⢠Physics 12 General Physics 3
â (Electricity and Magnetism)
3. Course Content
⢠Binary Systems
⢠Boolean Algebra and Logic Gates
⢠Simplification of Boolean Functions
⢠Combinational Logic
⢠MSI and PLD Components
⢠Synchronous Sequential Logic
⢠Registers, Counters, and the Memory Unit
⢠Algorithmic State Machines (ASM)
⢠Asynchronous Sequential Logic
⢠Digital Integrated Circuits
⢠Laboratory Exercises
4. Expectations
⢠Upon successful completion of this course,
⢠You shall be able to:
⢠understand the nature of various numbering systems
⢠gain familiarity with the theorems and properties of
Boolean algebra â the basis of logic design
⢠Understand and gain familiarity with Boolean functions
and logic gate design (the basic tools!)
⢠apply simplification techniques to Boolean functions (to
be able to design optimal/ âminimalâ circuits)
⢠design and implement combinational circuits (obtain
logical functions by combining various circuits)
⢠design and implement sequential circuits (Synchronous
-feedback signals and Asynchronous â timing/events)
5. Grades:
⢠There will be surprise short quizzes, preliminary exam,
midterm exam, and a final exam. Laboratory activities will
be included in the final grade.
Nature Tentative Date % of Final
Grade
Prelim Exam
Midterm Exam
Final Exam
Homework/Qz/Lab
One Project
In-class, close
book & notes
In-class, close
book & notes
In-class, close
book
Queuing
Counter
December
February
March
25%
25%
25%
15%
10%
6. Courtesy and Etiquette in Class
⢠Much as I sympathize at the inconvenient timing
of the lectures, please eat your meals/snacks
before the lecture. Other than a (non-alcoholic)
beverage, NO FOOD IS ALLOWED during
lectures.
â It causes distraction to both the instructor and
surrounding students, and it prevents the eater from
paying full attention to the lecture. Any person eating
in class will be asked to leave.
⢠I also asked you to avoid going out of the room
frequently when the class starts proper except of
course for emergency cases.
7. Grades Appeals / Academics
Dishonesty
Academic dishonesty will not be tolerated. Any
student found to have participated in academic
dishonesty will receive a â5.0â in the course, and
maybe subject to disciplinary action.
The State Instituteâs Code of Conduct prohibits
students from committing the following acts of
academic dishonesty: academic fraud, copying
or allowing oneâs work to be copied,
fabrication/falsification, sabotage of otherâs work,
substitution (ex., taking an exam for someone
else).
8. Course Content
I. Binary Systems
II. Boolean Algebra and Logic Gates
III. Simplification of Boolean Functions
IV. Combinational Logic
V. MSI and PLD Components
VI. Synchronous Sequential Logic
VII. Registers, Counters, and the Memory Unit
VIII. Algorithmic State Machines (ASM)
IX. Asynchronous Sequential Logic
X. Digital Integrated Circuits
XI. Laboratory Exercises
9. MoreâŚ
⢠A bit more clear please!âŚ
⢠We will understand how digital circuits work and how we
can design them
⢠What are digital circuits?
⢠What is a âdigital computerâ?
⢠DIGIT: from Latin âdigitusâ = finger. âAny of the Arabic
numerals from 0-9â. âOne of the elements that combine to
form numbers in a system other then the decimal oneâ.
⢠DIGITAL: âof/relating to/using calculation by numerical
methods or by discrete unitsâ. ârelating to data in the form
of numerical digitsâ
10. Chapter 1: Binary Systems
⢠Digital Computers and Digital Systems
⢠Binary Numbers
⢠Number Base Conversions
⢠Octal and Hexadecimal Numbers
⢠Complements
⢠Signed Binary Numbers
⢠Binary Codes
⢠Binary Storage and Registers
⢠Binary Logic
11. Why is it named âdigitalâ?
⢠Early computers were used mainly to
perform numeric computations
⢠They used discrete elements of
information: digits
⢠DIGITAL SYSTEMS: manipulate discrete
elements of information (finite sets)
⢠E.g. the 10 decimal digits, the 26 letters of
the alphabet, 64 squares of chess board)
12. Digital Computers and Digital Systems
TODAY
⢠Computers are used in a variety of
applications such as scientific calculations,
commercial, and business data
processing, air traffic controls, space
guidance, educational field among others.
⢠Digital computers have made possible
many scientific, industrial, and commercial
advances that would have been
unattainable otherwise.
13. Digital Computers and Digital Systems
Computers can follow a sequence of instruction
called program, that operates on given data.
General-purpose digital computer is the best-
known example of a digital system.
Others are:
â Telephone switching exchanges, digital
voltmeters, digital counters, electronic
calculators, and digital displays.
14. Digital Computers and Digital Systems
Introduction:
Characteristic of a Digital system is its
manipulation of discrete elements of information.
Such discrete elements maybe:
electric impulses, decimal digits, letters of an
alphabet, arithmetic operations, punctuation
marks, or any set of meaningful meanings.
15. Digital Computers and Digital Systems
Discrete elements of information are represented in a
digital system by physical quantities called SIGNALS.
ďVoltages and currents are the most common
electrical signals.
ďSignals in the present day of electronic digital
systems have only two discrete values and
are said to be BINARY.
16. Beyond the digital computerâŚ
⢠Digital devices (camcorders, DVDs, TV, phones,
microprocessor-based devices)
Why Digital Circuits?
⢠Digital devices are programmable â by simply
changing the program the same hardware can
be used for different applications
⢠Advances in digital integrated circuits technology
â accuracy, reliability (DVD)
⢠Digital systems are interconnections of digital
modules
17. Digital circuits
⢠What digital modules in digital systems are
made of
⢠Each digital circuit implements a logical function
⢠Combination of digital circuits form a more complex logical
function (of the module)
⢠Combinations of modules â function of devices
⢠We will study different types of digital circuits
and learn to analyze their functionality and
ultimately how to design digital circuits that
accomplish a desired logical function
18. Digital Computers and Digital Systems
Figure 1.1
Block diagram of a digital computer
Processor, or
Arithmetic Unit
Storage, or
Memory Unit
Input
Devices
and
Control
Output
Devices
and
Control
Control Unit
19. How does a computer work?
⢠Memory unit:
â Stores program as well as input, output, and
the intermediate data.
⢠Processor unit:
â Performs the arithmetic and other data
processing tasks as specified by a program
20. How does a computer work?
⢠Control unit:
â Supervises the flow of information between the
various units
â It retrieves the instructions, one by one, from the
program that is stored in the memory
â For each instruction, the control unit informs the
processor to execute the operation specified by
the instructions & the processor manipulates the
data as specified by the program.
21. How does a computer work?
⢠The program and data prepared by the
user are transferred into the memory unit
by means of the input device such as
keyboard
⢠Output device such as printer receives
the results of the computations & printed
results are presented to the user.
22. Digital Computers and Digital Systems
1-2 BINARY NUMBERS:
Decimal
Decimal number 7392 is represented by: 7 x 103
+
3 x 102
+ 9 x 101
+ 2 x 100
Represented in series of coefficients:
a5a4a3a2a1a0.a-1a-2a-3
23. Digital Computers and Digital Systems
1-2 BINARY NUMBERS:
Decimal
The aj coefficients are one of the ten digits (0, 1, 2,
âŚ,9)
105
a5
+ 104
a4
+ 103
a3
+ 102
a2
+ 101
a1
+ 100
a0
+ + 10-1
a-1
+
10-2
a-2
+ 10-3
a-3
The decimal number system is said to be of base, or
radix, 10 because it uses ten digits and the
coefficients are multiplied by powers of 10.
24. 1-2 BINARY NUMBERS:
⢠The binary system is different with the decimal system
having only two possible values: 0 and 1.
⢠Each coefficient aj is multiplied by 2j.
⢠For example: 11010.11 is 26.75 in decimals, shown from
the multiplication of the coefficients by powers of 2:
⢠1x24
+ 1x23
+ 0x22
+ 1x21
+ 0x20
+ 1x2-1
+ 1x2-2
= 26.75
25. 1-2 Binary Numbers
⢠In general, a number expressed in base-r
system has coefficients multiplied by
powers of r:
⢠The coefficients aj range in value from 0 to
r - 1.
⢠Example: (4021.2)5 = 4x53
+ 0x52
+2x51
+
1x50
+2x5-1
= (511.4)10
⢠Note that coefficients for base 5 can be
only 0, 1, 2, 3, and 4.
26. 1-2 Binary Numbers
⢠For hexadecimal, the letters of the
alphabet are use to supplement the ten
decimal digits when the base of the
number is greater than 10.
⢠Letters A, B, C, D, E and F are used for
digits 10, 11, 12, 13, 14 and 15
respectively.
27. Binary Numbers
As an example:
(B65F)16 = 11 x 163
+ 6 x 162
+ 5 x 16 + 15
⢠Arithmetic operations with numbers in base r
follow the same rules as for decimal numbers.
⢠When other than the familiar base 10 is used,
one must be careful to use only the r allowable
digits.
30. Addition and Multiplication of
Binary
Multiplication:
Multiplicand: 1011
Multiplier: x 101
1011
0000
1011
110111
31. 1-3 Number Base Conversions
⢠A binary number can be converted to a decimal
by forming the sum of the powers of 2 of those
coefficients whose value is 1.
Example:
(1010.011)2 = 23
+ 21
+ 2-2
+ 2-3
= (10.375)10
⢠The binary number has four 1âs and the decimal
equivalent is found from the sum of four powers
of 2.
32. 1-3 Number Base Conversions
⢠The following is an example of Octal-to-
decimal conversion:
(630.4)8 = 6 x 82
+ 3 x 8 + 4 x 8-1
⢠The conversion from decimal to binary or
to any other base-r system is more
convenient if the number is separated into
an integer part and a fraction part and the
conversion of each part done separately.
33. 1-3 Number Base Conversions
⢠Convert decimal 41 to binary.
â Follow these simple steps:
⢠To do this, divide 41 by 2 to give an integer quotient
of 20 and a remainder of ½.
⢠The quotient is again divided by 2 to give a new
quotient and remainder.
⢠This process is continued until the integer quotient
becomes 0.
(The process should be shown on the board)
34. 1-3 Number Base Conversions
⢠Convert decimal 153 to octal.
â Follow these simple steps:
⢠The required base r is 8.
⢠First, divide 153 by 8 to give an integer quotient of
19 and a remainder of 1.
⢠Then divide 19 by 8 to give a quotient of 2 and a
remainder of 3.
⢠Finally, 2 is divided by 8 to give a quotient of 0 and
a remainder of 2.
(Process continued on the board)
35. ⢠Convert (0.513) to octal.
â 0.513 x 8 = 4.104
â 0.104 x 8 = 0.832
â 0.832 x 8 = 6.656
â 0.656 x 8 = 5.248
â 0.248 x 8 = 1.984
â 0.984 x 8 = 7.872
⢠The answer, to seven significant figures, is
obtained from the integer part of the products:
(0.513)10 = (0.406517âŚ)8
1-3 Number Base Conversions
36. ⢠Convert (0.6875)10 to binary.
INTEGER FRACTION COEFFICIENTS
â 0.6875 x 2 = 1 + 0.3750 a-1 = 1
â 0.3750 x 2 = 0 + 0.7500 a-2 = 0
â 0.7500 x 2 = 1 + 0.5000 a-3 = 1
â 0.5000 x 2 = 1 + 0.0000 a-4 = 1
Answer: (0.6875)10 = (0.a-1a-2a-3a-4)2 = (0.1011)2
1-3 Number Base Conversions
38. 1-4 Hexadecimal Numbers
⢠Conversion of binary to octal:
â 10110001101011.111100000110)2
â 10 1100 0110 1011 . 1111 0010 =
â (2C6B.F2)16
2 C 6 B F 2
39. 1-5 COMPLEMENTS
⢠Complements are used in digital computers for
simplifying the subtraction operation and for
logical manipulation. There are two types of
complements for each base-r system:
⢠RADIX COMPLEMENT (or Râs Complement)
⢠DIMINISHED RADIX COMPLEMENT (or (R-1)âs
complement).
â Also, it could be the 2âs and 1âs complement for the
binary system.
â And, 10âs and 9âs complement for decimal numbers.
40. 1-5 COMPLEMENTS
⢠DIMINISHED RADIX Complement for DECIMAL
â Given a number N in base r having n digits, the (r-1)âs
complement of N is defined as (rn
â 1) â N.
â For decimal numbers, r = 10 and r â 1 = 9, so the 9âs
complement of N is (10n
â 1) â N.
â 10n
represents a number that consists of a single 1
followed by n 0âs.
â 10n
â 1 is a number represented by n 9âs.
⢠For example, if n=4, we have 104
= 10,000 and 104
-1 = 9999
41. 1-5 COMPLEMENTS
⢠It follows that the 9âs complement of a
decimal number is obtained by
subtracting each digit from 9.
â Example:
⢠The 9âs complement of 546700 is 999999 â
546700 = 453299
⢠The 9âs complement of 012398 is 999999 â
012398 = 987601
42. 1-5 COMPLEMENTS
⢠For binary numbers, r = 2 and r â 1 = 1,
so the 1âs complement of N is (2n
â 1) â
N.
⢠2n
is represented by a binary number
that consists of a 1 followed by n 0âs.
⢠2n
â 1 is a binary number represented
by n 1âs.
43. 1-5 COMPLEMENTS
⢠For example, if n = 4, we have 24
= (10,000)2 and
24
â 1 = (1111)2.
⢠Thus the 1âs complement of a binary number is
obtained by subtracting each digit from 1.
⢠But when subtracting binary digits from 1, we can
have either 1 â 0 = 1 of 1 â 1 = 0, which causes
the bit to change from 0 to 1of from 1 to 0.
⢠Therefore, the 1âs complement of a binary number
is formed by changing 1âs to 0âs and 0âs to 1âs.
44. 1-5 COMPLEMENTS
⢠Example
â The 1âs complement of 1011000 is
0100111.
â The 1âs complement of 0101101 is
1010010.
The (r â 1)âs complement of octal or
hexadecimal numbers is obtained by
subtracting each digit from 7 or F (decimal
15), respectively.
45. 1-5 COMPLEMENTS
⢠RADIX Complement
âThe râs complement of an n-digit
number N in base r is defined as rn
â N
for N = 0 and 0 for N=0.
âThe râs complement is obtained by
adding 1 to the (r â 1)âs complement
since rn
â N = [(rn
â 1) â N] + 1.
46. 1-5 COMPLEMENTS
⢠Example (Decimal)
â10âs complement of 012398 is
987602.
â10âs complement of 246700 is
753300.
47. 1-5 COMPLEMENTS
⢠Radix Complements
âExample for BINARY:
⢠The 2âs complement of 1101100 is
0010100.
⢠The 2âs complement of 0110111 is
1001001.
48. 1-5 COMPLEMENTS
⢠Subtraction with complements
â Similar to the subtraction done in
elementary, in this method, we
borrow a 1 from a higher
significant position when the
minuend digit is smaller than the
subtrahend digit.
49. 1-5 COMPLEMENTS
⢠Subtraction with complements
â The subtraction of two n-digit unsigned
numbers M â N in base r can be done as
follows:
1. Add the minuend M to the râs complement of the
subtrahend. This performs M + (rn
â N) = M â N +
rn
.
2. If M > N, the sum will produce an end carry, rn
,
which is discarded; what is left is the result M â N.
50. 1-5 COMPLEMENTS
⢠Subtraction with complements
3. If M < N, the sum does not produce an end
carry and is equal to rn â (N â M), which is
the râs complement of (N â M). To obtain
the answer in familiar form, take the râs
complement of the sum and place a
negative sign in front.
51. 1-5 COMPLEMENTS
Example 1: Using 10âs complement, subtract
72532 â 3250.
M = 72532
10âs complement of N = + 96750
Sum = 169282
Discard the end carry 105
= -100000
ANSWER = 69282
52. 1-5 COMPLEMENTS
Example 1: Using 10âs complement, subtract
3250 - 72532.
M = 03250
10âs complement of N = + 27468
Sum = 30718
There is no end carry.
Answer: -(10âs complement of 30718) = -69282
NOTE that since 3250 < 72532, the result is negative.
53. 1-5 COMPLEMENTS
Example 1: Given the two binary numbers X = 1010100
and Y = 1000011, perform the subtraction (a) X â Y
and (b) Y â X using 2âs complements.
(a) X = 1010100
2âs complement of Y = + 0111101
Sum = 10010001
Discard the end carry 27
= -10000000
Answer: X â Y = 0010001
54. 1-5 COMPLEMENTS
(b) Y = 1000011
2âs complement of X = + 0101100
Sum = 1101111
There is no end carry.
Answer: Y- X = -(2âs complement of 1101111) = -0010001
Subtraction of unsigned numbers can be done also by
means of the (r-1)âs complement.
55. 1-5 COMPLEMENTS
Example 1-8: Repeat example 1-7 using
1âs complement.
(a) X â Y = 1010100 â 1000011
X = 1010100
1âs complement of Y = + 0111100
Sum = 10010000
End-around carry +1
Answer: X â Y = 0010001
56. 1-5 COMPLEMENTS
Example 1-8: Repeat example 1-7 using
1âs complement.
(b) Y â X = 1000011 â 1010100
Y = 1000011
1âs complement of X = + 0101011
Sum = 1101110
There is no end carry.
Answer: Y â X = -(1âs complement of
1101110) = -0010001
57. 1-6 SIGNED Binary Numbers
⢠Positive integers including zero can be
represented as unsigned numbers. But to
represent negative integers, we need a
notation for negative values.
⢠In ordinary arithmetic,
â a negative number is indicated by a minus sign
â A positive number is indicated with a plus sign
58. 1-6 SIGNED Binary Numbers
⢠Due to hardware limitations, computers
must represent everything with binary
digits, commonly referred to as BITS.
⢠It is customary to represent the sign with a
bit placed in the leftmost position of the
number for binary numbers.
â The convention is to make the sign bit 0 for
positive
â And 1 for negative
59. 1-6 SIGNED Binary Numbers
⢠We should realize that both signed and
unsigned binary numbers consist of a string of
bits when represented in a computer.
⢠The user determines whether the number is
signed or unsigned.
⢠If the binary number is signed, then the leftmost
bit represents the sign and the rest of bits
represent the number
60. 1-6 SIGNED Binary Numbers
⢠Example the string of bits 01001
â Can be considered as 9 for unsigned binary
â Or a +9 for signed binary
⢠Another example, 11001
â Can be interpreted as 25 when unsigned, or
â As - 9 when considered as a signed number.
There should be no confusion in identifying the bits if the
type of representation for the number is known in
advance.
61. 1-6 SIGNED Binary Numbers
⢠The representation of the signed numbers is referred as
the SIGNED â MAGNITUDE Convention.
⢠In this notation, the number consists of a Magnitude
and Symbol ( + or - ) or a BIT (0 or 1) indicating the
sign.
⢠When arithmetic operations are implemented in a
computer, it is more convenient to use a different
system for representing negative numbers, referred to
as the SIGNED COMPLEMENT System.
62. 1-6 SIGNED Binary Numbers
⢠SIGNED COMPLEMENT System
â In this system, a negative number is
indicated by its complement
â The signed complement system can
either use the 1âs or 2âs complement, but
the 2âs complement is the most common.
63. 1-6 SIGNED Binary Numbers
⢠Example:
ďConsider the number 9 represented in
binary with eight bits
ď+ 9 is represented with a sign bit of 0 in
the leftmost position followed by the
binary equivalent of 9 to give 00001001.
64. 1-6 SIGNED Binary Numbers
⢠Example:
ď While there is only one way to represent
+ 9, there are three different ways to
represent â 9 with eight bits:
In signed-magnitude representation: 10001001
In signed-1âs complement representation: 11110110
In signed-2âs complement representation: 11110111
65. 1-6 SIGNED Binary Numbers
⢠In signed-magnitude, - 9 is obtained from + 9
by changing the sign bit in the leftmost position
from 0 to 1.
⢠In signed - 1âs complement, - 9 is obtained by
complementing all the bits of +9, including the
sign bit.
⢠In signed - 2âs complement, -9 is obtained by
taking the 2âs complement of the positive
number, including the sign bit.
66. 1-6 SIGNED Binary Numbers
⢠The signed-magnitude system is used in ordinary
arithmetic, but is awkward when employed in computer
arithmetic.
⢠Therefore, the signed-complement is normally used.
⢠The 1âs complement presents some difficulties and is
seldom used for arithmetic operations and the signed
binary arithmetic deals more with the 2âs
complement in representing negative numbers.
67. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â The addition of two numbers in the signed-magnitude
system follows the rules of ordinary arithmetic.
â If the signs are the same, we add the two magnitudes
and give the sum the common sign.
â If the signs are different, we subtract the smaller
magnitude from the larger and give the result the sign
of the larger magnitude.
68. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â Example: (+25) + (-37) = - (37 â 25) = -12
â This is done by subtracting the smaller magnitude 25
from the larger magnitude 37 and using the sign of 37
for the sign of the result.
â The same procedure applies to binary numbers in
signed-complement system does not require a
comparison or subtraction, but only addition
69. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â The procedure can be stated as follows for
binary:
⢠The addition of two signed binary numbers with
negative numbers represented in signed 2âs
complement form is obtained from the addition
of the two numbers, including their sign bits. A
carry out of the sign-bit position is discarded.
70. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â Numerical examples:
+ 6 00000110 - 6 11111010
+13 00001101 +13 00001101
+19 00010011 +7 00000111
Note that negative numbers must be initially in 2âs
complement and that the sum obtained after the
addition is in 2âs complement form.
71. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â Numerical examples:
+ 6 00000110 - 6 11111010
-13 11110011 -13 11110011
-7 11111001 -19 11101101
Note that negative numbers must be initially in 2âs
complement and that the sum obtained after the
addition is in 2âs complement form.
72. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC ADDITION
â In each of the four cases, the operation
performed is addition with the sign bit
included.
â Any carry out of the sign-bit position is
discarded, and negative results are
automatically in 2âs complement form.
73. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC SUBTRACTION
â Subtraction of two signed binary numbers
when negative numbers are in 2âs
complement form is simple and is stated as
follows:
⢠Take the 2âs complement of the subtrahend
(including the sign bit) and add it to the minuend
(including the sign bit). A carry out of the sign-
bit position is discarded.
74. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC SUBTRACTION
â This procedure occurs because a subtraction
operation can be changed to an addition operation
if the sign of the subtrahend is changed.
⢠(+/- A) â (+B) = (+/-A) + (-B)
⢠(+/- A) â (-B) = (+/-A) + (+B)
â But changing a positive number to a negative
number is easily done by taking the 2âs
complement.
75. 1-6 SIGNED Binary Numbers
⢠ARITHMETIC SUBTRACTION
â Consider the subtraction of (-6) â (-13) = +7.
â In binary with eight bits, this is written as
(11111010 â 11110011).
â The subtraction is changed to addition by taking
the 2âs complement of the subtrahend (-13) to give
(+13).
â In binary, this is 11111010 + 00001101 =
10000011. Removing the end carry, we obtain the
correct answer 00000111 (+7).
76. 1-7 BINARY CODES
⢠Electronic digital systems use signals that
have two distinct values and circuit
elements that have two stable states.
â There is a direct analogy among binary
numbers, binary circuit elements, and binary
digits.
â For example, a binary number of n digits may
be represented by n binary circuit elements,
each having an output signal equivalent to a 0
or a 1.
77. 1-7 BINARY CODES
⢠Digital systems represent and manipulate
not only binary numbers, but also many
other discrete elements of information.
â Any discrete element of information distinct
among a group of quantities can be
represented by a binary code.
â Codes must be in binary because computers
can only hold 1âs and 0âs.
78. 1-7 BINARY CODES
⢠A bitbit by definition is a binary digit and
when used in conjunction with a binary
code, it is better to think of it as denoting a
binary quantity equal to 0 or 1.
â To represent a group of 22nn
distinct elements in a
binary code requires a minimum of n bits.
â This is because it is possible to arrange n bits
in 22nn
distinct ways.
79. 1-7 BINARY CODES
⢠For example,
â A group of four distinct quantities can be
represented by a two-bit code, with each
quantity assigned one of the following bit
combinations: 00, 01, 10, 11.
â A group of eight elements requires a three-bit
code, with each element assigned to one and
only one of the following: 000, 001, 010, 011,
100, 101, 110, 111.
80. 1-9 BINARY LOGIC
⢠Binary logic deals with variables that
take on two discrete values and with
operations that assumes logical
meaning.
â The two values the variables take may be
called by different names (e.g., true and
false, yes and no, etc.) but it is more
convenient to think in terms of bits and
assign the values of 1 and 0.
81. 1-9 BINARY LOGIC
⢠Binary logic is used to describe, in
mathematical way, the manipulation and
processing of binary information.
â It is suited for the analysis and design of digital
systems.
â For example, the digital logic circuits of figure
1-3 in your book that perform the binary
arithmetic are the circuits whose behavior is
conveniently expressed by means of binary
variables and logical operations.
82. 1-9 BINARY LOGIC
⢠The binary logic to be introduced in this
section is equivalent to an algebra called
BOOLEAN ALGEBRA.
â The purpose of this section is to introduce
Boolean algebra and relate it to digital logic
circuits and binary signals.
â The formal discussion of a 2-valued Boolean
algebra is covered in more detail in Chapter 2.
83. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
â Binary Logic consists of binary variables and
logical operations.
â Variables are designated by letters of alphabet
such as A, B, C, x, y, z, etc. with each variable
having two and only two distinct possible
values: 1 and 0.
â There are three basic logical operations: AND,
OR and NOT.
84. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
âAND: This operation is represented by a
dot or by the absence of an operator.
âFor example, x.y = z or xy = z is read â x
AND y is equal to z.â
âThe logical operation AND is interpreted
to mean that z = 1 if and only if x = 1 and
y = 1; otherwise z = 0.
85. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
âOR: This operation is represented by
a plus sign.
âFor example, x + y = z is read âx OR y
is equal to z,â meaning that z=1 if x=1
or if y=1 or if both x=1 and y=1.
âIf both x=0 and y=0, then z = 0.
86. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
âNOT: This operation is represented
by a prime (sometimes by a par).
âFor example, xâ = z (or x = z) is read
ânot x is equal to z,â meaning that z is
what x is not.
âIn other words, if x=1, then z=0; but if
x=0, then z=1.
87. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
â Binary Logic resembles binary arithmetic, and
the operations AND and OR have some
similarities to multiplication and addition.
â One should realize that an arithmetic variable
designates a number that may consist of many
digits.
â A logic variable is always either a 1 or 0.
88. 1-9 BINARY LOGIC
⢠DEFINITION of Binary Logic
â For each combination of the values of x and y,
there is a value of z specified by the definition
of the logical operation.
â These definitions can be listed in a compact
form known as TRUTH Tables.
â A truth table is a table of all possible
combinations of the variables showing the
relation between the values that the variables
may take and the result of the operation.
89. 1-9 BINARY LOGIC
Truth Tables of Logical Operations:
AND
x y z
0 0 0
0 1 0
1 0 0
1 1 1
OR
x y z
0 0 0
0 1 1
1 0 1
1 1 1
NOT
x xâ
0 0
0 1
90. 1-9 BINARY LOGIC
Switching Circuits and Binary Signals
â The use of binary variables and the
application of binary logic are demonstrated
by the simple switching circuit in the figure.
Voltage
Source
A B
A
B
(a) Switches in series â logic AND (b) Switches in parallel â logic OR
91. 1-9 BINARY LOGIC
Switching Circuits and Binary Signals
â Manual switches A and B represent two binary
variables with values equal to 0 when the switches is
open and 1 when the switch is closed. Similarly, let the
lamp L represent a third binary variable equal to 1
when the light is on and 0 when off.
Voltage
Source
A B
A
B
92. 1-9 BINARY LOGIC
Switching Circuits and Binary Signals
â For the switches in series, the light turns on if A and B
are closed.
â For the switches in parallel, the light turns on if A or B
is closed.
L = A B L = A + B
Voltage
Source
A B
A
B
93. 1-9 BINARY LOGIC
Switching Circuits and Binary Signals
â Electronic digital circuits are sometimes called
switching circuits because they behave like a
switch such as the transistor.
â Instead of changing the switch manually, an
electronic switching circuit uses binary signals to
control the conduction or non-conduction state of
the active element.
â Electrical signals such as voltage and current
exist throughout a digital system in either one of
two recognizable values (except during transition).
94. 1-9 BINARY LOGIC
â Voltage-operated circuits respond to two separate voltage
levels, which represent a binary variable equal to Logic â 1
or Logic â 0.
4
3
2
1
0.5
0
-0.5
TOLERANCE ALLOWED for LOGIC-0
TOLERANCE ALLOWED for LOGIC-1
TRANSITION OCCURS BETWEEN THESE LIMITS
NOMINAL
LOGIC-1
NOMINAL
LOGIC-0
95. 1-9 BINARY LOGIC
⢠Electronic digital circuits are also called LOGIC
CIRCUITS because, with the proper input, they
establish logical manipulation paths.
⢠Any desired information for computing or control
can be operated upon by passing binary signals
through various combinations of logic circuits,
each signal representing a variable and carrying
one bit of information.
96. 1-9 BINARY LOGIC
⢠LOGIC CIRCUITS that perform the logical
operations of AND, OR, and NOT are shown
below with their symbols.
X
Y
Z = X.Y
Z = X + Y
X
Y
x xâ
(a) Two â input AND gate
(b) Two â input OR gate
(c) NOT gate or inverter
97. 1-9 BINARY LOGIC
⢠LOGIC CIRCUITS that perform the logical
operations of AND, OR, and NOT are shown
below with their symbols.
A
B
F = ABC
G = A + B + C +
D
A
B
(d) Three â input AND gate
(e) Four-input OR gate
C
C
D
E
98. 1-9 BINARY LOGIC
⢠These circuits, called gates, are blocks of
hardware that produce a logic-1 or logic-0 output
signal if input logic requirements are satisfied
⢠Note that four different names have been used for
the same type of circuits:
âDIGITAL Circuits
âSWITCHING Circuits
âLOGIC Circuits, and
âGATES
101. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
⢠Boolean algebra, like any other
deductive mathematical system,
maybe defined with a set of
elements, a set of operators, and a
number of unproved axioms or
postulates.
102. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
⢠In traditional logic, an axiom or postulate is a
proposition that is not proved or demonstrated
but considered to be either self-evident, or
subject to necessary decision. Therefore, its
truth is taken for granted, and serves as a
starting point for deducing and inferring other
(theory dependent) truths.
⢠an axiom is any mathematical statement that
serves as a starting point from which other
statements are logically derived
103. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
⢠A set of elementsset of elements is any collection of objects
having a common property
⢠If SS is a set, and x and y are certain objects,
then x SS denotes that x is a member of the
set SS, and y SS denotes that y is not an
element of SS.
⢠A set with a denumerable number of elements
is specified by braces: A = {1, 2, 3, 4}, i.e., the
elements of set A are the numbers 1, 2, 3 and
4.
104. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
⢠A binary operatorbinary operator defined on a set SS of
elements is a rule that assigns to each pair of
elements from SS a unique element from SS.
⢠Example: a * b = c, we say that * is a binary
operator if it specifies a rule for finding c from
the pair (a, b) and also if a, b, c SS.
â However, * is not a binary operator if a, b SS (?)(?),
whereas the rule finds c SS..
105. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
⢠The postulates of a mathematical
system form the basic assumptions from
which it is possible to deduce the rules,
theorems, and properties of the system.
⢠The most common postulates used to
formulate various algebraic structures
are:
106. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
1.1. Closure âClosure â A set S is closed with respect to a
binary operator if, for every pair of element S,
the binary operator specifies a rule for
obtaining a unique element of S.
For example: The set of natural numbers N = {1,
2, 3, 4, . . . } is closed with respect to the
binary operator plus (+) by the rules of
arithmetic addition since for any a, b N we
obtain a unique c N by the operation a + b
= c.
107. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
2.2. Associative Law âAssociative Law â A binary operator * on a set S is said to be
associative whenever
(x * y) * z = x * (y * z) for all x, y, z SS
3.3. Commutative LawCommutative Law â A binary operator * on a set S is said to be
commutative whenever
x * y = y * x for all x, y SS
4.4. Identity Element âIdentity Element â A set S is said to have an identity element with
respect to a binary operation * on S if there exists an element e
S with the property
e * x = x * e = x for every x S
Example: The element 0 is an identity element with respect to
operation + on the set of integers I = {âŚ, -3, -2, -1, 0, 1, 2, 3, âŚ}
since x + 0 = 0 + x = x for any x I
108. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
5. Inverse.5. Inverse. A set S having the identity element e
with respect to a binary operator * is said to have
an inverse whenever, for every x S, there exist
an element y S such that
x * y = e
Example: In the set of integers I with e = 0, the inverse of
an element a is (-a) since a + (-a) = 0.
6. Distributive Law6. Distributive Law. If * and ⢠are two binary
operators on a set S, * is said to be distributive
over ⢠whenever
x * (y ⢠z) = (x * y) ⢠(x * z)
109. Boolean Algebra and Logic GatesBoolean Algebra and Logic Gates
Basic DefinitionsBasic Definitions
The operators and postulatesThe operators and postulates have the following
meanings:
1.1. The binary operator + defines addition.The binary operator + defines addition.
2.2. The additive identity is 0.The additive identity is 0.
3.3. The additive inverse defines subtractions.The additive inverse defines subtractions.
4.4. The binary operatorThe binary operator ⢠defines multiplication⢠defines multiplication
5.5. The multiplicative identity is 1.The multiplicative identity is 1.
6.6. The multiplicative inverse of a = 1/a defines division.The multiplicative inverse of a = 1/a defines division.
7.7. The only distributive law applicable is that ofThe only distributive law applicable is that of ⢠over +:⢠over +:
aa ⢠(b + c) = (a ⢠b) + (a ⢠c)⢠(b + c) = (a ⢠b) + (a ⢠c)
110. Axiomatic Definitions of Boolean AlgebraAxiomatic Definitions of Boolean Algebra
⢠Boolean algebra is defined by a set of elements,
B, provided following postulates with two binary
operators, + and ., are satisfied:
1. Closure with respect to the operators + and ..
2. An identity element with respect to + and . is 0 and
1,respectively.
3. Commutative with respect to + and .. Ex: x + y = y + x
4. + is distributive over . : x + (y . z)=(x + y) . (x + z)
. is distributive over +: x . (y + z)=(x . y) +(x . z)
111. Comparing Boolean algebra with
arithmetic and ordinary algebra.
1. Huntington postulates donât include the associative law,
however, this holds for Boolean algebra.
2. The distributive law of + over . is valid for Boolean algebra,
but not for ordinary algebra.
3. Boolean algebra doesnât have additive and
multiplicative inverses; therefore, no subtraction or
division operations.
4. Postulate 5 defines an operator called complement that is
not available in ordinary algebra.
5. Ordinary algebra deals with the real numbers. Boolean
algebra deals with the as yet undefined set of elements, B,
in two-valued Boolean algebra, the B have two
elements, 0 and 1.
112. TWO-VALUED Boolean AlgebraTWO-VALUED Boolean Algebra
A two-valued Boolean algebra is defined on a set of twoA two-valued Boolean algebra is defined on a set of two
elements, B = {0, 1}, with rules for the two binaryelements, B = {0, 1}, with rules for the two binary
operators + andoperators + and ⢠as shown in the following operator⢠as shown in the following operator
tables:tables:
These rules are exactly the same as the AND, OR and
NOT operations, respectively.
x y x ⢠y
0 0 0
0 1 0
1 0 0
1 1 1
x y x + y
0 0 0
0 1 1
1 0 1
1 1 1
x xâ
0 1
1 0
113. Diagram of the Distributive lawDiagram of the Distributive law
⢠To emphasize the similarities between two-valued
Boolean algebra and other binary systems, this algebra
was called âbinary logicâ. We shall drop the adjective
âtwo-valuedâ from Boolean algebra in subsequent
discussions.
x . ( y + z )=(x . y) + (x . z)
114. BASIC THEOREMS and PROPERTIESBASIC THEOREMS and PROPERTIES
OF BOOLEAN ALGEBRAOF BOOLEAN ALGEBRA
⢠If the binary operators and the identity elements
are interchanged, it is called the DUALITY
PRINCIPLE. We simply
interchange OR and AND operators and replace 1âs b
.
⢠The most important property of Boolean Algebra is
called
⢠The theorem 1(b) is the dual of theorem 1(a) and
that each step of the proof in part (b) is the dual of
part (a). Shown in the next slidesâŚ
115. BASIC THEOREMS and PROPERTIESBASIC THEOREMS and PROPERTIES
OF BOOLEAN ALGEBRAOF BOOLEAN ALGEBRA