Wednesday, July 2, 2008

Please Converting a Decimal number to a Binary number

As we all know that computer runs on Binary numeral system. The binary numeral system, also called the base-2 number system, is a numeral system that represents numeric values using two symbols, 0 and 1. In computers, 0 and 1 are called bits. Bits are grouped in bytes to form binary numbers.

Nibble

Nibble is a group of four bits. Sometimes it is also called a half-byte number. An example of a nibble is 1010.

Byte

Byte is a group of eight bits. An example of a byte is 10100111.

Converting a Decimal number to a Binary number

Let us have a look at the table given below:

Position 8 7 6 5 4 3 2 1
Weightage 27 26 25 24 23 22 21 20
Decimal Value 128 64 32 16 8 4 2 1


The table shows the individual values (weight) of eight bits according to their positions. Let's change a decimal number to a binary number.

Exercise: Change a decimal number 201 to its binary equivalent.

Step 1

To convert a binary number (a byte) to a decimal number, make a table with positional values and a blank row, as shown below:

Positional Value 128 64 32 16 8 4 2 1
Binary Symbol


Step 2

Place symbol 1 to the maximum weightage position that is not greater than the decimal number.

Positional Value 128 64 32 16 8 4 2 1
Binary Symbol 1


Step 2

Subtract the positional value from the original one.

201 - 128 = 73

Step 3

Fill the next available maximum weightage position.

Positional Value 128 64 32 16 8 4 2 1
Binary Symbol 1 1


Subtract the positional value from the remaining one.

73 - 64 = 9

Step 4

Now the next available position to accommodate 9 is 8, as 32 and 16 are greater than 9. Place the symbol 0 to the position 32 and 16 and 1 at the position 8.

Positional Value 128 64 32 16 8 4 2 1
Binary Symbol 1 1 0 0


9 - 8 = 1

Step 5

Again...

1 is lesser than 4 and 2 so place symbol 0 at their position and put symbol 1 at position 1.

Positional Value 128 64 32 16 8 4 2 1
Binary Symbol 1 1 0 0 1 0 0 1


Here is your binary equivalent of decimal number 201 -

11001001

Isn't it easy? Ok! Practice hard to make it quick.