CONVERSION OF A NUMBER FROM ONE BASE TO ANOTHER
steps
·
TO CONVERST A NUMBER FROM ONE BASE TO ANOTHER WE NEED
TO CONVERT THAT NUMBER TO DECIMAL
·
AFTER CONVERTIN G THAT NUMBER TO DECIMAL WE CONVERT
THAT NUMBER TO THE REQUIRED BASE
GENERAL
EXAMPLE
CONVERSION OF A
NUMBER OF BASE n TO DECCIMAL:
(abcdefg)n=a*n6+b*n5+c*n4+d*n3+e*n2+f*n1+g*n0
Example:
Conversion
of a decimal to base p:
(abcdefg)10=
so our number in ^base p is
(abcdefg)10=(rem n….. rem5 rem4 rem3 rem2 rem1) p
example:
A TRICK FOR CONVERTING FROM POWERS OF TWO TO POWERS OF TWO:
2^3=8, 2^1=2,2^4 =16
- · So a single octal requires 3 bits to store its one digit
- · hex requires 4
- so we divide a number given in base 2 in group of 3for octal and group of 4 for hexadecimal and convert it into decimal and write it simply
MORE EXAMPLES:
No comments:
Post a Comment