Beruflich Dokumente
Kultur Dokumente
Sinco
NUMBER SYSTEM AND NUMBER
SYSTEM CONVERSION
1
INTENDED LEARNING OUTCOMES (ILOS)
Identify different Number System used in
computer processing and algorithm.
Engr. Sinco
Understand the process how the computer
performs different arithmetic operations on
number system and how computer convert one
number system to another.
Engr. Sinco
ELEMENTS:
Radix tells how many character or symbols are in a character
set
Code/positional value Determines the value of characters in a
certain position
Operation are specified actions that can manipulate the
symbols such as counting, addition, subtraction, multiplication
and division
3
TYPES OF NUMBER SYSTEM
Engr. Sinco
BINARY Contains TWO SYMBOL (0 & 1)
4
NUMBER SYSTEM
DECIMAL BINARY OCTAL HEXADECIMAL
0 0 0 0
1 1 1 1
2 10 2 2
Engr. Sinco
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F 5
16 10000 20 10
Engr. Sinco
CONVERSION OF NUMBER
SYSTEM
6
NUMBER SYSTEM CONVERSION
Decimal to any Base or System
STEPS:
1. Divide the given Decimal number by the
Base-r, of the number system the given
Engr. Sinco
Decimal is to be converted.
2. List down the Remainder. If youre using
a calculator, multiply the Fraction part of
the quotient by the base-r of the number
into which the decimal is to be converted
to get the remainder.
3. Repeat Steps 1 & 2 until the quotient
become Zero.
4. Generate the desired number from the
remainders column from the bottom to
top. 7
DECIMAL TO ANY NUMBER SYSTEM
Convert:
Convert:
(41)10 -- ___ 2 ; Ans. (101001)2
(54)10 -- ___ 8 ; Ans. (66)8
Engr. Sinco
Division Quotient Remainder Division Quotient Remainder
41/2 20 1 54/8 6 6
20/2 10 0 6/8 0 6
10/2 5 0
5/2 2 1
2/2 1 0
1/2 0 1
8
NUMBER SYSTEM CONVERSION
Engr. Sinco
41/8 5 .125x8 1 E
5/8 0 0.625x8 5 A
D
9
NUMBER SYSTEM CONVERSION
ANY NUMBER SYSTEM TO DECIMAL
NUMBER
STEPS:
Multiply the given by the base r.
Engr. Sinco
1.
10
NUMBER SYSTEM CONVERSION
Engr. Sinco
EXAMPLES:
11
NUMBER SYSTEM CONVERSION
5 1 2 9 16
Engr. Sinco
9 x16 =9
1 x8 =1 2x16 =32
5x8 =40
9+32=41 (41)10
40+1=41 (41)10
12
NUMBER SYSTEM CONVERSION
BINARY to OCTAL
STEPS:
1. Partition the Binary number into groups of
Engr. Sinco
3 digits each starting from Binary point
from the RIGHT to LEFT
2.The Corresponding OCTAL digit is then
assigned to each group
2 1 4 2 1 4 2 1 4 2 1 BITS
1 0 0 1 1 0 0 1 0 0 1
13
2 3 1 1 (2311)8
NUMBER SYSTEM CONVERSION
CONVERT OCTAL to BINARY :10011001001 (23)=8
Engr. Sinco
BITS
2 3 1 1
01 0 0 1 1 0 0 1 0 0 1 (2311)8
1. Covert to Binary
1. Covert to Binary
Engr. Sinco
BITS
4 C 9
8 4 2 1 8 4 2 1 8 4 2 1 (24)=16
01 0 0 1 1 0 0 10 0 1
4 12 9
15
C
(4C9)16
NUMBER SYSTEM CONVERSION
CONVERSION of FRACTIONAL PART
(From Decimal to any Bases)
Engr. Sinco
STEPS:
1. Multiply the given Decimal number by the base-r
of the number into which the given decimal
number is to be converted to.
2. Repeat the proceeding process until the fractions
becomes Zero or until the number of digits have
sufficient accuracy.
3. Generate the Final answer from the integral part
from TOP to BOTTOM.
16
Example: 0.125 >>>Binary=(001)2
INTEGER FRACTIONAL
PART
0.125x2 0 0.25
0.25x2 0 0.5
Engr. Sinco
0.5x2 1 0
INTEGER
FRACTIONAL PART
Engr. Sinco
CONVERT BINARY to DECIMAL:.001 (.125)10
23222120 2-12-22-32-4
0 0 0 1 .1 0 0 0
0.001
1 x2-3=0.125
0x2-2=0
0x2-1=0
(.125)10 18
NUMBER SYSTEM
Engr. Sinco
ARITHMETIC
ADDITION OF NUMBER
SYSTEM
19
ADDITION OF BINARY NUMBERS
0 + 0 = 0
0 + 1 = 1
Engr. Sinco
1 + 0 = 1
1 + 1 = 0 carry 1
Example:
1011.101
+ 11.11
1111.011
ADDITION OF OCTAL NUMBER
11
4163
Engr. Sinco
+ 1576
5761
3+6 = 9-8 =1
1+6+7 = 14-8 = 6
1+1+5 = 7
4+1 = 5
21
ADDITION OF HEXADECIMAL NUMBER
1
815A
Engr. Sinco
+ F7A1
178FB
A+1 = 10+1 = 11 = B
5+A = 5+10 = 15 = F
1+7 = 8
8+F = 8+15 = 23-16 = 7
22
Engr. Sinco
SUBTRACTION OF NUMBER
SYSTEM
23
SUBTRACTION OF BINARY NUMBERS
0-0 = 0
0 - 1 = 1 borrow 1
1-0 = 1
Engr. Sinco
1-1 = 0
Example:
10111.111
- 1010.010
1101.101
24
SUBTRACTION OF OCTAL NUMBER
305
4163
Engr. Sinco
- 1576
2365
3-6 = 8+3-6 = 5
5-7 = 8+5-7= 6
0-5 = 8+0-5 = 3
3-1 = 2
25
SUBTRACTION OF HEXADECIMAL NUMBER
3 9
41A3
Engr. Sinco
- 2F7B
1228
26
Engr. Sinco
COMPLEMENTS
27
COMPLEMENTS
rs (radix complement) = 2's complement
r-1s (diminished radix) = 1's complement
Engr. Sinco
28
1's complement obtained by subtracting the
bit from 1 (inverse)
Example:
10101 = 01010 1's complement
NOTE:
BINARY-2s complement;1s complement
OCTAL 7s complement
HEX 15s complement
COMPLEMENTS
2's complement obtained by taking the 1's
complement then adding 1 to the least
significant bit (LSB) of the complemented
Engr. Sinco
29
number
Example:
10101 = 01010 1's complement
+ 1
01011 2's complement
SUBTRACTION USING THE 1S
COMPLEMENTS
1. Take the 1's complement of the
subtrahend then add it to the minuend.
2. If there is an end carry in the sum, add
Engr. Sinco
30
it to the LSB of the sum, otherwise get
the 1's complement and prefix a
negative (-) sign.
Example:
10111.111 10111.111
- 1101.101 = + 10010.010
01010.001
+ 1
01010.010
SUBTRACTION USING THE 2S
COMPLEMENTS
1. Get the two's complement of the
subtrahend then add it to the minuend
2. If there is an end carry in the sum,
Engr. Sinco
31
disregard, otherwise take the 2's
complement of the sum then a prefix a
negative sign (-)
Example:
10111.111
- 1101.101 = 10010.010
+ 1
10010.011
10111.111
(1)01010.010
SUMMARY COMPLEMENTS
1s Complement
1. Take the 1's complement of the subtrahend
then add it to the minuend.
Engr. Sinco
32
2. If there is an end carry in the sum, add it to
the LSB of the sum, otherwise get the 1's
complement and prefix a negative (-) sign.
2s Complement
1. Get the two's complement of the subtrahend
then add it to the minuend
2. If there is an end carry in the sum,
disregard, otherwise take the 2's
complement of the sum then a prefix a
negative sign (-)
Engr. Sinco
Thank You!
33