Sunteți pe pagina 1din 27

Centennial College

School of Engineering Technology &


Applied Science (SETAS)

Sustainable Design & Renewable


Energy (SDRE)

ESET211 – Digital and Power Electronic

Week#1 – Introduction to Digital


Electronics, Numbering System and Code
Week#1 Learning Outcome
1. Introduction
1. Digital versus Analog
2. Digital Representation of Analog Quantities
3. Digital Logic Level
2. Numbering Systems
1. Decimal Numbering System (Base10)
2. Octal Numbering System (Base8)
3. Octal ↔ Decimal Conversion
4. Binary Numbering System (Base2)
5. Binary ↔ Decimal Conversion
6. Octal ↔ Binary Conversion
7. Hexadecimal Numbering System (Base16)
8. Hexadecimal ↔ Decimal Conversion
9. Hexadecimal ↔ Binary Conversion
3. Digital Codes
1. Binary Coded Decimal (BCD)
2. Comparison on Numbering systems and BCD
3. Other Digital Codes
4. ASCII Code
4. Numbering Systems Applications
5. Summary

School of Engineering Technology and Applied Science (SETAS) /


2 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
1.1- Digital versus Analog

 Analog
 Continuously varying
 Examples:temperatur
e, pressure, velocity

 Digital
 OFF and ON states
that can be
represented using
0s and 1s
(respectively).
School of Engineering Technology and Applied Science (SETAS) /
3 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
1.2- Digital Representation of Analog Quantities(1)

 Audio Recording
 Audio CD and MP3 players/recorders
 Video Recording
 DVDs store digital representations of analog video
and audio signals

School of Engineering Technology and Applied Science (SETAS) /


4 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
1.2- Digital Representation of Analog Quantities(2)

School of Engineering Technology and Applied Science (SETAS) /


5 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
1.2- Digital Representation of Analog Quantities(3)
 Energy technicians must keep track of the efficiency of their energy
collection systems.
 Naturally occurring quantities like solar, wind, and temperature are
analog quantities and must be digitized before a computer can
understand them.

School of Engineering Technology and Applied Science (SETAS) /


6 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
1.3 - Digital Logic Levels

 Digitally represented quantities are usually represented by binary,


or base 2, numbers.
 Describing a digital quantity electronically, we need to have a
system that uses voltages or currents to symbolize binary numbers.
 The binary number system has only two digits: 0 and 1

 Each of these digits can be denoted by a different voltage called a


logic level
 The lower voltage (usually 0 volts) is called a logic LOW or logic 0
and represents the digit 0.
 The higher voltage (traditionally 5 volts) is called a logic HIGH or
logic 1 and represents the digit 1.
 The system assigning the digit 1 to a logic HIGH and digit 0 to logic
LOW is called positive logic.

School of Engineering Technology and Applied Science (SETAS) /


7 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.1 Decimal Numbering System (Base 10)

 10 possible digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9


 Least-significant position is on the right end
 Most-significant position is on the left end
 Weighting factor of 10
 Any real or integer numbers can be represented using a finite
number of symbols ( Digits) .
 The decimal systems is a positional notation system. The value of
a digit in the system depends on its placement within a number.
 Examples:
845=800+40+5 = 8 × 102+4× 101+ 5 × 100

9426.32=9000+400+20+6+0.3+0.02= 9×103+4×102+2×101
+6×100+3×10-1 +2×10-2
School of Engineering Technology and Applied Science (SETAS) /
8 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.2 Octal Numbering System (Base 8)

 Eight allowable digits: 0, 1, 2, 3, 4, 5, 6,


and 7
 Weighting factor of 8
 In this system after counting to7 we have
to repeat from 0.
 In such system (OCTAL) a number can
be presented as summation of powers of
8.

School of Engineering Technology and Applied Science (SETAS) /


9 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.3 - Octal ↔ Decimal Conversion
 In order to convert a number in Octal system to Decimal
expand the number as summation of powers of 8. The
resulting number is the Decimal equivalent of the Number.
 Example: Convert to Decimal.
3758=3 × 82+7× 81+ 5×80 = 25310
207.458 =2 × 82+0 × 81+ 7×80 +4×8-1 +5×8-2 = 135.57812510
 In order to convert a number from decimal to octal (base 8)
we can use the method of successive division.
 Example: Convert 43610 to Octal.
Dividing 436 by 8 : Quotient : 54 Remainder: 4
Dividing 54 by 8: Quotient : 6 Remainder: 6
Dividing 6 by 8 : Quotient : 0 Remainder: 6

Read Remainders FROM BOTTOM : 6648


School of Engineering Technology and Applied Science (SETAS) /
10 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.4 - Binary Numbering System(Base 2)

 Only two possible digits: 0 and 1


 Weighting factor of 2
 Each digit of a binary number is called bit.
1000100011011010
Most Significant Bit Least Significant Bit
(MSB) 16 bits (LSB)

 N bit binary number can represent decimal numbers from


0 to 2N-1. ( total of 2N numbers.)
 Example: How many numbers can be represented by a 16 –
bit binary number: 216 =65,536 ( from 0 to 65535)

 Collection of 8 bits is one Byte.


School of Engineering Technology and Applied Science (SETAS) /
11 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.5 - Binary ↔ Decimal Conversion
 In order to convert a number in
Binary system to Decimal expand the
number as summation of powers of
2. The resulting number is the
Decimal equivalent of the Number.
 Example: Convert to Decimal.
101012=1 × 24+0× 23+ 1×22 +0 × 21+1× 20= 21
 In order to convert a number from decimal to binary (base 2)
successive division can be used.
 Example: Convert 46 to Binary.
46/2=23 + remainder 0 (LSB)
23/2 = 11 + remainder 1
11/2 = 5 + remainder 1
4610 =1011102
5/2 = 2 + remainder 1
2/2 = 1 + remainder 0
1/2 = 0 + remainder 1(MSB)
School of Engineering Technology and Applied Science (SETAS) /
12 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.5 - Binary ↔ Decimal Conversion (2)
 Another method to convert Decimal to Binary is called
Subtracting weighting factors.
 Convert a decimal number to binary by adding up powers of 2 by
inspection, adding bits to fill up the total value of the number.
 Example: Convert 57 to Binary.
(32=25 ) 3210 < 5710 < 6410 (64=26 )
32 is the largest power of 2 that is smaller than 57. Set the 32’s bit to 1 and
subtract 32 from the original number: 57-32=25
The largest power of 2 that is less than 25 is 16. Set the 16’s bit to 1 and
subtract 16 from the total. 25-16=9
Set the 8’s bit to 1 and subtract 8 from the total. 9-8=1
4 is greater than the remaining total. Set the 4’s bit to 0.
2 is greater than the remaining total. Set the 2’s bit to 0.
1 is left over. Set the 1’s bit to 1 and subtract 1. 1 – 1 = 0.
5710 = 1110012
School of Engineering Technology and Applied Science (SETAS) /
13 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.6 - Binary ↔ Octal Conversion

 In order to convert a number in Binary system to Octal, binary


digits of a binary number can be separated into groups of three
(from right to left) and represent each with their octal value:
 Example: Convert 11001101 to Octal.
011 001 101

3 1 5
 In order to convert a number in Octal
system to Binary, each digit of the octal
number will be represented as its 3-bit
binary equivalent of that digit. 7 1 0 3
 Example: Convert 71038 to Binary. 111 001 000 011
011 001 101
School of Engineering Technology and Applied Science (SETAS) /
14 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.7 - Hexadecimal Numbering System (Base 16)

 16 allowable digits.
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, and F
 Each hex digit represents a
4-bit group
 Two hex digits are used to
represent a Byte.
 Sometimes to show a
hexadecimal number letter H
is used in rightmost of the
number. ( 4A5500CH)

School of Engineering Technology and Applied Science (SETAS) /


15 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.8 - Hexadecimal ↔ Decimal Conversion
 In order to convert a number in Hexadecimal system to Decimal
expand the number as summation of powers of 16. The resulting
number is the Decimal equivalent of the Number.
 Example: Convert to Decimal.
B2EH=B × 162+2× 161+ E×160 =11 × 162+2× 161+
14×160 =2862
 In order to convert a number from decimal to hexadecimal
(base 16) successive division can be used.
 Example: Convert 198 to Hexadecimal.
31581/16 = 1973 + remainder 13 (D) (LSD)
1973/16 = 123 + remainder 5
123/16 = 7 + remainder 11 (B)
3158110 = 7B5DH
7/16 = 0 + remainder 7 (MSD)
3158110 = 7B5DH
School of Engineering Technology and Applied Science (SETAS) /
16 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
2.9 - Binary ↔ Hexadecimal Conversion

 In order to convert a number in Binary


system to Hexadecimal, binary digits of a
binary number can be separated into groups
of four (from right to left) and represent
each with their hexadecimal value:
 Example: Convert 11000111101 to
hexadecimal.
6 3 D
In order to convert a number in
Hexadecimal to Binary, each digit of the
hexadecimal number will be represented
as its 4-bit binary equivalent of that digit.
7 E F 8
 Example: Convert 7EF8H to binary:
0111 1110 1111 1000
School of Engineering Technology and Applied Science (SETAS) /
17 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
3.1 - Binary-Coded-Decimal System(BCD)

 Each of the 10 decimal digits is represented by its 4-bit


binary equivalent.
 BCD is not numbering system. It is a Code system.
 It is sometimes called 8421 system.
 Decimal-to-BCD conversion
 Convert each decimal digit to its 4-bit binary code
 BCD-to-Decimal conversion
 Reverse the process

 Example: Convert 9401 to BCD: 9 4 0 1


1001 0100 0000 0001

School of Engineering Technology and Applied Science (SETAS) /


18 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
3.2 - Comparison of Numbering System and BCD

School of Engineering Technology and Applied Science (SETAS) /


19 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
3.3 - Other Binary Codes

Decimal 8421 2421 5211 Excess-3 GRAY


0 0000 0000 0000 0011 0000
1 0001 0001 0001 0100 0001
2 0010 0010 0011 0101 0011
3 0011 0011 0101 0110 0010
4 0100 0100 0111 0111 0110
5 0101 1011 1000 1000 0111
6 0110 1100 1010 1001 0101
7 0111 1101 1100 1010 0100
8 1000 1110 1110 1011 1100
9 1001 1111 1111 1100 1101

School of Engineering Technology and Applied Science (SETAS) /


20 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
3.4 - The ASCII Code

 American Standard Code for Information Interchange (ASCII)


 Represents alphanumeric data
 Uses 7 bits
 An 8-bit version of ASCII code is known as USACC-II 8 or ASCII-8. The
8-bit version can represent a maximum of 256 characters.

 128 different code


combinations:
 3-bit group is most
significant . 4-bit group is
least significant

School of Engineering Technology and Applied Science (SETAS) /


21 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
4 - Numbering System Applications(1)
The four chemical storage tanks shown are monitored for temperature
(T) and pressure (P).
 Using the table shown
below, interpret the
following:
 If the computer reads a
binary string of 0010
1000 what problems
exist?
This indicates that the pressure in
 If the temperature and
tanks C and B are too high.
pressure in tanks B
and D are too high,
what hex value is read This condition would produce a
by the computer? digital output of 1100 1100 = CCH.
School of Engineering Technology and Applied Science (SETAS) /
22 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
4 - Numbering System Applications(2)

 A CD player converts 12-bit signals from a CD into


equivalent analog values.
 What are the largest and smallest hex values that can
be used in this system?
 The largest is FFF16 and the smallest is 00016.
 How many different analog values can be represented?
 FFF16 = 409510, so including 0 the total is 4096 unique
values.

School of Engineering Technology and Applied Science (SETAS) /


23 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
4 - Numbering System Applications(3)

 Typically, digital thermometers use BCD to drive their


displays.
 How many BCD bits are required to drive a 3-digit
display?
12 bits are required; four for each digit.
 What 12 bits represent 147°F?
 0001 (1), 0100 (4), and 0111 (7).

School of Engineering Technology and Applied Science (SETAS) /


24 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
4 - Numbering System Applications(4)

 Most PC-compatible computer systems use a 20-bit address


code to identify each of over 1 million memory locations.
 How many hex characters are required to identify the address of
each memory location?
 Five hex characters are required since each hex character represents 4
bits.

 What is the hex address of the 200th memory location?


 000C8H = 20010, but 00000H is the first memory location,
so we must subtract 1. The answer is C8 – 1 = C7.
 If 50 memory locations are used for data storage starting at
location 000C8H, what is the location of the last data item?
 C8H gets the first data item, so the answer is 24910 = F9H.

School of Engineering Technology and Applied Science (SETAS) /


25 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
4 - Numbering System Applications(5)

 The part number 651-M is stored in ASCII in a computer


memory. List the binary contents of its memory locations?
 6 = 011 0110
5 = 011 0101
1 = 011 0001
- = 010 1101
M = 100 1101
 Grouping the binary bits in eights, this string represents
5 hex memory locations:

011 0110 011 0101 011 0001 010 1101 100 1101
36 35 31 2D 4D
School of Engineering Technology and Applied Science (SETAS) /
26 Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.
5 - Summary

 Numerical quantities occur naturally in analog form but must be converted to


digital form to be used by computers or digital circuitry.
 The binary numbering system is used in digital systems because the 1s and 0s are
easily represented by ON or OFF transistors, which output 0 V for 0 and +5 V
for 1.
 Any number system can be converted to decimal by multiplying each digit
by its weighting factor.
 The weighting factor for the least significant digit in any number system is
always 1.
 Binary numbers can be converted to octal by forming groups of 3 bits
and to hexadecimal by forming groups of 4 bits.
 The successive division procedure can be used to convert from decimal to
binary, octal, or hexadecimal
 The binary-coded-decimal system uses groups of 4 bits to drive decimal
displays such as those in a calculator.
 ASCII is used by computers to represent all letters, numbers and symbols
in digital form.
27 School of Engineering Technology and Applied Science (SETAS) /
Sustainable Design & Renewable Energy (SDRE)
Copyright © 2018, Pearson Education, Inc. All right reserved.

S-ar putea să vă placă și