How to convert a binary number to Hexa decimal number??
(Note:Do not convert it into binary and to Hexadecimal)



How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to ..

Answer / vignesh1988i

let us take a binary number.. say :

0000000110101110 (16 bit number)
we already know it's the consersion to HEXA DECIMAL equivalent.... so split the numbers into 4 bits each... like,

0000 0001 1010 1110 (16 bit number)

and for converting directly there is a conversion called 8421 code...

8421 | 8421 | 8421 | 8421
0000 | 0001 | 1010 | 1110

now in the first pass it is zero (from left to right) , second it is 1 , in third it is 10 (A in hexa.) , in fourth it is 14 (E in hexa.)


thus the final representation for the above binary is : 1AE


thank u

Is This Answer Correct ?    12 Yes 4 No

Post New Answer

More C Interview Questions

how to write a cprogram yo get output in the form * *** ***** ******* ********* ******* ***** *** *

3 Answers  


A C E G H +B D F A I ------------ E F G H D

1 Answers   Infosys,


Explain what are global variables and explain how do you declare them?

0 Answers  


Was 2000 a leap year?

0 Answers  


Why should I use standard library functions instead of writing my own?

0 Answers  






what are the advantages & disadvantages of unions?

2 Answers  


Can a local variable be volatile in c?

0 Answers  


the maximum value that an integer constant can have is a) -32767 b) 32767 c) 1.701e+38 d) -1.7014e+38

1 Answers  


How to declare pointer variables?

0 Answers  


how can u print a message without using any library function in c

1 Answers   NIIT,


Can we change the value of constant variable in c?

0 Answers  


what will be the output for the following main() { printf("hi" "hello"); }

5 Answers   RoboSoft,


Categories