Professor: Dinh Duc Anh Vu, Phd. Office: A2.713 Email: Ddavu@Hcmiu - Edu.Vn
Professor: Dinh Duc Anh Vu, Phd. Office: A2.713 Email: Ddavu@Hcmiu - Edu.Vn
Office: A2.713
Email: ddavu@hcmiu.edu.vn
Code: IT67IU
Credit: 3
Prerequisite: None
Co-requisite:
Digital Logic Design Lab
Textbook: Digital Systems: Principles and
Applications, 10th edition, Pearson Edu. Intl.,
2007, by Ronald J. Tocci and Neal S. Widmer,
Gregory L. Moss
Class and recitation notes
Introduction 2
Class Time:
◦ Wednesdays
Office Hours:
◦ by appointment
◦ office: A2.713
◦ Email / Conversation (Teams)
Introduction 3
Introduction 4
Chapter 1 (this chapter): Introduction
Chapter 2: Number Systems
Chapter 3: Logic Circuits
Chapter 4: Boolean algebra & Combinational
logic circuits
Chapter 5: Flip-Flop and related devices
Chapter 6: Counters and registers
Chapter 7: MSI logic circuits
Introduction 5
Number representation:
binary, decimal, hexadecimal
…
Logic gates: AND, OR, NOT,
NAND, NOR …
Flip-flop, latch, register …
Combinational circuit: adder,
comparator, multiplexer …
Sequential circuit:
asynchronous/synchronous
counters, shifters …
Introduction 6
Grade distribution:
◦ Homework, quizzes, hourly exams: 30%
◦ Midterm exam: 30%
◦ Final exam: 40%
Exams: open-book
NO MAKE UP EXAM WILL BE GIVEN!!!
Introduction 7
Introduction 9
Homework assignments will be posted. All
homework questions will be graded for
correctness. Questions will come both from the
textbook as well as created by the instructor.
Solutions for homework assignments will be
posted after the expiration of the grade period.
Quiz solutions will be discussed in class and will
only be posted online if they cannot be
discussed before an exam.
Exam solutions will only be discussed in class.
Introduction 10
Introduction 11
As research on learning shows, unexpected noises
and movement automatically divert and capture
people's attention, which means you are affecting
everyone’s learning experience if your cell phone,
pager, laptop, etc. makes noise or is visually
distracting during class.
For this reason,
- You must turn off your mobile devices during
class.
- You can take notes on your laptop, but you must
turn the sound off so that you do not disrupt other
students' learning. If you are doing anything other
than taking notes on your laptop, please sit in the
back row so that other students are not distracted
by your screen.
Introduction 12
Introduction 13
All assignments are expected to be turned in during class
on the due date unless otherwise noted.
If an assignment is turned in after that time, I will accept it
and assign a 25% penalty for each 24-hour period it is
late.
◦ Examples: A turns his assignment in at 8 AM the day after the
due date. He loses 25%. B turns his in at 3 PM the next day. He
loses 50%.
◦ This will be calculated by simply multiplying your earned score by
the appropriate penalty. Consider that A earned 30/40 points on
his assignment. After his 25% late penalty, he would receive a
final score of 23/40 (rounded up).
Weekend days count as days too. An assignment due on
Friday that is turned in on Monday is subject to a 50%
penalty.
If the solutions to an assignment are posted prior to the
normal expiration of this period (to facilitate studying for
an exam, for example), assignments will no longer be
accepted.
Introduction 14
Introduction 15
2000
42 million transistors
1.5 GHz
Introduction 16
11
10
9
8
7
6
5
4
3
2
1
0
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
Electronics, April 19, 1965.
Introduction 21
Introduction 22
Analog Representation
◦ Analog signals can take any value across a continuous range of current,
voltage, etc.
◦ One quantity is represented by another which is proportional to the first
◦ Examples: automobile speedometer, thermostat, …
◦ Analog quantities have an important characteristic: they can vary over a
continuous ranges of values
Digital Representation
◦ Quantities is represented not by proportional quantities but by symbols
called digits.
◦ Restrict themselves to two discrete values of 0 and 1, low and high, false
and true
◦ Examples: digital watch, …
◦ Changes in discrete steps
Analog: continuous
Digital: discrete (step by step)
Introduction 24
Introduction 25
Digital Systems
◦ a combination of devices designed to manipulate
logical information or physical quantities that are
represented in digital forms
◦ Examples: computer processor, robot, …
Analog Systems
◦ Contains devices that manipulate physical
quantities that are represented in analog form
◦ Examples: TV, VCR, …
Introduction 26
Introduction 27
Temperature (Analog) (Digital)
Measuring Analog-to-Digital Digital
(analog)
device converter processing
(Digital)
(Analog) Adjusts
Digital-to-Analog
Controller temperature
converter
Volts Volts
5V
1 1
Bit 1 4V
2V
Not used
0.8 V
Bit 0 0 0
0V 0V t
t0 t1 t2 t3
Introduction 29
Digital Circuits = Logic Circuits
Digital IC
◦ TTL, CMOS, NMOS, and ECL vi Digital circuit vo
5V
vi
0V
t
4V
vo
0V
Introduction 30
Introduction 31
“H”: 01001000
“i”: 01101001
Parallel
transmission
◦ uses one connecting
line per bit
◦ and all bits are
transmitted
simultaneously
Serial transmission
◦ uses only one signal
line
◦ and the individual
bits are transmitted
serially (one at a
time)
Introduction 33
When an input is applied to a circuit, the
output will change its state, but it will
remain in the new state even after the
input is removed. This property of
retaining its response to a momentary
input is called memory.
Non-memory
circuit
Memory
circuit
Arithmetic
Logic
Introduction 35
Type of Computers
◦ microcomputer, minicomputer (workstation), and
mainframe.
Microcomputer
◦ the smallest type of computer
◦ consists of several IC chips: microprocessor,
memory, and I/O interface
Microcontroller
◦ a more specialized type of microcomputer
◦ designed to be used as a dedicated or embedded
controller
Introduction 36
Introduction 37
Lots of gates on a chip are called Integrated
Circuits.
Initially part of a wafer, then sliced and diced
up.
Classified by scale of integration:
◦ 1-20 Gates: Small Scale Integration
◦ 20-200 Gates: Medium Scale Integration
◦ 200-1,000,000 Gates: Large Scale Integration
◦ > 1,000,000 Gates: Very Large Scale Integration
(VLSI)
Introduction 39
Introduction 40
Dinh Duc Anh Vu
International University – VNU HCM
Number representations
Common codes
Computations (Digital arithmetic)
Number Systems 2
Recognize the basic characteristics of the binary number system.
Convert a binary number to its decimal equivalent.
Count in the binary number system
Convert a number from one number system (decimal, binary,
hexadecimal) to its equivalent in one of the other number systems.
Cite the advantages of the hexadecimal number system.
Count in hexadecimal.
Represent decimal numbers using the BCD code; cite the pros and cons
of using BCD.
Understand the difference between BCD and straight binary.
Understand the purpose of alphanumeric codes such as the ASCII code.
Perform binary addition, subtraction, multiplication, and division on
two binary numbers.
Compare the advantages and disadvantages among three different
systems of representing signed binary numbers.
Manipulate signed binary numbers using the 2’s-complement system.
Understand the BCD addition process
Number Systems 3
Decimal system
Binary system
Hexadecimal system
Number Systems 4
453
10112
A number in the number system is: 25.310
◦ created by one or more digits.
◦ comprised of the integer part and fractional part
separated by the radix point (or base point)
◦ Positional number system: Each digit carries a
certain weight based on its position
decimal point
tenths position
hundreds position ones position
tens position
hundredths position
Number Systems 5
Number Systems 6
1. Decimal system
2. Binary system
3. Hexadecimal system
4. Octal system
Number Systems 7
Symbol: D
Base: 10
Digits used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
The decimal system is a positional-value system
in which the value of a digit depends on its
position.
Example:
2745.214=2x103+7x102+4x101+5x100
+2x10-1+1x10-2+4x10-3
Number Systems 8
Symbol: B
Base: 2
Digits used: 0, 1
Example:
◦ 1011.101B
Number Systems 9
Number Systems 10
The first method is the reverse of the previous process:
The decimal number is simply expressed as a sum of
powers of 2, and then 1s and 0s are written in the
appropriate bit positions
Number Systems 11
Number Systems 12
Example: Convert 12.69D into Binary system
The integer part: 12D = 1100B
The fraction:
0.69 x 2 = 1.38 → take out 1
0.38 x 2 = 0.76 → take out 0
0.76 x 2 = 1.52 → take out 1
0.52 x 2 = 1.04 → take out 1
0.04 x 2 = 0.08 → take out 0
Symbol: H
Base: 16
Digit used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
◦ The digits A, B, C, D, E, F are worth 10, 11, 12, 13, 14, 15,
respectively
Calculate the value of the hexadecimal number 2A9H
2A9H = 2x162 + 10x161 + 9x160
= 2x256 + 10x16 + 9x1
= 681D
Hexadecimal numbers are often used to describe a
computer’s memory address space
◦ 0xF000 – 0xFFFF
Number Systems 14
Convert the number in decimal system into
hexadecimal system
Divide the decimal number by 16 until the quotient
is zero. The hexadecimal obtained is the upward
collections of the remainders
Example: Convert 11512D into hexadecimal
system.
Number Systems 15
Number Systems 16
Convert the number in binary system into
hexadecimal system: From the unit column,
group 4 bits of binary number together, then
convert each group into the corresponding
hexadecimal digit
Number Systems 17
Number Systems 18
Code: group of special symbols that represent numbers, letters, words
Number Systems 19
Number Systems 20
b3 b2 b1 b0
23 22 21 20
Number Systems 21
9 4 3 (decimal)
↓ ↓ ↓
1001 0100 0011 (BCD)
Dec 0 1 2 3 4 5 6 7 8 9
BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Number Systems 22
Convert 0110100000111001 (BCD) to its
decimal equivalent
0110 1000 0011 1001
6 8 3 9
Number Systems 23
Number Systems 24
A straight binary code takes the complete
decimal number and represents it in binary
A BCD code converts each decimal digit to
binary individually
Examples
◦ 17810 = 101100102 (8 bit)
◦ 17810 = 0001 0111 1000BCD (12 bit)
Number Systems 25
Number Systems 26
0 1 1
1 0 0
Number Systems 27
Different:
◦ If inputs are the same, then G=0.
◦ If inputs are different, then G=1
The bit following bit 0 of binary code is not changed, the bit following bit 1 of
binary code is reversed
Number Systems 28
Codes representing letters of the alphabet,
punctuation marks, and other special
characters as well as numbers are called
alphanumeric codes
The most widely used alphanumeric code is
the American Standard Code for Information
Interchange (ASCII). The ASCII (pronounced
“askee”) code is a 7-bit code
Baudot Code
Number Systems 29
Number Systems 30
Number Systems 31
Number Systems 32
Representing signed numbers
Addition & Subtraction in the
2’s complement system
BCD addition
Number Systems 33
Number Systems 34
To find complement 9 of a decimal number,
take 9 minus each digit
Example: Find complement 9 of 270284D
9 9 9 9 9 9
2 7 0 2 8 4
7 2 9 7 1 5
Result: Complement 9 of 270284 is 729715
Number Systems 35
Number Systems 36
Given number N consisting of n digits in the
base system r, base complement of N is
defined:
◦ rn - N if N ≠ 0
◦ 0 if N = 0
Example
◦ Complement 10 of a decimal number 123D is:
103 - 123 = 1000 - 123 = 877D
◦ Complement 2 of a binary number 1100B is:
24 - 12 = 16 - 12 = 4 = 0100B
◦ Complement 16 of a hexadecimal number 2CH is:
162 - 44 = 256 - 44 = 212 = D4H
Number Systems 37
Number Systems 38
Unsigned binary number
◦ The value of unsigned binary number ≥ 0.
◦ An unsigned binary number n bits expresses value
in range of 0 to 2n - 1.
◦ Example:
1010B = 10D, in range of 0 to 24 – 1 (15)
01100001B = 97D, in range of 0 to 28 – 1 (255)
Number Systems 39
Number Systems 40
+98
-67
+123.7
-13.72
Number Systems 41
Number Systems 42
The positive number is represented as in the
common binary form, and the MSB is “0”.
The negative number is obtained by find the 2’s
complement of the corresponding positive
number.
Example: 0110B = +6D
2’s complement of 0110B is 1010B
2′𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
1010𝐵 −6𝐷
Only one representation of zero
Range for n bits: -2n-1 through +(2n-1-1)
Number Systems 43
Number Systems 44
The MSB of the negative numbers in the signed
binary system = 1
For positive numbers, adding bits 0 to the left
(in front of MSB) does not change the number’s
value.
For negative numbers, adding bits 1 to the left
(in front of MSB) does not change the number’s
value.
Copy sign bit to the left is called sign extension
Example:
◦ 0110B = 00110B = 000110B = … = +6D
◦ 1010B = 11010B = 111010B = … = -6D
Number Systems 45
Number Systems 46
Number Systems 47
Example: 7 + 6
Number Systems 48
Negate the subtrahend and add this to the
minuend
Example: 9 – 4 = 9 + (–4)
Number Systems 49
1101111
Ignore the last carry:
111001 - 1010 = 101111
Number Systems 50
Example:
Using complement 2 to do subtraction 1010 - 111001
001010
+
Complement 2 of 111001 is: 0 0 0 1 1 1
010001
There is no last carry. Find 2’s complement of 010001
is 101111 1010 - 111001 = -101111
Number Systems 51
Number Systems 52
Sum Equals 9 or Less
◦ none of the sums of the pairs of decimal digits exceeded 9;
therefore, no decimal carries were produced.
◦ the BCD addition process is straightforward and is actually
the same as binary addition
Sum Greater than 9
◦ Sum is one of the six forbidden or invalid four-bit code
groups because the sum of the two digits exceeds 9.
◦ Whenever this occurs, the sum must be corrected by the
addition of six (0110) to take into account the skipping of
the six invalid code groups
Number Systems 53
Number Systems 54
The hexadecimal number system is used in digital systems
and computers as efficient ways of representing binary
quantities
In conversion between hex and binary, each hex digit
corresponds to 4 bits
The repeated division method is used to convert decimal
numbers to binary or hexadecimal
Using N bit binary number, we can represent decimal
values from 0 to 2N-1
The BCD code for a decimal number is formed by
converting each digit of the decimal number to its 4-bit
binary equivalent
An alphanumeric code is one that uses groups of bits to
represent all of the various characters and functions that
are part of a typical computer’s keyboard. The ASCII code
the most widely used alphanumeric code
Number Systems 55
Logic circuits
Boolean expression
Truth table
Logic diagram
Timing diagram
Logic circuits 2
Three basic logic operations: AND, OR, NOT
Operation of logic circuits and construction of
truth tables
Timing diagrams for the various logic-circuit
gates
Boolean expression for the logic circuits
Implement logic circuits using AND, OR, NOT
Simplify logic expressions
◦ DeMorgan’s theorem
Using NAND or NOR to implement a circuit
Alternate gate symbols vs. standard logic-gate
symbols
Active high & Active low
Logic circuits 3
Logic circuits 4
The function x = f(A1, A2, …, AN) is called a
N-variable logic function if A1, A2, …,AN are
logic variables and x X, with X={0,1}.
◦ The right side: logic expression.
◦ The left side: logic variable
Logic expression (Boolean expression) is an
algebraic expression with the operands are
logic variables and operators are basic logic
operations
Logic circuits 5
Logic circuits 6
How a logic circuit’s output
depends on the logic levels
present at the inputs
◦ List all the outputs of logic circuit
based on the a combination of inputs’
values
Truth Table
◦ x is a logic 1 for every combination of input levels where
one or more inputs are 1
◦ Boolean expression x = A + B
x equals A OR B
To describe this circuit in the English language we could say
that x is true (1) WHEN A is true (1) OR B is true (1)
OR Gate
◦ is a circuit that has two or more inputs and whose output is
equal to the OR combination of the inputs
◦ its output is HIGH (logic 1) if either input A or B or both are
at a logic 1 level; for all other cases the output will be 0
Logic circuits 8
Logic circuits 9
Logic circuits 10
Logic circuits 11
Logic circuits 12
Truth Table
◦ x is a logic 1 only when both A and B are at the logic 1
level. For any case where one of the inputs is 0, the
output is 0.
◦ Boolean expression x = A.B
x equals A AND B
AND gate
◦ is a digital circuit performing the AND operation
◦ An AND gate output will be 1 only for the case when
all inputs are 1; for all other cases the output will be 0
Logic circuits 13
The AND operation is performed the same as
ordinary multiplication of 1s and 0s
An AND gate is a logic circuit that performs
the AND operation on the circuit’s inputs
An AND gate output will be 1 only for the
case when all inputs are 1; for all other cases
the output will be 0
The expression x=AB is read as “x equals A
AND B”
Logic circuits 15
Logic circuits 16
Determine the output waveform for the AND
gate
Logic circuits 17
NOT operation
◦ One variable function.
◦ Boolean expression: x = 𝐴ҧ (inverse of A, complement
of A, or NOT A)
◦ Truth table
NOT gate
◦ is a digital circuit, Inverter, performing the
NOT operation
◦ It inverts (complements) the input signal so that
whenever the input=0, output=1, and vice versa
Logic circuits 18
Logic circuits 19
NOT (invert)
◦ 1=0 0=1
Logic circuits 20
Any logic circuit, no matter how complex,
can be completely described using the three
basic Boolean operations: OR, AND, NOT
◦ the basic building blocks of digital systems
Example: logic circuit with its Boolean
expression
Logic circuits 21
Logic circuits 22
Whenever an INVERTER is present in a logic-
circuit diagram, its output expression is
simply equal to the input expression with a
bar over it
Logic circuits 23
A
A ABC
B 1
C X = ABC(A+D)
2
A+D A+D
D
(A+B)C (A+B)C
(A+B)C + D
A A+B
B 1
1
2
C 2
D
E X = [(A+B)C + D]E
Logic circuits 24
Rule
◦ First, perform all inversions of single terms
◦ Perform all operations with parentheses
◦ Perform an AND operation before an OR operation
unless parentheses indicate otherwise
◦ If an expression has a bar over it, perform the
operations inside the expression first and then
invert the result
Example, 𝑥 = 𝐴𝐵𝐶(𝐴
ҧ + 𝐷)
◦ A=0, B=1, C=1, D=1
Logic circuits 25
1
A=0 1
B=1 1
C=1 X=0
2
1 0
D=1
Determine the output for the condition where all inputs are LOW?
Logic circuits 26
Whenever you have a combinational logic circuit and you
want to know how it works, the best way to analyze it is to
use a truth table.
The advantages of this method are:
◦ It allows you to analyze one gate or logic combination at a time.
◦ It allows you to easily double-check your work.
◦ When you are done, you have a table that is of tremendous
benefit in troubleshooting the logic circuit.
Logic circuits 27
BC X = AC+BC+ABC
2
B
ABC
3
Logic circuits 28
Draw the circuit diagram to implement the
expression 𝑥 = (𝐴 + 𝐵)(𝐵 + 𝐶)
A A+B
B 1
X = (A+B)(B+C)
B+C
C 2
Logic circuits 29
Logic circuits 30
Logic circuits 31
Logic circuits 32
NAND operation
◦ Boolean expression x = 𝐴. 𝐵
◦ Symbol: 𝐴. 𝐵 (A NAND B)
◦ Truth table
NAND gate
◦ is a digital circuit performing the NAND operation
◦ the output goes LOW only when all inputs are HIGH
Logic circuits 33
Logic circuits 34
Implement the logic circuit that has the
expression 𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷 using only NOR
and NAND gates
C C+D
D
𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷
A
B
Logic circuits 35
C
1
0 C+D 𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷
D
0 1 1
A
B
1
Logic circuits 36
Exclusive-OR
◦ Boolean expression: x = 𝐴. 𝐵ത + 𝐴.ҧ 𝐵
◦ Symbol: 𝐴 ⊕ 𝐵 (A XOR B)
XOR gate
◦ is a digital circuit performing the XOR operation
◦ The circuit produces a HIGH output whenever the
two inputs are at opposite levels.
Logic circuits 37
Logic circuits 38
Exclusive-NOR
◦ Boolean expression: x = 𝐴. 𝐵ത + 𝐴.ҧ 𝐵
◦ Symbol: 𝐴 ⊕ 𝐵 (A XNOR B)
XNOR gate
◦ is a digital circuit performing the exclusive-NOR
operation
◦ The XNOR produces a HIGH output whenever the two
inputs are at the same level
Logic circuits 39
Logic circuits 40
Let X: boolean variable, 0,1: constants
Logic circuits 41
x x
x x
0 1
𝑥+0= 𝑥 𝑥. 1 = 𝑥
x x
1 0
1 0
𝑥+1 = 1 𝑥. 0 = 0
x x
x x
𝑥+𝑥 =𝑥 𝑥. 𝑥 = 𝑥
x x
1 0
𝑥+𝑥 =1 𝑥. 𝑥 = 0
Logic circuits 42
Commutativity
1. 𝑥+𝑦 =𝑦+𝑥
2. 𝑥𝑦 = 𝑦𝑥
Associativity
1. 𝑥+ 𝑦+𝑧 = 𝑥+𝑦 +𝑧
2. 𝑥𝑦 𝑧 = 𝑥(𝑦𝑧)
Distributivity
1. 𝑥 𝑦 + 𝑧 = 𝑥𝑦 + 𝑥𝑧
2. 𝑥 + 𝑦𝑧 = (𝑥 + 𝑦)(𝑥 + 𝑧)
Absorption (covering)
1. 𝑥 + 𝑥𝑦 = 𝑥
2. 𝑥 + 𝑥𝑦ҧ =𝑥+𝑦
3. 𝑥ҧ + 𝑥𝑦 = 𝑥ҧ + 𝑦
Logic circuits 43
Logic circuits 44
𝑥+𝑦 =𝑥⋅𝑦 𝑥⋅𝑦 =𝑥+𝑦
Logic circuits 45
In general,
◦ 𝑥+𝑦+𝑧 =𝑥⋅𝑦⋅𝑧
◦ 𝑥⋅𝑦⋅𝑧 =𝑥+𝑦+𝑧
Logic circuits 46
𝑥+𝑦 = 𝑥⋅𝑦
x x
𝑥+𝑦 𝑥. 𝑦
y y
x
𝑥. 𝑦 = 𝑥 + 𝑦
y
Logic circuits 47
𝑥⋅𝑦 =𝑥+𝑦
x x
𝑥+𝑦
y y
x
𝑥 + 𝑦 = 𝑥𝑦
y
Logic circuits 48
Determine the output expression for the
below circuit and simplify it using
DeMorgan’s Theorem
𝑧 = 𝐴𝐵𝐶
=𝐴+𝐵+𝐶
=𝐴+𝐵+𝐶
Logic circuits 49
Logic circuits 50
Logic circuits 51
GND GND
1 2 3 4 5 6 7 1 2 3 4 5 6 7
74LS00 74LS08
14 13 12 11 10 9 8 14 13 12 11 10 9 8
VCC VCC
GND GND
1 2 3 4 5 6 7 1 2 3 4 5 6 7
74LS02 74LS32
Logic circuits 53
74LS08 74LS00
(1) (1)
(3) (3)
(2) 1
74LS32 74LS00
(1) (2) (9)
(3) (8)
3
74LS08 74LS00
(4) (2) (4) (10)
(6) (6)
(5) 2
(5)
1 3 5
AND 7
2 4 6
AND OR
Logic circuits 54
55
Logic circuits 56
The equivalences can be extended to gates with
any number of inputs
None of the standard symbols have bubbles on
their inputs, and all the alternate symbols do
The standard and alternate symbols for each gate
represent the same physical circuit; there is no
difference in the circuits represented by the two
symbols
NAND and NOR gates are inverting gates, and so
both the standard and the alternate symbols for
each will have a bubble on either the input or the
output, AND and OR gates are non-inverting gates,
and so the alternate symbols for each will have
bubbles on both inputs and output
Logic circuits 57
Active high/low
◦ When an input or output line on a logic circuit
symbol has no bubble on it, that line is said to be
active-high, otherwise it is active-low
◦ The presence or absence of a bubble, then,
determines the active-HIGH/active-LOW status of
a circuit’s inputs and output, and is used to
interpret the circuit operation
Logic circuits 58
Active Active Active Active
HIGH LOW LOW HIGH
Output goes LOW only when all Output is HIGH when any
inputs are HIGH input is LOW
Logic circuits 59
Logic circuits 60
1. To obtain the alternate symbol for a logic gate,
take the standard symbol and change its
operation symbol (OR to AND, or AND to OR),
and change the bubbles on both inputs and
output (i.e., delete bubbles that are present,
and add bubbles where there are none).
2. To interpret the logic-gate operation, first
note which logic state, 0 or 1, is the active
state for the inputs and which is the active
state for the output. Then realize that the
output’s active state is produced by having all
of the inputs in their active state (if an AND
symbol is used) or by having any of the inputs
in its active state (if an OR symbol is used).
Logic circuits 61
Logic circuits 63
Logic circuits 64
When the output of the logic circuit goes
LOW, it activates another logic circuit. Modify
the circuit diagram to represent the circuit
operation more effective
Logic circuits 65
Logic circuits 67
Many ways
◦ Logical statements in our own language
◦ Truth tables
◦ Traditional graphic logic symbols
◦ Boolean algebra expressions
◦ Timing diagrams
Logic circuits 68
The following English expression
describes the way a logic circuit needs to
operate in order to drive a seatbelt warning
indicator in a car.
If the driver is present AND the driver is NOT
buckled up AND the ignition switch is on,
THEN turn on the warning light.
Describe the circuit using Boolean algebra,
schematic diagrams with logic symbols, truth
tables, and timing diagrams.
Logic circuits 69
Logic circuits 70
Boolean Algebra: a mathematical tool used in the
analysis and design of digital circuits
OR, AND, NOT: basic Boolean operations
OR: HIGH output when any input is HIGH
AND: HIGH output only when all inputs are HIGH
NOT: output is the opposite logic level as the input
NOR: OR with its output connected to an INVERTER
NAND: AND with its output connected to an
INVERTER
Boolean theorems and rules: to simplify the
expression of a logic circuit and can lead to a
simpler way of implementing the circuit
NAND, NOR: can be used to implement any of the
basic Boolean operations
Logic circuits 71
Dinh Duc Anh Vu
International University – VNU HCM
Boolean algebra
◦ Algebraic simplification
Designing combinational circuits
Karnaugh map simplification
Useful combinational circuits
Example:
◦ 𝐹 𝑥, 𝑦, 𝑧 = 𝑥.ҧ 𝑦. 𝑧ҧ + 𝑥.ҧ 𝑦.
ത𝑧
◦ Find 𝐻(𝑥, 𝑦, 𝑧), the dual of F
𝐻 𝑥, 𝑦, 𝑧 = 𝑥ҧ + 𝑦 + 𝑧ҧ . 𝑥ҧ + 𝑦ത + 𝑧
1. X + 0 = X -- Zero Axiom
2. X • 1 = X -- Unit Axiom
3. X + 1 = 1 -- Unit Property
4. X • 0 = 0 -- Zero Property
5. X + X = X -- Idempotence
6. X • X = X -- Idempotence
7. X + X’ = 1 -- Complement
8. X • X’ = 0 -- Complement
Consensus theorem:
◦ 𝑥 ∙ 𝑦 + 𝑥ҧ ∙ 𝑧 + 𝑦 ∙ 𝑧 = 𝑥 ∙ 𝑦 + 𝑥ҧ ∙ 𝑧
◦ 𝑥 + 𝑦 𝑥ҧ + 𝑧 𝑦 + 𝑧 = (𝑥 + 𝑦)(𝑥ҧ + 𝑧)
𝑧 = 𝐴𝐵𝐶 + 𝐴𝐵 𝐴 𝐶 = 𝐴𝐵𝐶 + 𝐴𝐵 𝐴 + 𝐶
= 𝐴𝐵𝐶 + 𝐴𝐵 𝐴 + 𝐶 = 𝐴𝐵𝐶 + 𝐴𝐵𝐴 + 𝐴𝐵𝐶 = 𝐴𝐵𝐶 + 𝐴𝐵 + 𝐴𝐵𝐶
= 𝐴𝐶 𝐵 + 𝐵 + 𝐴𝐵 = 𝐴𝐶 + 𝐴𝐵 = 𝐴(𝐶 + 𝐵)
Prove 𝑥ҧ 𝑦ത𝑧ҧ + 𝑥𝑦
ҧ 𝑧ҧ + 𝑥𝑦𝑧ҧ = 𝑥ҧ 𝑧ҧ + 𝑦𝑧ҧ
Proof:
𝑥ҧ 𝑦ത𝑧ҧ + 𝑥𝑦
ҧ 𝑧ҧ + 𝑥𝑦𝑧ҧ
=𝑥ҧ 𝑦ത𝑧ҧ + 𝑥𝑦ҧ 𝑧ҧ + 𝑥𝑦
ҧ 𝑧ҧ + 𝑥𝑦𝑧ҧ
=𝑥ҧ 𝑧(ҧ 𝑦ത + 𝑦) + 𝑦𝑧(ҧ 𝑥ҧ + 𝑥)
=𝑥ҧ 𝑧ҧ + 𝑦𝑧ҧ
QED.
𝑡 = (𝐴 + 𝐵)(𝐴 + 𝐵)
𝑥 = (𝐴 + 𝐵)(𝐴 + 𝐵 + 𝐷)𝐷
Whereas
◦ mi is the ith minterm
◦ Fi is the F-function’s value corresponding to the ith
minterm
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = σ(1,4,5,6)
whereas
◦ mi is the ith maxterm
◦ Fi is the F-function’s value corresponding to the ith
maxterm
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = σ(1,4,5,6)
𝑀𝑖 = 𝑚𝑖
𝐹 𝐴, 𝐵, 𝐶 = (0,2,3,7) = ෑ(7,5,4,0)
𝐹 𝐴, 𝐵, 𝐶 = 𝐴𝐶 + 𝐴𝐵
= 𝐴+𝐴 𝐴+𝐵 𝐶+𝐴 𝐶+𝐵 (dual of the distributive law)
= 𝐴+𝐵 𝐶+𝐴 𝐶+𝐵
= 𝐴 + 𝐵 + 𝐶𝐶 𝐶 + 𝐴 + 𝐵𝐵 𝐶 + 𝐵 + 𝐴𝐴
= 𝐴+𝐵+𝐶 𝐴+𝐵+𝐶 𝐶+𝐴+𝐵 𝐶+𝐴+𝐵 𝐶+𝐵+𝐴 𝐶+𝐵+𝐴
= 𝐴+𝐵+𝐶 𝐴+𝐵+𝐶 𝐶+𝐴+𝐵 𝐶+𝐴+𝐵
= ෑ(0,1,4,6)
A AC
1
C
BC X = AC+BC+AC
2
B
AB
3
A
1
C
X = AC+BC+AC
2
B
3 1
2 4
B
C z = A+BCD
D
A
B
C 1
D
3
A 2
11 13 0 7
X15 1 11
10 12 0 6
1 14 0 10
Boolean algebra & Combinational circuits 61
11 X 3 X 7 0 15 X 11
10 1 2 1 6 0 14 1 10
Boolean algebra & Combinational circuits 62
If the function F is given in algebraic form
◦ Convert it into Standard SOP or POS and then fill in the K-
map.
◦ If it has the form of SOP, transform it into standard SOP.
◦ If it has the form of POS, transform it into standard POS.
F AB
00 01 11 10
CD
00 00 0 4
0 12 0 8
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐴𝐵𝐶𝐷 + 𝐴𝐵𝐶 + 𝐵𝐶𝐷 + 𝐴𝐷
= σ(2,6,7,9,10,11,13,15) 01 01 0 1 1
5 13 9
11 0 1 1 15 1 11
3 7
10 1 2 1 6 0 14 1 10
Boolean algebra & Combinational circuits 63
F AB
00 01 11 10
CD
00
0 4 12 8
looping 11
Adjacent squares 3 7 15 11
Looping a quad of
adjacent 1s
eliminates two
variables that appears
in both complemented
and uncomplemented
form
Step 1. the map was obtained from the problem truth table
Step 2. Square 4 is the only square containing a 1 that is not
adjacent to any other 1. It is looped and is referred to as loop 4.
Step 3. Square 15 is adjacent only to square 11. This pair is
looped and referred to as loop 11, 15.
Step 4. There are no octets.
Step 5. Squares 6, 7, 10, and 11 form a quad. This quad is
looped (loop 6, 7, 10, 11). Note that square 11 is used again,
even though it was part of loop 11, 15.
Step 6. All 1s have already been looped.
Step 7. Each loop generates a term in the expression for X.
77
Step 1. the map was obtained from the problem truth table
Step 2. There are no isolated 1s.
Step 3. The 1 in square 3 is adjacent only to the 1 in square 7. Looping
this pair (loop 3, 7) produces the term 𝐴𝐶𝐷.
Step 4. There are no octets.
Step 5. There are two quads. Squares 5, 6, 7, and 8 form one quad.
Looping this quad produces the term 𝐴𝐵. The second quad is made up
of squares 5, 6, 9, and 10. This quad is looped because it contains two
squares that have not been looped previously. Looping this quad
produces 𝐵𝐶.
Step 6. All 1s have already been looped.
Step 7. Each loop generates a term in the expression for X.
78
Step 1. the map was obtained from the problem truth table
Step 2. There are no isolated 1s.
Step 3. The 1 in square 2 is adjacent only to the 1 in square 6. This pair
is looped to produce 𝐴𝐶𝐷. Similarly, square 9 is adjacent only to square
10. Looping this pair produces 𝐴𝐵𝐶. Likewise, loop 7, 8 and loop 11,
15 produce the terms 𝐴𝐵𝐶 and 𝐴𝐶𝐷, respectively.
Step 4. There are no octets.
Step 5. There is one quad formed by squares 6, 7, 10, and 11. This
quad, however, is not looped because all the 1s in the quad have been
included in other loops.
Step 6. All 1s have already been looped.
Step 7. Each loop generates a term in the expression for X.
79
Don’t-Care Conditions are certain input conditions for
which there are no specified output levels
Don’t-care conditions should be changed to either 0 or
1 to produce K-map looping that yields the simplest
expression
Example
F
AB
00 01 11 10
CD
00 1 1 1 1
01 1 1 1 1
11
10 1 1 1
F
AB
00 01 11 10
CD
00 1 1
01 1 1
11
10 1 1 1
F
AB
00 01 11 10
CD
00 0 0 0 0
01 0 0 0 0
11
10 0 0 0
92
Combinational Memory
Logic Gates Elements
External Inputs
Flip-Flop (FF)
Latch
Bistable multivibrator
A FF can have
◦ one or more inputs: These inputs are used to cause the FF to switch
back and forth (“flip-flop”) between its possible output states.
◦ two outputs, labeled Q and 𝑄, that are the inverse of each other
The state of a FF is referred to the state of its normal output Q
Most FF inputs need only to be momentarily activated (pulsed) in
order to cause a change in the FF output state
The output will remain in that new state even after the input
pulse is over
Pulsing the SET input to the 0 state while the RESET input is kept
1 when (a) Q = 0 prior to SET pulse; (b) Q = 1 prior to SET pulse.
Note that in both cases Q ends up HIGH
SET = RESET = 1
◦ This condition is the normal resting state, and it has no effect on
the output state. The Q and 𝑄 outputs will remain in whatever
state they were in prior to this input condition
SET =0; RESET = 1
◦ This will always cause the output to go to the state Q=1, where it
will remain even after SET returns HIGH. This is called setting the
latch.
SET = 1; RESET = 0
◦ This will always produce the state Q=0, where the output will
remain even after RESET returns HIGH. This is called clearing or
resetting the latch
SET = RESET = 0
◦ This condition tries to set and clear the latch at the same time,
and it produces 𝑄 = 𝑄 = 1. If the inputs are returned to 1
simultaneously, the resulting state is unpredictable. This input
condition should not be used.
Clock signal
◦ Outputs change state at the transition (edge) of the input clock
◦ Positive-going transitions (PGT): clock changes from 0 to 1
◦ Negative-going transitions (NGT): clock changes from 1 to 0
An edge-triggered D FF is
used to synchronize the
enabling of the AND gate
to the NGTs of the clock
True or false: The fastest method for transferring data from one
register to another is parallel transfer.
◦ True
Refer to Figure on the slide 41. Assume that the initial contents
of the registers are . Also assume that the D input of is held
HIGH. Determine the value of each FF output after the
occurrence of the fourth shift pulse.
◦ X2X1X0 = 111 Y2Y1Y0 = 101
In which form of data transfer does the source of the data not
lose its data?
◦ Parallel
The counter in the previous slide starts off in the 0000 state, and then
clock pulses are applied. Some time later the clock pulses are removed,
and the counter FFs read 0011. How many clock pulses have occurred?
◦ 16n+3 (n: integer)
Clock signal for digital clock: The 60-Hz square wave is put into a
MOD-60 counter, which is used to divide the 60Hz frequency by
exactly 60 to produce a 1Hz waveform. This 1Hz waveform is fed to a
series of counters, which then count seconds, minutes, hours, and so
on. How many FFs are required for the MOD-60 counter?
◦ 6
The CLK inputs of all of the FFs are connected together so that
the input clock signal is applied to each FF simultaneously.
Only flip-flop A, the LSB, has its J and K inputs permanently at
the HIGH level. The J, K inputs of the other FFs are driven by
some combination of FF outputs.
The synchronous counter requires more circuitry than does the
asynchronous counter.
Actual ICs
◦ 74ALS160/162, 74HC160/162: Synchronous
decade counters
◦ 74ALS161/163, 74HC161/163: Synchronous
MOD-16 counters
Design an MOD-K
up-counter, K<2N is
the same way that in
MOD 2N in which
pins “CLR” are used
to reset the counter
to the beginning
state.
◦ E.g. MOD-6 counter
produced by clearing
a MOD-8 counter
when a count of 6
occurs.
What logic levels must be present on the control inputs in order for the
74ALS162 to count pulses that appear on the CLK?
◦ All control inputs (CLR, LOAD, ENT, and ENP) on the 74162 must be HIGH.
What logic levels must be present on the control inputs in order for the
74HC190 to count down with pulses that appear on the CLK?
◦ LOAD=1, CTEN=0, and D/U=1 to count down.
S R Q(next) Q Q(next) S R
S Q 0 0 Q Q(next)=S+R’Q 0 0 0 X
SR Clk 0 1 0 0 1 1 0
SR=0
R Q’ 1 0 1 1 0 0 1
1 1 NA 1 1 X 0
J K Q(next) Q Q(next) J K
J Q
0 0 Q 0 0 0 X
JK Clk 0 1 1 X
0 1 0 Q(next)=JQ’+K’Q
K Q’ 1 0 1 1 0 X 1
1 1 Q’ 1 1 X 0
Q Q(next) D
D Q
D Q(next)
0 0 0
D Clk
Q(next)=D
0 0 0 1 1
Q’
1 1 1 0 0
1 1 1
T Q T Q(next)
Q(next)=TQ’+T’Q Q Q(next) T
T Clk 0 Q 0 0 0
Q’ 1 Q’ 0 1 1
1 0 1
1 1 0
Self-correcting counter
is one in which
normally unused states
will all somehow return
to the normal count
sequence.
Counters and Registers 44
Counters and Registers 45
0 0 0 0 0 1 0 0 1 1 0 0 1 1
1 0 0 1 0 1 1 1 1 1 0 1 0 2
2 0 1 0 0 0 0 0 1 1 0 1 1 3
3 0 1 1 1 0 1 1 1 1 1 0 0 4
4 1 0 0 0 1 0 1 0 0 0 0 0 0
5 1 0 1 0 1 0 0 0 0 0 0 1 1
6 1 1 0 0 0 0 1 0 1 1 0 0 4
7 1 1 1 1 0 0 0 0 1 1 1 0 6
1→2 →3 →4 →0 →1….
Counters and Registers 46
Counters and Registers 52
𝐽𝐴 = 𝐶
𝐾𝐴 = 1
𝐽𝐵 = 𝐴𝐶
𝐾𝐵 = 𝐴 + 𝐶
𝐽𝐶 = 𝐴𝐵
𝐾𝐶 = 1
Step 5:
Step 6:
What kind of register can have a complete binary number loaded into it
in one operation, and then have it shifted out one bit at a time?
◦ Parallel in/serial out
True or false: A serial in/parallel out register can have all of its bits
displayed at one time.
◦ True
What type of register can have data entered into it only one bit at a
time, but has all data bits available as outputs?
◦ Serial in/parallel out
In what type of register do we store data one bit at a time and have
access to only one output bit at a time?
◦ Serial in/serial out
How does the parallel data entry differ for the 74165 and the 74174?
◦ The 74165 uses asynchronous parallel data transfer; the 74174 uses synchronous
parallel data transfer.
How does the CP INH input of the 74ALS165 work?
◦ A HIGH prevents shifting on CPs