0% found this document useful (0 votes)
30 views

Module 2a Number Systems

This document discusses number systems conversion between decimal, binary, octal and hexadecimal. It provides examples of expressing decimal numbers as sums of place values in different bases. It also covers successive division and multiplication methods for conversion between number systems.

Uploaded by

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

Module 2a Number Systems

This document discusses number systems conversion between decimal, binary, octal and hexadecimal. It provides examples of expressing decimal numbers as sums of place values in different bases. It also covers successive division and multiplication methods for conversion between number systems.

Uploaded by

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

1

FACULTY OF COMPUTING
2
Numbering system

3
4
N = (c3c2 c1c0 ·c-1c-2 c-3 )B
= (c3 xB3 ) + (c2 xB 2 ) + (c1 xB1 ) + (c0 xB 0 )·(c-1 xB-1 ) + (c-2 xB-2 ) + (c-3 xB-3 )

5
Example:

N = 4839.7210  (43823190 . 7-12-2)10

 (4 x 103) + (8 x 102) + (3 x 101) +


(9 x 100) + (7 x 10-1) + (2 x 10-2)

 (4 x 1000) + (8 x 100) + (3 x 10) +


(9 x 1) + (7 x 0.1) + (2 x 0.01)

 (4000) + (800) + (30) + (9) + (0.7) +


(0.02)
 4839.72
6
7
Example:

Most significant bit (MSB) Least significant bit (LSB)

N = 4 8 3 9 . 7 2 10
10
Base number

Integer part Fraction part

8
Decimal number

9
Decimal number

10
Exercise 2a.1:
Express 567.2310 as a sum of values of each digit.

Solution:
= (5 x 102) + (6 x 101) + (7 x 100) + (2 x 10-1) + (3 x 10-2)
= (5 x 100) + (6 x 10) + (7 x 1) + (2 x 0.1) + (3 x 0.01)
= 500 + 60 + 7 + 0.2 + 0.03

11
Binary number

Example:

12
Exercise 2a.2:
Express 110100.0112 as a sum of values of each digit.

Solution:
= (1 x 25) + (1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) +
(0 x 20) + (0 x 2-1) + (1 x 2-2) + (1 x 2-3)

= (1 x 32) + (1 x 16) + (0 x 8) + (1 x 4) + (0 x 2) +
(0 x 1) + (0 x 0.5) + (1 x 0.25) + (1 x 0.125)

= (32) + (16) + (4) + (0.25) + ( 0.125)

13
Octal number

Example:

Is there any errors ?

14
Octal number

0.015625

Example:

+ (6 x 1) + (1 x 0.015625)

(Correction in module)

15
(No digit 8 in octal number system)
Exercise 2a.3:
Express 568.238 as a sum of values of each digit.

Is there any errors ?

16
Exercise 2a.3:
Express 567.238 as a sum of values of each digit.

0.015625

Solution:
= (5 x 82) + (6 x 81) + (7 x 80) + (2 x 8-1) + (3 x 8-2)
= (5 x 64) + (6 x 8) + (7 x 1) + (2 x 0.125) + (3 x 0.015625)
= 320+ 48 + 7 + 0.25 + 0.046875

17
Hexadecimal number

Representation of decimal
value into hexadecimal value

18
Example:

19
Exercise 2a.4:
Express 567.2316 as a sum of values of each digit.

Solution:
= (5 x 162) + (6 x 161) + (7 x 160) + (2 x 16-1) + (3 x 16-2)
= (5 x 256) + (6 x 16) + (7 x 1) + (2 x 0.0625) + (3 x 0.00390625)
= 1280 + 96 + 7 + 0.125 + 0.1171875

20
Exercise 2a.4b:
Express 5A7.2F16 as a sum of values of each digit.

Solution:
= (5 x 162) + (A x 161) + (7 x 160) + (2 x 16-1) + (F x 16-2)
= (5 x 256) + (10 x 16) + (7 x 1) + (2 x 0.0625) + (15 x 0.00390625)
= 1280 + 160 + 7 + 0.125 + 0.05859375

21
Note:
• All examples in previous slide are converting into
decimal number without the total.
• Calculate the value in decimal to those example.

290.86410

22
Calculate the value in decimal to all previous exercise.

Exercise 2a.2:
110100.0112 = (32) + (16) + (4) + (0.25) + ( 0.125)
= 52.37510
Exercise 2a.3:
567.238 = (320) + (48) + (7) + (0.25) + (0.046875)
= 375.29687510
Exercise 2a.4:
567.2316 = (1280) + (96) + (7) + (0.125) + (0.1171875)
= 1383.2421910
Exercise 2a.4b:
5A7.2F16 = (1280) + (160) + (7) + (0.125) + (0.05859375)
= 1447.1835910
23
Exercise 2a.5:

10 21 1
100 22 11 1010
111 10001
10000 24 1111 11010
100000 25 100011

24
Solution:

(c)

(a)

(b)

25
successive division

26
Successive Division:
122
Remainder

8 82
8 10 2
1 2

Answer

27
Successive Division:
Remainder
101010
2 42
2 21 0
2 10 1
2 5 0

2 2 1

1 0
Answer
28
29
7FF

Remainder
16 2047
16 127 15  F
7 15  F

Answer
30
Successive Division:
Exercise 2a.6:
Remainder
5 A 7 16
144710 = ________ 16 1447
16 90 7
5 10  A

Answer

(inverted from exercise 4b)

31
32
.0101
Answer:
MSB
0 625 0

0.625 1 25 1

0.25 0 5 0

0.5 1 1
LSB

33
.CC49
Answer:
MSB
12 768 12

0.768 12 288 12

0.288 4 608 4

0.608 9 9
LSB

34
- Successive division
- Successive multiplication

35
Exercise 2a.7:

5A7.2EF
1447.1835910 = ___________ 16

1447 + 0.18359
Successive Division: Successive Multiplication:
(Whole part) (Fraction part)

Remainder
16 1447 0.18359 x 16 = 2.93744  2
16 90 7 0.93744 x 16 = 14.99904  E
0.99904 x 16 = 15.98464  F
5 10  A
(up to 3 fractional points)

(inverted from exercise 4b)

36
37
Binary2  Octal8

2316
8 2n = 8
n=3
3

 LSB
11 00 0 1 1 0 00 11 1 1 0

2 3 1 6

38
Binary2  Hexadecimal16

4CE
2n = 16
n=4
4

 LSB
0 11 00 00 11 11 00 00 11 11 11 00

4 12 14
C E

39
40
whole fraction

41
Whole fraction (Binary2  Octal8)

Recall:
2n = 8
n=3
215.644
8
3

010 001 101

2 1 5
3

110 100 100

6 4 4
Whole fraction (Binary2  Hexadecimal16)

Recall:
2n = 16
n=4
8D .D2

43
44
1 2 4 . A B 7
(Whole part) (Fraction part)

623.538 =

45
Exercise 2a.8:

101011110010000.01111011
AF90.7B16 = _________________________ 2

Solution:
(Convert each digit into group of 4 bits)

A F 9 0 . 7 B
1010 1111 1001 0000 0111 1011

46
Summary of Number Systems Conversion

Successive Multiplication

Octal8
Fraction

Group

Convert
2n = 8 22 21 20
n=3 4 2 1

Decimal10 Binary2
.

Positional number system

Convert
2n = 16

Group
23 22 21 20
Whole

n=4 8 4 2 1

Hex16
Successive Division

47
Summary of Number Systems Conversion

Successive Multiplication

Octal8
Fraction

78  111
111  78
Group

Convert
2n = 8
n=3

Decimal10 Binary2
.

Positional number system

0111  716

716 0111
Convert
2n = 16

Group
Whole

n=4

Hex16
Successive Division
…23 22 21 20
…8 4 2 1

48
49

You might also like