Thursday, December 25, 2008

Hexadecimal Number System in C Program

Answer:

In hexadecimal number system we use 16 different digit so it’s base is 16


TABLE

Hexadecimal digit decimal equivalent binary equivalent

0 0 0000

1 1 0001

2 2 0010

3 3 0011

4 4 0100

5 5 0101

6 6 0110

7 7 0111

8 8 1000

9 9 1001

A 10 1010

B 11 1011

C 12 1100

D 13 1101

E 14 1110

F 15 1111



To convert the binary number into hexadecimal number:


Make the group of four binary digits from right to left put the equivalent hexadecimal digit

using TABLE.


e.g. binary number =11000111110101

group of four digit from right 11 0001 1111 0101

to make group of four digit of left most digit 11 ,add two zero to the left side i.e. 0011

Now put the equivalent hexadecimal digit form table


0011 0001 1111 0101

3 1 F 5


So, equivalent hexadecimal number will be 31F5

No comments:

Blog List