0% found this document useful (0 votes)
13 views23 pages

CHAP2-BONUS Numbering Systems

The document provides an overview of number systems, including definitions, types (positional and non-positional), and conversion methods between binary, octal, decimal, and hexadecimal systems. It outlines the bases and digits for each system and explains how to convert numbers from one system to another. Additionally, it includes examples of conversions and practical applications of the concepts discussed.

Uploaded by

ngochuyen2k2lx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views23 pages

CHAP2-BONUS Numbering Systems

The document provides an overview of number systems, including definitions, types (positional and non-positional), and conversion methods between binary, octal, decimal, and hexadecimal systems. It outlines the bases and digits for each system and explains how to convert numbers from one system to another. Additionally, it includes examples of conversions and practical applications of the concepts discussed.

Uploaded by

ngochuyen2k2lx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

NTNguyet

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

A number system defines how a number can be


represented using distinct symbols. A number can be
represented differently in different systems. For example,
the two numbers (2A)16 and (52)8 both refer to the same
quantity, (42)10, but their representations are different.
Several number systems have been used in the past
and can be categorized into two groups: positional and non-
positional systems. Our main goal is to discuss the
positional number systems, but we also give examples of
non-positional systems.
Number Systems Menu

01 Definition of number system

THURSDAY

21
HANOI

20 02 Number systems

Presentation Mostly Clear

Have a nice day 03 Convertion


^.^
< >
Definition of number system

file < >

A numeral system (or system of numeration) is a writing system for


expressing numbers; that is, a mathematical notation for representing
numbers of a given set, using digits or other symbols in a consistent manner.

Each number system has a finite number of digits, and the total number of
digits of each number system is called the base.

Number system Base Digits


The binary system 2 0, 1
The octal system 8 0, 1, 2, 3, 4, 5, 6, 7
The decimal system 10 0, 1, 2, 3, 4, 5, 6,7, 8, 9
The hexadecimal system 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
< > Number systems

The decimal system


file < >

The decimal or base 10 numbering system consists of 10 digits


according to the following notation: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Suppose a number A is represented as:
A = anan-1… a1a0 . a-1a-2 … a-m
Þ Then the value of A is:

For example: Number 254,68 has the following calculated value:


254,68 = 2 x 102 + 5 x 101 + 4 x 100+ 6 x 10-1+ 8 x 10-2
< > Number systems

The binary system


file < >

-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

The octal system


file < >

Use digits: 0.1,2,3,4,5,6,7


Suppose a number A is represented in octal as follows:
A = anan-1… a1a0 . a-1a-2 … a-m
Where ai are the digits in the octal system
Then the value of A is:
A = an8n + an-18n-1 + …+ a181 + a080 + a-18-1 + a-28-2 +…+ a-m8-m
For example: Number 235,64(8) has the following calculated value:
235,64(8) = 2 x 82 + 3 x 81 + 5 x 80 + 6 x 8-1 + 4 x 8-2
= 157,8125(10)
< > Number systems
The hexadecimal system
file < >

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

The hexadecimal system


file < >

Suppose a number A is represented in hexadecimal as follows:


A = anan-1… a1a0 . a-1a-2 … a-m
Where ai are the digits in the hexadecimal system
Then the value of A is:

For example: Number 34F5C.1(16) has the following calculated value:


34F5C.1(16)= 3 x 164+ 4 x 163 + 15 x 162 + 5 x 161
+ 12 x 160 + 1 x 16-1
= 216924.0625(10)
< > Convertion
< >

Convertion

- In general, a number N in the decimal system (N(10)) consists of


an integer part and a decimal part.
- Converting a number from the decimal system to a number in
any base b system consists of 2 steps:
+ Convert the integer part (of that number) from decimal
to base b
+ Convert the decimal part (of that number) from decimal
to base b
< >

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)

So: 12.6875 (10) = 1100.1011(2)


< >
Convertion
file < >

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

Mở rộng phạm vi ứng dụng của đề tài không


chỉ trong môn học Tin học đại cương mà còn áp
dung đối với các môn học khác.
Thanks For Watching!

You might also like