Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

CHAPTER 2

NUMBER SYSTEM

Is a basic symbol to represent a set


of quantities.
There are a lot of number system
but here we only focus on decimal,
hexadecimal, and binary

2.1NUMBER SYSTEM BASE


Decimal number

Base of 10
The value assigned weight is composed by 10 digit starting

Binary number

Base of 2
Number consist only two digit 0 and 1 only
The least significant bit (LSB) and most significant bits
(MSB) is depend on the size of binary number in FIGURE 2.

Hexadecimal number

Base of 16
The composed number start from 0 until F

#EXAMPLE OF NUMBER SYSTEM

FIGURE 2

FIGURE 1

2.2 NUMBER SYSTEM


CONVERSION

In this section we will learn converting method


number system by using repeated division base
2, 10 and 16

EXAMPLE 1 (BINARY TO DECIMAL)


1
Given 10011011 base 2
Convert to decimal

2^7 2^6 2^5 2^4 2^3 2^2 2^1


2^0
128, 64, 32,
1

16,

8,

128 64 32 16 8
128 + 0 + 0 + 16 + 8 + 0 + 2 +
1

155 base 10
Lastly add all of the number

0 1

1
128

0
0

0
0

4,

2,

4 2 1

1 1 0 1 1
16 8 0 2 1

Multiply with 10011011

EXAMPLE 2 (BINARY TO HEXADECIMAL)


Given 10011011 base 2
Convert to hexadecimal

Split it into four digit


10011011
1001

10011011 = 9B

1011

1001
1011

EXAMPLE 3 (DECIMAL TO BINARY)


It must be divide by 2

Given 51 base 10
Convert to binary

The answer is
51 base 10 = 110011
base 2

51

25

12

1
Your answer must be upward

EXAMPLE 4 (DECIMAL TO HEXADECIMAL)

Given 4156 base 10


Convert to hexadecimal

Division

Quotie
nt

Remaind
er

4156/16

259

12 = c

259/16

16

16/16

1/16

The answer is 4156 = 103C

Division

Quotie
nt

Remaind
er

4156/16

259

12

259/16

16

16/16

1/16

When 4156 is divided by 16


and the answer 259 will be
divided back by 16 and the
remainder of first divided
must be recorded because its
actual answer

EXAMPLE 5 (HEXADECIMAL TO BINARY)

Given 4FD7 base 16


Convert to binary

0100 1111 1101 0111


This can be solve using
FIGURE 1 table
The answer is
4FD7 = 100 1111 1101
0111

EXAMPLE 6 (HEXADECIMAL TO DECIMAL)


4
Given 4FD7 base 16
Convert to decimal

16^3 16^2 16^1


16^0

(4 X 16^3)+(15 X 16^2)+(13 X 16^1)+(7 X


16^0)

16384
+
3840
+
208
+
7
And the answer is 4FD7 = 20439 base 10

16^3 16^2 16^1 16^


X
X
X
X
4 (F=15) (D=13) 7
Multiply all the 4FD7

2.3 COMPLEMENT NUMBER

In microprocessor-based 2s compliment method


represent number commonly used, until now we
assume that the number are positive.

But microprocessor must process both positive and


negative number, the 2s compliment represent used
for sign and magnitude number can be determined

And when there is negative number we have to use


2s compliment to change it into positive number.

EXAMPLE 7 (NEGATIVE NUMBER CONVERSION)


Given -125
Let convert it to 125

Step 1st compliment


-125 = 1111101
= 0000010
Each 0 is changed to a1 and each 1
to a0

The answer is
125 = 0000011

Step 2nd compliment


= 0000010
= 0000011
Add +1 to the 1st
complement

THE END

Created by = MUHAMMAD HANIS BIN HALIM (D031610172)

You might also like