NUMBER SYSTEM CONVERSION
In this post
we will focused on the number system conversion of decimal,binary and hexadecimal
only.There are many converting method that we can use to convert a number by
using base 2,10 and 16.
2.1 Convert decimal number to binary
number
To convert a decimal
number into a binary number, you should carry out successive divisions by 2 and
use the reminders of the successive divisions.
Example:Convert a decimal number 40.347010
to a binary number
Firstly you
should divide the number in two parts like this:
40.3470=40
and 0.347
Then,divide
the number 40 with base 2 and multiply 0.3470 with base 2 as shown:
2.2 Convert binary number to decimal
number
To convert a binary number into a decimal number,you should multiply with
base 2.
Example:Convert a binary number 1011122
to a decimal number
You should
multiply the binary number with base 2 as shown:
2.3 Convert decimal number to
hexadecimal number
To convert a decimal
number into a hexadecimal number, you should carry out successive divisions by
base 16 and use the reminders of the successive divisions.
Example:Convert a decimal number 185010
to hexadecimal
You should
divide the number with base 16 as shown:
2.4 Convert hexadecimal number to
decimal number
To convert a hexadecimal
number into a decimal number, you should multiply the number with base 16.
Example: Convert a hexadecimal number 5A0D16 to decimal
You should
multiply the number with base 16 as shown:
2.5 Convert binary number to hexadecimal
number
To convert binary number
into a hexadecimal number, you should multiply the number with base 2.
Example: Convert a binary number 11101001.01112 to hexadecimal
You should multiply
the number with base 2 as shown:
2.6 Convert hexadecimal number to
binary number
To convert a hexadecimal
number into a binary number, you should carry out successive divisions by 2 and
use the reminders of the successive divisions.
Example:Convert a hexadecimal number E08B616 to binary
number
You should divide the
number with the base 2 as shown:
2’S COMPLEMENT NUMBER
What is a 2’s
complement number?
Property
Two's complement
representation allows the use of binary arithmetic operations on signed
integers, yielding the correct 2's complement results.
Positive Numbers
Positive 2's complement
numbers are represented as the simple binary.
Negative Numbers
Negative 2's complement
numbers are represented as the binary number that when added to a positive
number of the same magnitude equals zero.
3.1 CALCULATION OF 2’S COMPLEMENT
To calculate the 2's complement of an integer, invert the binary equivalent
of the number by changing all of the ones to zeroes and all of the zeroes to
ones (also called 1's complement), and then add one.
Example:
When
adding two positive numbers there is no need to do 1’s complement number and 2’s
complement number.You just do like usual of binary addition as shown below.
EXAMPLE:
3.3 POSITIVE NUMBER AND SMALLER
NEGATIVE NUMBER
When
there is a negative number you should do 1’s complement number which is
converting the ones to zeroes and zeroes to ones.Then add 1 which is 2’s
complement number as shown below.
EXAMPLE:
NUR LIYANA BT ROSLAN
B031310295