Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Module 7 - Number System

Uploaded by

jaysonumayan595
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Module 7 - Number System

Uploaded by

jaysonumayan595
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

IT 111: Introduction to Computing

Module 7:

Number System

Leading Innovations, Transforming Lives, Building Nation


2
Intended Learning Outcomes

ILO 2: Expound on the recent developments in


the different computing knowledge areas
3

NUMBER SYSTEM

IT 111: Introduction to Computing


4
INTRODUCTION TO NUMBER SYSTEM

• 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.
5
The decimal system (base 10)

S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

The symbols in this system are often referred to as


decimal digits or just digits.
6
The binary system (base 2)

The word binary is derived from the Latin root bini (or
two by two). In this system the base b = 2 and we use
only two symbols,

S = {0, 1,}

The symbols in this system are often referred to as


binary digits or just bits.
7
The hexadecimal system (base 16)

The word hexadecimal is derived from the Greek root


hex (six) and the Latin root decem (ten). In this system
the base b = 16 and we use sixteen symbols to
represent a number. The set of symbols is
S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}
Note that the symbols A, B, C, D, E, F are equivalent to
10, 11, 12, 13, 14, and 15 respectively. The symbols in this
system are often referred to as hexadecimal digits.
8
The octal system (base 8)

The word octal is derived from the Latin root octo


(eight). In this system the base b = 8 and we use eight
symbols to represent a number. The set of symbols is

S = {0, 1, 2, 3, 4, 5, 6, 7}
9
Summary of the four positional systems
10
Common Number Systems

Used by Used in
System Base Symbols humans? computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
11
Comparison of numbers in the four systems

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1

Lets place the above calculations into a chart that will make it easy to
convert a binary number to a decimal number.
12
Decimal Binary Octal Hexa- decimal
0 0000 0 0
1 0001 1 1

2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7

Comparison of numbers in the four systems


13
Decimal Binary Octal Hexa-Decimal
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

Comparison of numbers in the four systems


14
Decimal Binary Octal Hexa-Decimal
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17

Comparison of numbers in the four systems


15
Conversion Among Bases

• The possibilities:
Decimal Octal

Binary Hexadecimal
16

CONVERSION
METHODS

IT 111: Introduction to Computing


17

Decimal to Decimal (just for fun)

Decimal Octal

Binary Hexadecimal
18

Weight

12510 => 5 x 100 (1) = 5


2 x 101 (10) = 20
1 x 102 (100) = 100
125

Base
19

DECIMAL – BINARY
1. Divide by two, keep Example #1.
track of the remainder
2 125
2. First remainder is bit 0 2 62 1
(LSB, least-significant bit)
2 31 0
3. Second remainder is 2 15 1
bit 1 2 7 1
4. Etc. 2 3 1
. 2 1 1 12510 = 11111012
0 1
20
2nd Method
Example #2.

12510 = 11111012

1 1 1 1 1 0 1
64 32 16 8 4 2 1

96 112 120 1252


21

Example #3:

24310 = _____ 2

1 1 1 1 0 0 1 1
512 256 128 64 32 16 8 4 2 1

24310 = 111100112
22

DECIMAL – OCTAL

1. Divide by 8 Example #1.


2. Keep track of the 8 1234
remainder. 8 154 2
8 19 2
8 2 3
0 2

123410 = 23228
23

DECIMAL – HEXADECIMAL

Example #1.
1. Divide by 16
16 1234
2. Keep track of
16 77 2
the remainder 16 4 13 = D
0 4

123410 = 4D216
24

BINARY- DECIMAL

1. Multiply each bit by 2n,


Example #1.
where n is the “weight” of 1010112 => 1 x 20 = 1
the bit 1 x 21 = 2
2. The weight is the position Bit “0” 0 x 22 = 0
of the bit, starting from 0 1 x 23 = 8
on the right 0 x 24 = 0
1 x 25 = 32
3. Add the results
. 4310
25
2nd Method
Example #2.

1010112 = 4310

1 0 1 0 1 1
64 32 16 8 4 2 1

40 + 3

43
26

Example #3:

111112 = _____ 10

1 1 1 1 1
512 256 128 64 32 16 8 4 2 1

111112 = 3110
27

BINARY- OCTAL

Example #1.
1. Group bits in threes,
10110101112 = ?8
starting on right
2. Convert to octal digits 1 011 010 111
.

1 3 2 7

10110101112 = 13278
28

BINARY- HEXADECIMAL

Example #1.
1. Group bits in fours,
10101110112 = ?16
starting on right
2. Convert to hexadecimal 10 1011 1011
digits
.

2 B B

10101110112 = 2BB16
29

OCTAL – DECIMAL

1. Multiply each bit by 8n,


Example #1.
where n is the “weight” of
the bit 7248 => 4 x 80 = 4
(1)
2. The weight is the position 2 x 81 = 16
(8)
of the bit, starting from 0
7 x 82 (64) =448
on the right
46810
3. Add the results
.
30

OCTAL – BINARY

1. Convert each octal digit


Example #1.
to a 3-bit equivalent 7058 = ?2
binary representation.
7 0 5

111 000 101

7058 = 1110001012
31

OCTAL – HEXADECIMAL

Example #1.
1. Use binary
10768 = ?16
as an
1 0 7 6
intermediary

001 000 111 110


2 3 E
10768 = 23E16
32

HEXADEMICAL – DECIMAL

1. Multiply each bit by 16n, where n is the “weight” of the bit


2. The weight is the position of the bit, starting from 0 on the right
3. Add the results

Example #1.
ABC16 => C x 160 = 12 x 1 = 12
B x 161 = 11 x 16 = 176
A x 162 = 10 x 256 = 2560
274810
33
2nd Method
Example #2.
A B C
ABC= 274810

1010 1011 1100


1 0 1 0 1 0 1 1 1 1 0 0

2048 1024 512 256 128 64 32 16 8 4 2 1

1. Convert into Binary


2. Using base 2 table, add the 1 values to get the result
34

HEXADECIMAL – BINARY

Example #1.
1. Convert each
10AF16 = ?2
hexadecimal
digit to a 4-bit 1 0 A F
equivalent
binary
representation 0001 0000 1010 1111

10AF16 = 00010000101011112
35

HEXADECIMAL – OCTAL

1. Use binary as an intermediary

Example #1. 1 F 0 C
1F0C16 = ?8
0001 1111 0000 1100

1 7 4 1 4
1F0C16 = 174148
Exercise – Conversion
Hexa-
Decimal Binary Octal decimal
33
1110101
703
1AF

Don’t use a calculator!

Skip answer Answer


ANSWER
Hexa-
Decimal Binary Octal decimal
33 100001 41 21
117 1110101 165 75
451 111000011 703 1C3
431 110101111 657 1AF
38
Common Powers (1 of 2)

Power Preface Symbol Value


▸ Base 10 10-12 pico p .000000000001
10-9 nano n .000000001
10-6 micro  .000001
10-3 milli m .001
103 kilo k 1000
106 mega M 1000000
109 giga G 1000000000
1012 tera T 1000000000000
39
Common Powers (2 of 2)

Power Preface Symbol Value


▸ Base 2
210 kilo k 1024

220 mega M 1048576

230 Giga G 1073741824

• What is the value of “k”, “M”, and “G”?


• In computing, particularly w.r.t. memory, the
base-2 interpretation generally applies
40
In the lab…
1. Double click on My
Computer
2. Right click on C:
3. Click on Properties

/ 230
=
EXAMPLE
41 IT 111: Introduction to Computing

Thank you!

You might also like