04_numberSystem
04_numberSystem
Engineers
Number System
ICEN 200 – Spring 2018
Prof. Dola Saha
1
Types of Numbers
Ø Natural Numbers
§ The number 0 and any number obtained by repeatedly adding a count
of 1 to 0
Ø Negative Numbers
§ A value less than 0
Ø Integer
§ A natural number, the negative of a natural number, and 0.
§ So an integer number system is a system for ‘counting’ things in a
simple systematic way
2
Exponent Review
Ø An exponent (power) tells you how many times to multiply the base by
itself:
§ 21 = 2
§ 22 = 2 x 2 =4
§ 23 = 2 x 2 x 2 = 8
3
Decimal Number System
Ø How is a positive integer represented in decimal?
Ø Let’s analyze the decimal number 375:
375 = (3 x 100) + (7 x 10) + (5 x 1)
= (3 x 102) + (7 x 101) + (5 x 100)
4
Bits
Ø In a computer, information is stored using digital signals that translate
to binary numbers
§ A single bit can represent two possible states, on (1) or off (0)
5
Data Representation
Ø Data representation means encoding data into bits
§ Typically, multiple bits are used to represent the ‘code’ of each value
being represented
6
Decimal to Binary
Ø So in a computer, the only possible digits we can use to encode data are
{0,1}
§ The numbering system that uses this set of digits is the base 2 system
(also called the Binary Numbering System)
Ø We can apply all the principles of the base 10 system to the base 2
system
Position weights 24 23 22 21 20
digits 1 0 1 1
7
Binary Numbering System
Ø How is a positive integer represented in binary?
Ø Let’s analyze the binary number 110:
110 = (1 x 22) + (1 x 21) + (0 x 20)
= (1 x 4) + (1 x 2) + (0 x 1)
Position weights 22 21 20
Number digits 1 1 0
0 x20 = 0 +
1 x21 = 2 +
1 x 22 = 4
6
positional powers of 2: 24 23 22 21 20
decimal positional value: 16 8 4 2 1
binary number: 1 0 1 1 1
16 + 4 + 2 + 1 = 2310
10
Binary to Decimal Conversion
positional powers of 2: 25 24 23 22 21 20
decimal positional value: 32 16 8 4 2 1
binary number: 1 1 0 0 1 0
32 + 16 + 2 = 5010
11
Decimal to Binary Conversion
2 ) 22 Rem:
2 ) 11 0
2 ) 5 1
2 ) 2 1
2 ) 1 0
0 1
12
Decimal to Binary Conversion
2 ) 56 Rem:
2 ) 28 0
2 ) 14 0
2 ) 7 0
2 ) 3 1
2 ) 1 1
0 1
13
Octal Number
Ø Base: 8
Ø Digits: 0, 1, 2, 3, 4, 5, 6, 7
n Octal number: 3578
= (3 x 82 ) + (5 x 81) + (7 x 80)
14
Octal to Decimal Conversion
§ Example 1: 3578
positional powers of 8: 82 81 80
decimal positional value: 64 8 1
Octal number: 3 5 7
(3 x 64) + (5 x 8) + (7 x 1)
= 192 + 40 + 7 = 23910
15
Decimal to Octal Conversion
Using the Division Method:
8 ) 214 Rem:
8 ) 26 6
8) 3 2
0 3
16
Hexadecimal Number
Ø Base: 16
Ø Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
17
Hex Values
18
Hex to Decimal Conversion
Ø Example 1: 1F416
Hexadecimal number: 1 F 4
(1 x 256) + (F x 16) + (4 x 1)
= (1 x 256) + (15 x 16) + (4 x 1)
20