CHAP2-BONUS Numbering Systems
CHAP2-BONUS Numbering Systems
CHAPTER 2
Number Systems
LECTURERS: NGUYỄN THỊ NGUYỆT
PHONE: 0913566692
EMAIL: [email protected]
Number Systems Objectives
01 Understand the
concept of number
04
systems Convert a number in
binary, octal, or
hexadecimal to a
02
Distinguish between number in the decimal
THURSDAY HANOI
non-positional and system
21 20 positional number
05
systems Convert a number in the
Presentation Mostly Clear
decimal system to a
number in binary, octal,
03
Describe the decimal,
and hexadecimal
Have a nice day binary, hexadecimal,
and octal system
^.^
< > INTRODUCTION
THURSDAY
21
HANOI
20 02 Number systems
Each number system has a finite number of digits, and the total number of
digits of each number system is called the base.
-Suppose
Use 2 adigits:
number A is1represented in binary as follows:
0 and
- Binary Adigit
= anis
an-1 … a1abit
called 0 . a-1a-2 … a-m
For ai + Example:
are bit 0,(0bit
binary digits or11), then the value of A is:
- Bit is the smallest unit of information
For example, the binary number 1101,1001 has the following value:
1101,1001(2) = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 0 x 2-2
+ 0 x 2-3 + 1 x 2-4
= 8 + 4 + 1 + 0.5 + 0.0625 = 13,5625(10)
< > Number systems
Use 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
The decimal The binary The octal The hexadecimal
The conversion table system system system system
0 0 0 0
is equivalent to the 1 01 1 1
2 10 2 2
first 16 digits of the 3 11 3 3
4 numbering systems 4
5
100
101
4
5
4
5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
< > Number systems
Convertion
Convertion
1. Convert the integer part
- Step 1: Take the integer part of N(10) divided by b, we get the quotient T1
remainder d1.
- Step 2: If T1 is non-zero, divide T1 by b, we get T2 quotient, remainder is
d2.
(Do this until the nth step, when we get Tn=0)
- Step n: If Tn-1 is not 0, divide Tn-1 by b, we get quotient of Tn=0, remainder
is dn.
=> As a result, we get the number N(b) which is the number generated
by the remainders (written in reverse order) in the above steps.
=> The integer part of N = d d …d
< >
Convertion
2. Convert decimal part
- Step1: Take the decimal part of N(10) multiplied by b, we get a
number of the form x1,y1 (x is the integer part, y is the decimal part).
- Step 2: If y1 is not 0, continue to take 0,y1 multiplied by b, we get a
number of the form x2,y2.
Keep doing this until yn=0.
- Step n: If yn-1 is not 0, multiply 0,yn-1 by b, we get xn,0.
Þ As a result, we get the number N(b) which is the number generated
by the integer part of the numbers generated in the above steps.
Þ The decimal part of N(b) = 0.x1x2...xn(b)
< >
Convertion
3. Example
a. Convert from decimal to binary 12.6875 (10) = ?(2)
3. Example
b. Convert 11 1011 1110 0110(2) from the binary system to the
hexadecimal system.
-> 11 1011 1110 0110(2) = ? (16)
c. Convert AB7(16) from the hexadecimal system to the binary
system.
-> AB7(16)= ? (2)
d. Convert 612.02(8) from the octal system to the binary system.
e. Convert 1011 0010 1001 1101(2) from the binary system to the
octal system.
< >
Convertion
file < >
3. Example
b. Convert 11 1011 1110 0110(2) from the binary system to the
hexadecimal system.
-> 11 1011 1110 0110(2) = 3BE6(16)
c. Convert AB7(16) from the hexadecimal system to the binary
system.
-> AB7(16)= 1010 1011 0111(2)
d. Convert 612.02(8) from the octal system to the binary system.
e. Convert 1011 0010 1001 1101(2) from the binary system to the
octal system.
Number Systems
THURSDAY HANOI
21 20
Presentation Mostly Clear
Practice ^.^
Number Systems
THURSDAY HANOI
21 20
Presentation Mostly Clear
Practice ^.^
Number Systems Practice ^.^
01 Xây dựng và hoàn thiện các chức năng, ví dụ
chức năng thêm danh sách sinh viên từ file excel,
thêm ngân hàng câu hỏi bang file excel, xuất danh
THURSDAY HANOI
sách điểm thi ra file PDF và sớm đưa dự án vào
21 20 hoạt động, đáp ứng nhu cầu cấp thiết của khoa
CNTT
02
Presentation Mostly Clear