2. NUMBER SYSTEM
POSITIONAL
POSITIONAL NON-POSITIONAL
NON-POSITIONAL
SYSTEM
SYSTEM SYSTEM
SYSTEM
New numbers are formed New Symbolic representation
using digits: 0-9 and a for every number.
decimal point. Decimal Roman
10 1 Dec. 1/10 1/100 1,2,3,4,5,6,7, I, II, III, IV, V, VI, VII,
8,9 VIII, IX
3 5 . 2 5
10 X
3×10 5×1 2×1/10 5×1/100
11 XI
30 5 .20 .05
+ + 12 XII
--- ----
03/02/13
35 25
3. POSITIONAL NUMBER SYSTEM
Decimal (BASE 10) Number System uses 10
symbols 0,1,2,3,4,5,6,7,8,9 called digits.
Decimal
numbers
Integer numbers
Integers are whole Real numbers
numbers Numbers that has fractions
Examples 1, 2, -3, 50, like 687. 345, -49.56, …
675, -560, …..
03/02/13
4. NUMBER SYSTEM
• In computer real numbers are referred to as
floating point numbers.
• Floating point numbers are represented as
<Integer part> <Radix Point> <Fractional part>
34568 . 56735
34568.56735
03/02/13
5. Decimal Number System
In decimal number system the value of a digit
is determined by digit × 10 position .
In integer numbers the position is defined as 0,1,2,3,4,5,…
starting from the rightmost position and moving one position
at a time towards left.
Position 4 3 2 1 0
10 position 10 4 10 3 10 2 10 1 10 0
Position value 10000 1000 100 10 1
Digits 7 2 1 3 4
Digit Value 7×10 4 2×10 3 1×10 2 3×10 1 4×10 0
03/02/13
6. Decimal Number System
Digit Value 7×10 4 2×10 3 1×10 2 3×10 1 4×10 0
Digit Value 70000 2000 100 30 4
Integer 70000 + 2000 + 100 + 30 +4
Number
72134
03/02/13
7. Decimal Number System
In floating point numbers the position is defined as
0,1,2,3,4,5,… starting from the radix point and
moving one position at a time towards left, and -1,-
2,-3, … starting from the radix point and moving
towards right one position at a time.
Position
Place Value
Digits
436.85 = 4 × 100 + 3 × 10 + 6 × 1 . 8 × 0 .1 + 5 × 0.01
03/02/13
8. Data Representation for
Computers
• Computers store numeric (numbers) as well non-
numeric (text, images and others) data in binary
representation (binary number system).
• Binary number system is a two digits (0 and 1),
also referred to as bits, so it is a base 2 system.
• Binary number system is also a positional number
system. In this system, the position definition is
same as in decimal number system.
• In binary number system the value of a digit is
determined by digit × 2 position .
03/02/13
9. Binary Number System
Value = digit ×
position
2
Position 4 3 2 1 0
2 position 24 23 22 21 20
Position value 16 8 4 2 1
Binary Digits 1 1 1 0 1
Digit Value 1×2 4 1×2 3 1×2 2 0×2 1 1×2 0
1 × 16 1×8 1×4 0×2 1×1
16 8 4 0 1
(11101)2 + = (29)10
03/02/13
10. Binary Number System
Floating Point Number (101.11)2= (5.75)10
Position
Place Value
Digits
5 75
03/02/13
12. Decimal, Binary, Octal and Hexdecimal
(1101)2 = 1 x 23+1x22+0x21+1x20
l
= 1 x 8+ 1 x 4 + 0 x 2 + 1 x 1
ecima
= 8+4+0+1 tod
ary
= (13)10 Bin
(2057)8 = 2 x 83+0x82+5x81+7x80
l
= 2 x 512+ 0 x 64 + 5 x 8 + 7 x 1 ecima
d
= 1024+0+40+7 l to
Octa
= (1071)10
l
a
(1AF)16 = 1 x 162+Ax161+Fx160 e cim
= 1 x 256+ 10 x 16 + 15 x 1 tod
m al
= 256+160+15 deci
= (431)10 H exa
03/02/13
13. More examples
Ternary (base-3) numbers (211)3 = 2 x 32 + 1 x 31 + 1 x 30
Quaternary (base-4) numbers =18 + 3+1
Quinary (base-5) numbers = (22)10
(211)4 = 2 x 42 + 1 x 41 + 1 x 40
Senary (base-6 ) numbers =32 + 4+1
?? (base-7) numbers = (37)10
Tridecimal or Tredecimal
(base-13) numbers (211)5 = 2 x 52 + 1 x 51 + 1 x 50
=50 + 5+1
Mayan number (base-20) system
= (56)10
Ex.
(211)6 = (?)10
(211)7 = (?)10
(211)13 = (?)10
03/02/13
(211)20= (?)10
14. From Decimal to Another Base
1. Divide the decimal Example
number by the new base. Convert (25)10=()2
2. Record the remainder as
the right most digit.
3. Divide the quotient of the
previous divide by the new Number/ Quotient Reminder
base. Base
4. Record the remainder as 25/2 12 1
the next digit.
12/2 6 0
5. Repeat step 3& 4 until the
quotient becomes 0 in 6/2 3 0
step 3. 3/2 1 1
1/2 0 1
03/02/13 (25)10=(11001)2
16. From Decimal to Another Base
Convert Convert
(428)10=()16 (100)10=()5
16 428 Remainder 5 100 Remainder
26 12 C 20 0
1 10 A 4 0
0 1 0 4
Convert Convert
(428)10=(1AC)16 (100)10=(400)5
03/02/13
17. From Decimal to Another Base
Convert Convert
(100)10=()4 (1715)10=()12
4 100 Remainder 1 1715 Remainder
25 0 2 142 11 B
6 1 11 10 A
1 2 0 11 B
0 1
Convert Convert
(100)10=(1210)4 (1715)10=(BAB)12
03/02/13
18. Converting from a base other than to a
base other than 10
1. Convert the original number to a decimal number.
2. Convert that decimal number to the new base.
Convert (545)6 to () 4
(545)6 = 5 x 62+4 x 61+ 5 x 60 = 5 x 36 + 4 x 6 + 5 x 1 = 180+24+5= (209)10
4 209 Remainder
52 1
13 0
545)6 = (209)10=(3101) 4
3 1
0 3
03/02/13
19. Converting form a base other than to a
base other than 10
Convert (101110)2 to () 8
(101110)2 = 1 x 25+0 x 24+1 x 23 +1 x 22+1 x 21+0 x 20 = (46)10
8 46 Remainder
5 6
(101110)2 = (46)10=(56)8
0 5
Convert (11010011)2 to () 16
(11010011)2 = 1 x 27+1 x 26+0 x 25 +1 x 24+0 x 23 +0 x 22+1 x 21+1 x 20 = (211)10
1 211 Remainder
6 13 3 3 (11010011)2 = (211)10=D3) 16
0 13 D
03/02/13
20. Shortcut methods
Binary to Octal
1.Start from the rightmost position, make groups of three binary digits.
2.Convert each group into octal digit
Convert (101110)2 to () 8
101 110
(5 6)8
Octal to Binary
1.Convert each octal to three digit binary.
2.Combine them in a single binary number (5 6)8
03/02/13
(101 110)2
22. Shortcut methods
Binary to Hexadecimal conversion
1.Starting from the right most position make groups of 4 binary digits
2.Convert each group its hexadecimal equivalent digits
(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Convert (10 1110 0000 1000)2 to () 16
10 1110 0000 1000
(2) (14) (0) (8)
(2E08) 16
03/02/13
24. Floating Point
368.65
368.65 x 10-1 = 36.865 368.65 x 101 = 3686.5
368.65 x 10-2 = 3.6865 368.65 x 102 = 36865.
368.65 x 10-3 = .36865
.36865 x 103 36865. x 10-2
03/02/13
Mantissa Exponent
Notas do Editor
Ternary base 3 Quinary Base 5 Quaternary Base 4 senary numeral system is a base -6 numeral system Base - 13 , tridecimal, or tredecimal The octal numeral system ,