Upload
see-kay-why
View
116
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
Apr 10, 2023
Lecturer Name [email protected]
Contact Number
IT2001PAEngineering Essentials (2/2)
Chapter 1 – Number System
2
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Lesson Objectives
Upon completion of this topic, you should be able to: Convert numbers e.g. binary, octal, decimal,
hexadecimal and BCD from one system to another.
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Specific Objectives
Students should be able to : Explain why the binary number system is ideal for digital
logic applications. Convert decimal whole numbers and fractional numbers
into binary numbers and vice versa. Convert decimal whole numbers into hexadecimal and
octal numbers and vice versa. Explain the term binary coded decimal. Convert BCD to decimal number and vice versa.
4
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Application
In digital electronics,
only deal with two voltage levels; i.e.:
ON high or 1.
OFF low or 0.
Therefore almost all digital systems use
binary number system; i.e.: Base 2.
5
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Number Systems
4 commonly used number systems:MSB LSB
• Decimal (Base 10) 2 5MSB LSB
• Binary (Base 2) 1 1 0 0 1MSB LSB
• Octal (Base 8) 3 1MSB LSB
• Hexadecimal (Base 16) 1 9
6
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Binary Number SystemBinary number are strings of two (hence ‘bi’), symbols 0’s and 1’s, that represent numbers. They may be expanded in the usual way with a base of 2.
E.g. 11012
20
21
22
23
1048 +
1310
7
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Binary System
Each digit in the binary number system is called a bit
A group of four bits binary number is known as Nibble.
A group of eight bits binary number is known as Byte.
Two bytes number form a word.
8
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Binary to Decimal Conversion
Convert 111012 to decimal number
Whole number
111012
= (1)*24 + (1)*23 + (1)*22 + (0)*21 + (1)*20
= 1*16 + 1*8 + 1*4 + 0*2 + 1*1= 16 + 8 + 4 + 0 +1 = 2910
9
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Try the following
Convert 101102 to decimal number
101102
= (1)*24 + (0)*23 + (1)*22 + (1)*21 + (0)*20
= 1*16 + 0*8 + 1*4 + 1*2 + 0*1= 16 + 0 + 4 + 2 + 0 = 2210
Solution
10
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Binary to Decimal Conversion
Convert 101.1012 to decimal number
Fraction number
101.1012
= (1)*22 + (0)*21 + (1)*20 + (1)*2-1 + (0)*2-2 + (1)*2-3
= 1*4 + 0*2 + 1*2 + 1*0.5 + 0*0.25 +1*0.125= 4 + 0 + 1 + 0.5 + 0 + 0.125 = 5.62510
11
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Try the following
Convert 110.112 to decimal number
110.112
= (1)*22 + (1)*21 + (0)*20 + (1)*2-1 + (1)*2-2
= 4 + 2 + 0 + 0.5 + 0.25 = 6.7510
Solution
12
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Decimal to Binary Conversion
Convert 2510 to binary number by repeated division
Whole number
2 510
= 1 1 0 01212
2623212
02
Remainder
1001
1
LSB
MSB
212
25
13
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Try the following
Convert 3010 to binary number
15
2723212
02
Remainder
0111
1
2 30
Ans
= 111102
Solution
14
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Decimal to Binary Conversion
Convert 0.37510 to binary number by repeated multiplication
Fraction number
0.37510
= 0.0112
0.375 x 2 = 0.75
Carry
0
1
0.375 x 2 = 0.75
0.75 x 2 = 0.5
10.5 x 2 = 0
15
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Try the following
Convert 13.12510 to binary number
6
2321202
Remainder
1011
2 13
Ans
= 1101.0012
0.125 x 2 = 0.25
Carry
0
00.25 x 2 = 0.5
10.5 x 2 = 0
Whole number Fraction number
Solution
16
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Decimal to Octal conversion
Convert 48610 to Octal.
8 | 486 Remainder
8 | 60 6 LSB
8 | 7 4
8 | 0 7 MSB
48610 = 7468
Convert 0.61132510 to Octal.
Carry
0.611325 x 8 = 3.88 3 MSB
0.8906 x 8 = 7.125 6
0.125 x 8 = 1.00 1 LSB
0.61132510 = 0.3618
17
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Octal to Decimal conversion
Convert 3268 to Decimal
2 1 0
3 2 68 = (3 x 8 ) + (2 x 8 ) + (6 x 8 )
= 192 + 16 + 6
= 21410
3 2 68 = 21410
2 1 0
weight
18
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Decimal to Hexadecimal Conversion
Convert 49810 to Hexadecimal.
16 | 498 Remainder
16 | 31 2 LSB
16 | 1 F
16 | 0 1 MSB
49810 = 1F216
Convert 0.781493710 to Hexadecimal.
Carry
0.7814937 x 16 = 12.5039 C MSB
0.5039 x 16 = 8.0624 8
0.0624 x 16 = 1.00 1 LSB
0.781493710 = 0.C8116
19
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Hexadecimal to Decimal conversion
Convert 2A616 to Decimal
2 1 0
2 A 616 = (2 x 16 ) + (A x 16 ) + (6 x 16 )
= 512 + 160 + 6
= 67810
2 A 616 = 67810
2 1 0
weight
20
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Binary-Coded-Decimal System (BCD)
Used to represent each of the 10 decimal digits as a 4-bit binary code. Decimal BCD
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 0 0 0 1 0 0 0 0
21
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Convert decimal number to BCD
3 5 7 910
0011 0101 0111 1001 (BCD)
Convert BCD to decimal number
0110 1000 0111 0011 (BCD)
6 8 7 310
22
Chapter 1 – Number System
IT2001PA Engineering Essentials (2/2)
Next Lesson