21
1. Number Systems TICO

Number setetertystems i_

Embed Size (px)

Citation preview

Page 1: Number setetertystems i_

1. Number Systems

TICO

Page 2: Number setetertystems i_

Common Number Systems

System Base

SymbolsUsed by humans?

Used in computers?

Decimal 10 0, 1, … 9 Yes No

Binary 2 0, 1 No Yes

Octal 8 0, 1, … 7 No No

Hexa-decimal

16 0, 1, … 9,A, B, … F

No No

Page 3: Number setetertystems i_

Conversion Among Bases

• The possibilities:

Hexadecimal

Decimal Octal

Binary

pp. 40-46

Page 4: Number setetertystems i_

Quick Example

2510 = 110012 = 318 = 1916

Base

Page 5: Number setetertystems i_

Decimal to Decimal (just for fun)

Hexadecimal

Decimal Octal

Binary

Next slide…

Page 6: Number setetertystems i_

12510 => 5 x 100 = 52 x 101 = 201 x 102 = 100

125

Base

Weight

Page 7: Number setetertystems i_

Binary to Decimal

Hexadecimal

Decimal Octal

Binary

Page 8: Number setetertystems i_

Binary to Decimal

• Technique– Multiply each bit by 2n, where n is the “weight”

of the bit– The weight is the position of the bit, starting

from 0 on the right– Add the results

Page 9: Number setetertystems i_

Example

1010112 => 1 x 20 = 11 x 21 = 20 x 22 = 01 x 23 = 80 x 24 = 01 x 25 = 32

4310

Bit “0”

Page 10: Number setetertystems i_

Decimal to Binary

Hexadecimal

Decimal Octal

Binary

Page 11: Number setetertystems i_

Decimal to Binary

• Technique– Divide by two, keep track of the remainder– First remainder is bit 0 (LSB, least-significant

bit)– Second remainder is bit 1– Etc.

Page 12: Number setetertystems i_

Example12510 = ?2

2 125 62 12 31 02 15 12 7 12 3 12 1 12 0 1

12510 = 11111012

Page 13: Number setetertystems i_

Decimal to Octal

Hexadecimal

Decimal Octal

Binary

Page 14: Number setetertystems i_

Decimal to Octal

• Technique– Divide by 8– Keep track of the remainder

Page 15: Number setetertystems i_

Example123410 = ?8

8 1234 154 28 19 28 2 38 0 2

123410 = 23228

Page 16: Number setetertystems i_

Octal to Decimal

Hexadecimal

Decimal Octal

Binary

Page 17: Number setetertystems i_

Octal to Decimal

• Technique– Multiply each bit by 8n, where n is the “weight”

of the bit– The weight is the position of the bit, starting

from 0 on the right– Add the results

Page 18: Number setetertystems i_

Example

7248 => 4 x 80 = 42 x 81 = 167 x 82 = 448

46810

Page 19: Number setetertystems i_

Hexadecimal to Decimal

Hexadecimal

Decimal Octal

Binary

Page 20: Number setetertystems i_

Hexadecimal to Decimal

• Technique– Multiply each bit by 16n, where n is the

“weight” of the bit– The weight is the position of the bit, starting

from 0 on the right– Add the results

Page 21: Number setetertystems i_

Example

ABC16 => C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560

274810