Digital Principal 1
Spring 2022
© Zohreh Motamedi– ENGI10701(DP1)
1
Course Information
Textbook:
• "Digital Electronics: a Practical Approach", 11th Edition, William Kleitz, Prentice Hall.
Video: The author’s Youtube channel:
https://www.youtube.com/channel/UCFC56lANq_FESHes9j0NKnw
Labs: Will be posted on SLATE.
Class Plan: on SLATE.
© Zohreh Motamedi– ENGI10701(DP1)
2
Evaluation Plan (Class Plan posted on SLATE)
• Labs (10 @ 3% each)
30%
• Midterm Exam
30%
• Final Exam
30%
• Quizzes (2 @ 5% each)
10% (Week 4th & Week 10th)
• Assignments,
will be posted on SLATE / Assignment
Lab attendance is mandatory
DUAL PASS PROVISION: Students must obtain at least 50% on the exams/Quizzes
and 50% on the labs component of this course in order to obtain a passing grade.
© Zohreh Motamedi– ENGI10701(DP1)
3
Check the Class Plan Posted on SLATE
© Zohreh Motamedi– ENGI10701(DP1)
4
Breach of Academic Integrity
• Zero-Tolerance!
• Study the Academic Integrity Policy & Procedure posted on SLATE.
(My apologies to all those of you that wouldn’t even think of it…)
© Zohreh Motamedi– ENGI10701(DP1)
5
Evaluation Schedule
Make sure you are available for the quiz 1 and Midterm.
– Quiz 1: Week 4, Monday, May 30
– Midterm: Week 7, Monday, June 20
Office Hour: TBA. Send an email to book an appointment.
© Zohreh Motamedi– ENGI10701(DP1)
6
• Have a pen and paper during the Lectures
© Zohreh Motamedi– ENGI10701(DP1)
7
This Week Lab 0
Multisim & Tinkercad
Lab0 uploaded on SLATE already. If you have already installed them no need to install it
again. Simulate the circuits in Lab0 and upload your file on SLATE.
Tinkercad Circuits: in an online platform. No need to install. Make an account and sign in
to use.
© Zohreh Motamedi– ENGI10701(DP1)
8
Digital Electronics in your daily life
Let’s list a few digital devices in our daily life:
•
……
•
……
•
……….
•
…………
•
………………
•
……………………
https://www.linkedin.com/learning/computer-science-principles-digital-information/yes-and-no-answers-with-binary?u=2272289
© Zohreh Motamedi– ENGI10701(DP1)
9
Course Learning Outcomes
The first Digital Electronics course
Understand the main building blocks of digital circuits
Including:
Number systems, BCD, and ASCII code
Boolean Algebra.
Logic gates: Inverter, AND, and OR gates.
Apply various techniques for digital logic simplification.
Explain the design and operation of the building blocks of Digital Systems
© Zohreh Motamedi– ENGI10701(DP1)
10
Analog Signal vs. Digital Signal
An analog signal is continuous signal in both, time and amplitude.
A digital signal refers to an electrical signal that is converted into a pattern of bits.
© Zohreh Motamedi– ENGI10701(DP1)
11
Data Representation in the Computer
Computers work with 0 and 1.
All kinds of information such as, sounds, pictures, videos, numbers, and text
are converted into digital data, 0 and 1, to enter the digital world.
© Zohreh Motamedi– ENGI10701(DP1)
12
Converting analog sound to digital (ADC)
& back digital to analog (DAC).
© Zohreh Motamedi– ENGI10701(DP1)
13
Analog/Digital Conversion
© Zohreh Motamedi– ENGI10701(DP1)
14
Number Systems
Number Systems:
• Decimal, Binary and Hexadecimal number systems
• BCD
Letters:
• ASCII Codes
© Zohreh Motamedi– ENGI10701(DP1)
15
Numbering Systems
Base 10 (Decimal) — Represent any number using 10 digits [0–9]
Base 2 (Binary) — Represent any number using 2 digits [0–1]
Base 16 (Hexadecimal) — Represent any number using 10 digits and 6
characters [0–9, A, B, C, D, E, F]
© Zohreh Motamedi– ENGI10701(DP1)
16
Decimal Numbering System (Base 10)
In the Base-10 world (Decimal), there are ten possible digits that each
position can take (0-9).
Example: 436
Most Significant Bit
MSB
LSB
Least Significant Bit
4
3
Value:
4*100
3*10
6*1
Exponential
Expression:
4*102
3*101
6*100
Number:
© Zohreh Motamedi– ENGI10701(DP1)
6
17
Binary Numbering System (Base 2)
In the Base-2 world (Binary), there are 2 possible digits “0”, and “1”
S = {0, 1}
The symbols in this system are referred to as bits (binary digit).
https://www.youtube.com/watch?v=s0pi-VoaZyU&list=PLE7E5C88AA6AEA0A2&index=3
© Zohreh Motamedi– ENGI10701(DP1)
18
Binary Numbering System (Base 2)
• Example: 1012
Number:
1
0
1
Weight
22
21
20
Value:
1*4
+
0*2
+
1*1
© Zohreh Motamedi– ENGI10701(DP1)
=5
19
Converting Base-2 to Base-10
1 0 0 1 12
Exponent:
Calculation:
16 0 0 2 1 1910
+
+
+
+
© Zohreh Motamedi– ENGI10701(DP1)
=
20
Powers-of-2 Binary Weighting Factors
© Zohreh Motamedi– ENGI10701(DP1)
21
Example
• Convert the binary number 100110 to decimal.
1 0 0 1 1 02
Exponent:
Calculation:
32 0 0 4 2 0
+
+
+
+
+
© Zohreh Motamedi– ENGI10701(DP1)
=
3810
22
Practice
• Let's practice. Do not use a web converter!
• 00000000 -->
• 00001111 -->
• 01101011 -->
• 11111111 -->
© Zohreh Motamedi– ENGI10701(DP1)
23
Converting Base-10 to Base-2
STEP ONE: Find the largest exponent of two that is less than or equal to the
Base-10 number:
2210=
16 8
24 23
4
22
2
21
1
20
© Zohreh Motamedi– ENGI10701(DP1)
24
Converting Base-10 to Base-2
STEP Two: Place a “1” above the left-most position:
2210=
1
16 8
24 23
4
22
2
21
1
20
© Zohreh Motamedi– ENGI10701(DP1)
25
Converting Base-10 to Base-2
Step Three: Add left-most value to the next position. Put a “0” above is
the sum is greater than the number being converted, otherwise put a “1”
above:
2210=
1
0
16
24
8
23
4
22
2
21
1
20
© Zohreh Motamedi– ENGI10701(DP1)
26
Converting Base-10 to Base-2
Step Four: Add subsequent positions. If the sum is greater than the
number being converted, put a “0” above and disregard it. Otherwise,
put a “1” above and including it in your running total.
2210=
1
16
24
0
8
23
1
4
22
1
2
21
0
1
20
© Zohreh Motamedi– ENGI10701(DP1)
27
Converting Base-10 to Base-2
Step Five: The resulting 1s and 0s in the top row form the binary
equivalent of the Base-10 number with which we started:
2210 = 101102
MSB
Most significant bit
Least significant bit
© Zohreh Motamedi– ENGI10701(DP1)
LSB
28
Converting Decimal to Binary, another Method
Successive Division:
22/2=11
With a remainder of 0 (LSB)
11/2=5
With a remainder of 1
5/2=2
With a remainder of 1
2/2=1
With a remainder of 0
1/2=0
With a remainder of 1 (MSB)
2210 = 101102
© Zohreh Motamedi– ENGI10701(DP1)
29
Example
• Convert the Decimal number 40 to binary.
© Zohreh Motamedi– ENGI10701(DP1)
30
Example
• Convert these Decimal numbers to binary.
• 16
& 15
• 32
& 31
• 64
& 63
• 128
& 127
• 256
& 255
• 512
• 10000
& 1111
• 1 0000 0000 & 1111 1111
& 511
• 1024 & 1023
© Zohreh Motamedi– ENGI10701(DP1)
31
Example
Convert the following decimal numbers into binary (no web converter).
• 70
• 25
• 49
• 231
© Zohreh Motamedi– ENGI10701(DP1)
32
Binary Game
Click to play:
https://studio.code.org/projects/applab/iukLbcDnzqgoxuu810unLw
© Zohreh Motamedi– ENGI10701(DP1)
33
Hexadecimal Numbering (Base 16)
• Hexadecimal number is a Base-16 numbering system.
• Hexadecimal is a convenient way to represent binary numbers.
• Base = 16 or ‘H’
16 symbols: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}
{ 10=A, 11=B, 12=C, 13=D, 14=E, 15=F}
© Zohreh Motamedi– ENGI10701(DP1)
34
Hexadecimal Numbering Systems
Decimal
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Hexadecimal
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Binary
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
© Zohreh Motamedi– ENGI10701(DP1)
35
Hexadecimal Numbering Systems
• Repeated Division by 16
• Example
21310 = ( )16 ?
Divide-by -16
213 / 16
13 / 16
Quotient
13
0
Remainder
5
13
Hex digit
Lower digit = 5
Second digit =D
© Zohreh Motamedi– ENGI10701(DP1)
36
Hexadecimal Numbering Systems
• How to convert D516 back to Decimal ?
• Use this table and multiply the digits with the position values.
Digit
8
167
Digit
7
166
Digit
6
165
Digit
5
164
Digit
4
163
Digit
3
162
Digit
2
161
Digit
1
160
……
……
…..
……
4096
256
16
1
D×161 + 5×160 = 13×16 + 5×1
= 208 + 5
= 213
© Zohreh Motamedi– ENGI10701(DP1)
37
Example
Convert A28H into a decimal number.
© Zohreh Motamedi– ENGI10701(DP1)
38
Example
Convert A28H into a decimal number.
Answer: 2560+32+8=2600
© Zohreh Motamedi– ENGI10701(DP1)
39
Convert Binary to Hex
•
Group into 4's starting at least significant symbol (if the number of bits is
not evenly divisible by 4, then add 0's at the most significant end)
•
Write a hex digit for each group.
•
Example: 101 1110 0111 0000
0101 1110
5
E
0111 0000
7
0
© Zohreh Motamedi– ENGI10701(DP1)
40
Example
Convert 10010100110000 to Hex.
© Zohreh Motamedi– ENGI10701(DP1)
41
Example
Convert 10010100110000 to Hex.
Solution:
10 0101 0011 0000
This group has only two bits, to make it a group of 4
bits add zeros in MSB position
0010
2
0101 0011 0000
5
3
0
© Zohreh Motamedi– ENGI10701(DP1)
42
Convert Hex to Binary
•
For each of the Hex digit write its binary equivalent (use 4 bits to represent)
• Example
Convert 25A0 to binary
0010 0101 1010 0000
© Zohreh Motamedi– ENGI10701(DP1)
43
Example
Convert A42F to Binary.
•
•
The Battery Service UUID: 0x180F
Battery Level Characteristic UUID: 0x2A19
© Zohreh Motamedi– ENGI10701(DP1)
44
Example
Convert A42F to Binary.
Solution:
1010 0100 0010 1111
© Zohreh Motamedi– ENGI10701(DP1)
45
Binary Coded Decimal (BCD)
• With BCD code, each individual digit of the decimal number system
is represented by a corresponding binary number.
– Such as 19
0001 1001
0010 0010 : 0000 0011
© Zohreh Motamedi– ENGI10701(DP1)
46
Binary-Coded-Decimal System
•
Simply, each individual digit of the decimal number system is represented
by a corresponding binary number.
Example:
Decimal number 71-33 is thus represented
0111 0001 - 0011 0011
BCD code
© Zohreh Motamedi– ENGI10701(DP1)
47
Binary-Coded-Decimal System
Example:
Number 0101 : 0010 0111 in BCD code
represents 5 : 27 decimal number
© Zohreh Motamedi– ENGI10701(DP1)
48
Example
Convert 84:31 to BCD.
© Zohreh Motamedi– ENGI10701(DP1)
49
Example
Convert 84:31 to BCD.
Solution:
1000 0100:0011 0001
© Zohreh Motamedi– ENGI10701(DP1)
50
Comparison of Numbering Systems
© Zohreh Motamedi– ENGI10701(DP1)
51
MEET Tutoring
Digital Principles1 ENGI10701
© Zohreh Motamedi– ENGI10701(DP1)
52