DLD - Chap1 - 2 (2nd Semester 2020-2021)
DLD - Chap1 - 2 (2nd Semester 2020-2021)
1
Course: Digital Logic Design (EE053IU)
Lecturer: Do Ngoc Hung
Office: O2.206, School of EE, IU Campus, VNU-HCM
Email: [email protected]
Number of credits: 3
Textbook:
1. Neal Widmer, Greg Moss, and Ron Tocci
“Digital Systems”, Pearson;
2. Moriss Mano, Michael D. Ciletti,
“Digital Design”, Prentice Hall,
Lecture Note & Homework: Blackboard
TA: Huynh Tran Minh Tri, email: [email protected]
Course Syllabus
2
Content
Introduction of Digital world and Number Systems
Numerical Representations
• Physical systems use quantities which must be manipulated
arithmetically.
• Quantities may be represented numerically in either analog
or digital form.
Analog Representation: a continuously variable, proportional
indicator.
• Sound through a microphone causes voltage changes.
• Automobile speedometer changes with speed.
• Mercury thermometer varies over a range of values with
temperature.
Chapter 1
8
100
95
90
85
80
75
70
Time of day
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
A .M . P.M .
Digital system:
A combination of devices that manipulate values
represented in digital form.
Quantities can take on only discrete values.
Analog system:
A combination of devices that manipulate values
represented in analog form.
Quantities can vary over a continuous range
of values.
Chapter 1
12
Temperature-regulation system
using an analog-to-digital converter.
Chapter 1
14
Advantages of digital:
Ease of design
Well suited for storing information.
Programmable operation.
Binary
Counting
Chapter 1: Digital Number Systems
20
Counting range
Horizontal scale
represents regular
intervals, starting
at time zero.
Chapter 1:Representing Binary Quantities
24
HIGH HIGH
Rising or Falling or Falling or Rising or
leading edge trailing edge leading edge trailing edge
LOW LOW
t0 t1 t0 t1
Pulse Definitions
Actual pulses are not ideal but are described by the rise time, fall
time, amplitude, and other characteristics.
Overshoot
Ringing
Droop
90%
Amplitude tW
50%
Pulse width
10%
Ringing
Pulse Definitions
In addition to frequency and period, repetitive pulse waveforms
are described by the amplitude (A), pulse width (tW) and duty
cycle. Duty cycle is the ratio of tW to T.
Volts
Pulse
width
Amplitude (A)
(tW)
Time
Period, T
Chapter 1:Digital Circuits/Logic Circuits
28
responds to
an input’s binary
level of 0 or 1
not to its
actual voltage.
Chapter 1: Integrated Circuits
29
Pins
1
Computer Printer
0
0
t0 t1
Chapter 1:Programmable Logic
35
The SPLD was the original PLD and is still available for small-
scale applications. Generally, an SPLD can replace up to ten
fixed-function ICs and their interconnections.
The CPLD is a device containing multiple SPLDs and can replace
many fixed-function ICs
An FPGA is generally more complex and has a much higher
density than a CPLD, although their applications can sometimes
overlap
Chapter 1:Binary to Decimal Conversion
38
Repeated Division-
by-2 Method
Repeated
Division
This flowchart
describes the
process and can
be used to convert
from decimal to
any other number
system.
Chapter 1:Decimal to Binary Conversion
41
Relationships between
hexadecimal, decimal, and
binary numbers.
Chapter 1:Hexadecimal Number System
49
Hex to Binary
Leading zeros can be added to the left of the MSB to
fill out the last group.
Hex to Binary
Convert from binary to hex by grouping bits in four
starting with the LSB.
Each group is then converted to the hex equivalent
• The binary number is grouped into groups of four bits &
each is converted to its equivalent hex digit.
Counting in Hex
When counting in hex, each digit position can
be incremented (increased by 1) from 0 to F.
On reaching value F, it is reset to 0, and the
next digit position is incremented.
Example:
38,39,3A,3B,3C,3D,3E,3F,40,41,42
When there is a 9 in a digit position, it becomes an A when it is incremented.
Question
BCD Addition
Step 1: Add the two BCD numbers
Step 2: If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
Step 3: If a 4-bit sum is greater than 9, or if a carry out of the 4-bit group is
generated, it is an invalid result. Add 6 (0110) to the 4-bit sum in order to skip the
six. If a carry results when 6 is added, simply add the carry to the next 4-bit group.
Chapter 1: Gray Code
62
There is a possibility that errors can occur such that the receiver does
not receive the identical information that was sent by the transmitter.
One of the simplest and most widely used schemes for error detection
is the parity method
Chapter 1: Parity Method For Error Detection
68
Parity bit
A parity bit is an extra bit that is attached to a code group that is
being transferred from one location to another.
The parity bit is made either 0 or 1, depending on the number of
1s that are contained in the code group.
The even-parity method, the value of the parity bit is chosen so
that the total number of 1s in the code group (including the parity
bit) is an even number.
The odd-parity method is used in exactly the same way except that
the parity bit is chosen so the total number of 1s (including the
parity bit) is an odd number.
The parity bit is issued to detect any single-bit errors
Chapter 1: 1’s complement
69
0 0 1 1 0 1 0 1
Chapter 1: 2’s complement
70
0 0 1 1 0 1 0 1
Input bits
Carry
Adder
in (add 1)
Output bits (sum)
0 0 1 1 0 1 1 0
Chapter 1: 2’s complement
71
There are several ways to represent signed binary numbers. In all cases, the
MSB in a signed number is the sign bit, that tells you if the number is
positive or negative.
Sign-Magnitude Form
When a signed binary number is represented in sign-magnitude, the left-most
bit is the sign bit and the remaining bits are the magnitude bits.
For example, using eight bits, the decimal number -25 is expressed
as the 1’s complement of +25 (00011001) as 11100110
Chapter 1: Signed Binary Numbers
74
Subtraction
Subtraction is a special case of addition. The subtraction operation
changes the sign of the subtrahend and adds it to the minuend.
The result of subtraction is called the difference.
To subtract two signed numbers, take the 2’s complement of the subtrahend
and add. Discard any final carry bit.
Chapter 1: Signed Binary Numbers
82
Rules for subtraction: 2’s complement the subtrahend and add the
numbers. Discard any final carries. The result is in signed form.
Multiplication
The numbers in a multiplication are the multiplicand, the multiplier, and the product
Multiplication
In the direct addition method, you add the multiplicand a number of times equal
to the multiplier.
Chapter 1: Signed Binary Numbers
87
Multiplication
The partial products method is perhaps the more common one because it
reflects the way you multiply longhand. The multiplicand is multiplied by each
multiplier digit beginning with the least significant digit. The result of the
multiplication of the multiplicand by a multiplier digit is called a partial product.
Chapter 1: Signed Binary Numbers
88
Division
The numbers in a division are the dividend, the divisor, and the quotient. These
are illustrated in the following standard division format.
The sign of the quotient depends on the signs of the dividend and the divisor
according to the following two rules:
Division
The basic steps in a division process are as follows:
Step 1: Determine if the signs of the dividend and divisor are the same or
different. This determines what the sign of the quotient will be. Initialize the
quotient to zero.
Step 2: Subtract the divisor from the dividend using 2’s complement addition to
get the first partial remainder and add 1 to the quotient. If this partial remainder
is positive, go to step 3. If the partial remainder is zero or negative, the division
is complete.
Step 3: Subtract the divisor from the partial remainder and add 1 to the quotient.
If the result is positive, repeat for the next partial remainder. If the result is zero
or negative, the division is complete.
Continue to subtract the divisor from the dividend and the partial remainders
until there is a zero or a negative result. Count the number of times that the
divisor is subtracted and you have the quotient.
Chapter 1: Signed Binary Numbers
94
Chapter 1: Signed Binary Numbers
95