PHYS 347 Lecture Notes On Digital Electronics 1 2023 - 2024
PHYS 347 Lecture Notes On Digital Electronics 1 2023 - 2024
Analog Quantities
Most natural quantities that we see are analog and vary
continuously. Analog systems can generally handle higher
power than digital systems.
Temperature
(°F)
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 Quantities
Digital quantities operate with digital signals.
Digital signals are essentially a series of pulses or rapidly
changing voltage levels that vary in discrete steps or
increments.
Decimal Numbers
The position of each digit in a weighted number system is
assigned a weight based on the base or radix of the system.
The radix of decimal numbers is ten, because only ten
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 …
PHYS 347 Electronics I
Decimal Numbers
Decimal numbers can be expressed as the sum of the
products of each digit times the column value for that digit.
Thus, the number 9240 can be expressed as
(9 x 103) + (2 x 102) + (4 x 101) + (0 x 100)
or
9 x 1,000 + 2 x 100 + 4 x 10 + 0 x 1
Binary Numbers
For digital systems, the binary number system is used.
Binary has a radix of two and uses the digits 0 and 1 to
represent quantities.
The column weights of binary numbers are powers of
two 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 two that decrease from left to right:
Binary Conversions
Binary Conversions
Answer: 1 1 0 0 0 1 remainder
0 1 3 6 12 24 49 2
Continue until the
Quotient Decimal base
last quotient is 0 number
PHYS 347 Electronics I
Binary Addition
Binary Addition
Binary Subtraction
1’s Complement
0 0 1 1 0 1 0 1
PHYS 347 Electronics I
2’s Complement
The 2’s complement of a binary number is found by
adding 1 to the LSB of the 1’s complement.
Recall that the 1’s complement of 11001010 is
00110101 (1’s complement)
To form the 2’s complement, add 1: +1
1 1 0 0 1 0 1 0 00110110 (2’s complement)
1
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
PHYS 347 Electronics I
Signed Binary Numbers
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.
Computers use a modified 2’s complement for
signed numbers. Positive numbers are stored in true form
(with a 0 for the sign bit) and negative numbers are stored
in complement form (with a 1 for the sign bit).
For example, the positive number 58 is written
using 8-bits as 00111010 (true form).
Sign bit Magnitude bits
PHYS 347 Electronics I
Signed Binary Numbers
Negative numbers are written as the 2’s complement of
the corresponding positive number.
The negative number -58 is written as:
-58 = 11000110 (complement form)
Sign bit Magnitude bits
An easy way to read a signed number that uses this notation is to assign
the sign bit a column weight of -128 (for an 8-bit number). Then add the
column weights for the 1’s.
Assuming that the sign bit = -128, show that
11000110 = -58 as a 2’s complement signed number:
Column weights: -128 64 32 16 8 4 2 1.
1 1 0 0 0 1 1 0
-128 +64 +4 +2 = -58
PHYS 347 Electronics I
Arithmetic Operations with Signed Numbers
Using the signed number notation with negative numbers
in 2’s complement form simplifies addition and subtraction
of signed numbers.
Discard Discard
carry carry
PHYS 347 Electronics I
Hexadecimal Numbers Decimal Hexadecimal Binary
0 0 0000
Hexadecimal uses sixteen characters to 1 1 0001
represent numbers: the numbers 0 2 2 0010
through 9 and the alphabetic 3 3 0011
characters A through F. 4 4 0100
5 5 0101
Large binary number can easily 6 6 0110
be converted to hexadecimal by 7 7 0111
grouping bits 4 at a time and writing 8 8 1000
9 9 1001
the equivalent hexadecimal character.
10 A 1010
Express 1001 0110 0000 11102 11 B 1011
in hexadecimal: 12 C 1100
13 D 1101
Group the binary number by 14 E 1110
4-bits starting from the right. 15 F 1111
Thus, 960E
PHYS 347 Electronics I
Hexadecimal Numbers Decimal Hexadecimal Binary
0 0 0000
Hexadecimal is a weighted number 1 1 0001
system. The column weights are 2 2 0010
powers of 16, which increase from 3 3 0011
right to left. 4 4 0100
5 5 0101
Column weights { 163 162 161 160
4096 256 16 1
6 6 0110
. 7 7 0111
. 8 8 1000
Express 1A2F16 in decimal. 9 9 1001
10 A 1010
11 B 1011
Start by writing the column weights:
12 C 1100
4096 256 16 1
13 D 1101
1 A 2 F16
14 E 1110
1(4096) + 10(256) +2(16) +15(1) = 670310 15 F 1111
PHYS 347 Electronics I
Octal Numbers Decimal Octal Binary
0 0 0000
Octal uses eight characters the
1 1 0001
numbers 0 through 7 to represent 2 2 0010
numbers. There is no 8 or 9 character 3 3 0011
in octal. 4 4 0100
5 5 0101
Binary number can easily be
6 6 0110
converted to octal by grouping bits 3 7 7 0111
at a time and writing the equivalent 8 10 1000
octal character for each group. 9 11 1001
10 12 1010
Express 1 001 011 000 001 11 13 1011
1102 in octal: 12 14 1100
Group the binary number by 3- 13 15 1101
14 16 1110
bits starting from the right.
15 17 1111
Thus, 1130168
PHYS 347 Electronics I
Octal Numbers Decimal Octal Binary
0 0 0000
1 1 0001
Octal is also a weighted number system. 2 2 0010
The column weights are powers of 8, 3 3 0011
which increase from right to left. 4 4 0100
5 5 0101
6 6 0110
7 7 0111
Column weights { 8 3 82 81 8
512 64 8 1
. 0
8 10 1000
9 11 1001
Express 37028 in decimal. 10 12 1010
11 13 1011
Start by writing the column weights: 12 14 1100
512 64 8 1 13 15 1101
3 7 0 28 14 16 1110
3(512) + 7(64) +0(8) +2(1) = 198610 15 17 1111
PHYS 347 Electronics I
BCD Decimal Binary BCD
0 0000 0000
Binary coded decimal (BCD) is a 1 0001 0001
weighted code that is commonly 2 0010 0010
used in digital systems when it is 3 0011 0011
4 0100 0100
necessary to show decimal
5 0101 0101
numbers such as in clock displays. 6 0110 0110
7 0111 0111
The table illustrates the 8 1000 1000
difference between straight 9 1001 1001
binary and BCD. BCD represents 10 1010 0001 0000
each decimal digit with a 4-bit 11 1011 0001 0001
code. Notice that the codes 1010 12 1100 0001 0010
13 1101 0001 0011
through 1111 are not used in 14 1110 0001 0100
BCD. 15 1111 0001 0101
PHYS 347 Electronics I
BCD
ASCII