COS1521-foundations_of_computer_science_-chapter_2
COS1521-foundations_of_computer_science_-chapter_2
Second Edition
BEHROUZ FOROUZAN
FIROUZ MOSHARRAF
Chapter 2
Number Systems
1
Outlines
z Introduction
z Positional Number Systems
– Base 10, 2, 8, 16.
z Nonpositional Number Systems
– Roman Numerals
2 CSIM@PU
Objectives
4
The Definition of Number System
5 CSIM@PU
1-2 Position Number Systems
6
Overview
8
Base 10 – Integers (1)
9
Base 10 – Integers (2)
( ) Values
10
Base 10 – Reals
11
The binary system (base 2)
12
Base 2 – Integers (1)
14
Base 2 – Reals (1)
16
Base 16 – Integers (1)
18
The octal system (base 8)
19
Base 8 – Integers (1)
20
Base 8 – Integers (2)
21
Summary of the Base 10/2/8/16
positional systems (1)
22
Summary (2)
The number 0 to
15 is represented
in different
systems
23
Conversion
24
Any base to decimal conversion (1)
25
Any base to decimal conversion (2)
26
Any base to decimal conversion (3)
28
Decimal to any base conversion
29
Converting the integral part (1)
30
Converting the integral part (2)
Figure 2.7
31 Converting the integral part of a number in decimal to other bases
Converting the integral part (3)
32
Converting the integral part (4)
33
Converting the fractional part (1)
UML’s
State
diagram
34
Converting the fractional part (2)
Figure 2.9
35 Converting the fractional part of a number in decimal to other bases
Converting the fractional part (3)
36
Converting the fractional part (4)
37
Converting the fractional part (5)
For Example:
38
Converting the fractional part (6)
39
Binary-hexadecimal conversion (1)
Figure 2.10
Binary to hexadecimal and hexadecimal to binary conversion
40
Binary-hexadecimal conversion (2)
42
Binary-octal conversion (1)
Figure 2.12
Octal to hexadecimal and hexadecimal to octal conversion
45
Octal-hexadecimal conversion (2)
47
Overview (1)
48
Overview (2)
51