Digital Electronics and
Microprocessor Fundamentals
Chapter 01 : Digital & Number Systems
2023/9/12 p.1
Electronics
2023/9/12 (C) VTC p.2
Electronics
2023/9/12 (C) VTC p.3
Analogue vs Digital
◼ an analog quantity has continuous values.
e.g. resistors, capacitors, inductors, diodes, transistors, operational
amplifiers and voltage divider.
◼ a digital quantity has a discrete set of values.
e.g. logic gates or more complex digital ICs
Variations of an Analog quantity Variations of a Digital quantity
2023/9/12 (C) VTC p.4
Analogue vs Digital
This is an analog clock. The hands This is a digital clock and is
move continuously, though slow, accurate just down to a single
and the viewer has to determine second since that it the
how exact he wants a reading to be. minimum value displayed.
It is possible to guess at possible
parts of a second.
(C) VTC p.5
2023/9/12
Analogue vs Digital
(C) VTC p.6
2023/9/12
Analogue vs Digital
◼ Many systems use a mix of analog and digital electronics
(mixed mode circuits) to take advantage of each
technology.
❑ Example: A typical CD player reads digital data from the CD-
ROM and converts it to an analog signal for amplification.
2023/9/12 (C) VTC p.7
Analogue vs Digital
Why do we need convert analogue to digital ?
Ans: We convert the Analogue signal to digital in order to make the data
readable in digital equipment and understandable by the microprocessor. Also, it
is easy to perform mathematical manipulation to the data.
Example: - Store music (analog) in a CD
- Voltmeters, digital Multimeters
Why do we need convert digital to analogue ?
Ans: We convert the convert the digital audio file to analog signal in
order to play music on a speaker.
Example: - computer sound cards, and portable systems, digital cell
phones contain DAC to convert the digital representation to
analog signal.
- control motor speed by PWM
p.8
2023/9/12
Analogue vs Digital
◼ Digital electronics uses circuits that have two states, which are
represented by two different voltage levels called HIGH and LOW.
◼ Voltage value is represented in numbers in a binary system.
❑ In binary systems, a single number is called a bit (for binary digit).
A bit can have the value of either a 1 or a 0, depending on if the
voltage is HIGH or LOW.
2023/9/12 (C) VTC p.9
Analogue vs Digital
Pros Cons
Digital Digital signals can convey Cyber Security : Criminals,
information with less noise & hackers, terrorists, foreign
interference, and transmitted over enemies can get access to this
long distances.
data.
Digital circuits can be reproduced Lack of Socialization: face-to-
easily in mass quantities at low costs face conversations, socialization
is rare these days.
Digital can sent information Addiction to social media,
faster computer games, messaging,
and dating websites can be
hazardous
Analogue Analog signals best suited for Data transmission at long
audio and video transmission distances may result in
undesirable signal disturbances.
Analog signals provide a more Noise In Analog Signal
accurate representation of
2023/9/12 changes in physical phenomena,
(C) VTC p.10
(e.g. sound, light, temperature)
Number Systems - Positional Notation
◼ The position of each digit in a weighted number system
is assigned a weight based on the base or radix of the
system.
◼ Example: Decimal Number System
365
5 ×100 = 5
6 ×101 = 60
3 ×102 = 300
Total 365
2023/9/12 p.11
Decimal Number System
◼ Radix = 10
◼ 10 symbols (0 through 9) are used to represent any
number
◼ The column weights of decimal numbers are powers of
ten that increase from right to left beginning with 100 = 1
…105 104 103 102 101 100
◼ For fractional decimal numbers, the column weights are
negative powers of ten that decrease from left to right:
…102 101 100 . 10-1 10-2 10-3 10-4 …
2023/9/12 p.12
Decimal Number System - Example
◼ Express the number 480.52 as the sum of values of
each digit.
Solution:
480.52
= (4 x 102) + (8 x 101) + (0 x 100) + (5 x 10-1) +(2 x 10-2)
2023/9/12 p.13
Binary Number System
◼ Radix = 2
◼ Digits 0 and 1 are used to represent any number
❑ A binary digit is called a bit
◼ MSB bit vs LSB bit
◼ The column weights of binary numbers are powers of 2
that increase from right to left beginning with 20 = 1
… 25 24 23 22 21 20
◼ For fractional binary numbers, the column weights are
negative powers of 2 that decrease from left to right:
… 22 21 20 . 2-1 2-2 2-3 2-4 …
2023/9/12 p.14
Binary Number System
◼ A binary counting sequence for
numbers from zero to fifteen is shown
❑ Notice the pattern of zeros and
ones in each column.
2023/9/12 p.15
Hexadecimal Number System
◼ Radix = 16
◼ 16 symbols (0 through 9 and followed by A through F)
are used to represent any number
◼ The column weights of hexadecimal numbers are
powers of ten that increase from right to left beginning
with 160 = 1
…165 164 163 162 161 160
◼ For fractional hexadecimal numbers, the column weights
are negative powers of 16 that decrease from left to right:
…162 161 160 . 16-1 16-2 16-3 16-4 …
2023/9/12 (C) VTC p.16
Inter-conversion
◼ A decimal number can be converted to binary by using
the sum-of-weight or the repeated division-by-2 method
(Double-Dabble Method).
◼ A binary number can be converted to a decimal number
by summing the decimal values of the weight of all the
1s in the binary number.
◼ A decimal fraction can be converted to binary by using
the repeated multiplication-by-2 methods.
◼ One hexadecimal digit represents a 4-bit binary number.
◼ A decimal number can be converted to hexadecimal by
the repeated division-by-16 method.
2023/9/12 (C) VTC p.17
Inter-conversion - Examples
◼ Binary-to-Decimal Conversion
Convert the binary number 110101.1011(2) to decimal
form.
(110101.1011)₂ = (1 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (1 × 2²) + (0
× 2¹) + (1 × 2⁰) + (1 × 2⁻¹) + (0 × 2⁻²) + (1 × 2⁻³) + (1 × 2⁻⁴)
= (53.6875)₁₀
2023/9/12 p.18
Inter-conversion - Examples
◼ Decimal-to Binary Conversion
Convert the 12.625(10) e decimal number 12.625(10) to
binary.
12.625(10) = 01100.1012
2023/9/12 p.19
Inter-conversion - Examples
◼ Binary-to-Hexadecimal Conversion
Convert the following binary number to hexadecimal:
1100101001010111(2)
= CA57 16
110011.011(2)
= 33.6 16
p.20
2023/9/12
Inter-conversion - Examples
◼ Hexadecimal-to-Binary/Decimal Conversion
Convert the following hexadecimal number to binary and
decimal forms:
AB5.1C(16) = 0101010110101.000111
(AB5.1C)₁₆ = (10 × 16²) + (11 × 16¹) + (5 × 16⁰) + (1 × 16⁻¹)
+ (12 × 16⁻²) = (2741.109375)₁₀
2023/9/12 p.21
Binary Addition
◼ Basic rules for binary addition (without considering carry
input)
0 + 0 = 00 Carry-out = 0, Sum = 0
0 + 1 = 01 Carry-out = 0, Sum = 1
1 + 0 = 01 Carry-out = 0, Sum = 1
1 + 1 = 10 Carry-out = 1, Sum = 0
◼ Basic rules for binary addition (With carry input)
1 + 0 + 0 = 01 Carry-out = 0, Sum = 1
1 + 0 + 1 = 10 Carry-out = 1, Sum = 0
1 + 1 + 0 = 10 Carry-out = 1, Sum = 0
1 + 1 + 1 = 11 Carry-out = 1, Sum = 1
2023/9/12 p.22
Negative Numbers
◼ signed numbers
❑ Numbers with ‘+’ and ‘-’ signs
◼ Various representations for binary systems
❑ Signed magnitude form
◼ Less popular in arithmetic operations
❑ 2’s complement form
◼ Very popular in digital computers
◼ Binary subtraction is accomplished with addition by
using the 2’s complement form
2023/9/12 p.23
Representation of Negative Numbers
◼ Signed-Magnitude form
❑ a symbol to represent the sign
◼ the MSB (left-most bit) in a signed number is the
sign bit
❑ 0 for +ve
❑ 1 for –ve
❑ a magnitude part
◼ the right-most (N-1) bits
◼ true binary for both positive and negative numbers
2023/9/12 p.24
Representation of Negative Numbers
◼ Example:
The decimal numbers +25(10) and -25(10) are expressed
as 8-bit signed binary numbers.
+25 = 0 0 0 1 1 0 0 1 -25 = 1 0 0 1 1 0 0 1
Sign Bit Magnitude Sign Bit Magnitude
(0 for +ve) Bits (1 for -ve) Bits
2023/9/12 p.25
Representation of Negative Numbers
◼ 2’s complement form
❑ Must first decide how many bits to represent the number – say n
◼ Positive number in 2’s complement form is the same as in the
signed magnitude form.
◼ Negative number in 2’s complement form is
-N = 2’s complement of (N) = (1’s complement of N) + 1
❑ Usually employed to implement binary subtraction
◼ Short Question:
What is 1’s complement form ?
26
Representation of Negative Numbers
◼ Example:
Express the decimal number -79(10) as an 8-bit number in
the signed magnitude and 2’s complement forms.
Step 1: Convert the given decimal number to binary.
Step 2: Take one’s complement of the binary number by
converting each 0 to 1 and 1 to 0.
Step 3: Add 1 to the one’s complement.
27
Q&A
End-of-Chapter 01
2023/9/12 p.28