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

Can we assign string to char pointer?

0 Answers  


write a program without using main function?

2 Answers   TCS,


write a program of bubble sort using pointer?

3 Answers   TCS,


write a prgram of swapping with 2 valiables

6 Answers  


triangle number finding program...

1 Answers   HCL,


Explain high-order and low-order bytes.

0 Answers  


What are the different types of control structures in programming?

0 Answers  


Explain void pointer?

0 Answers  


How do you declare a variable that will hold string values?

0 Answers  


what is the difference between auto and static keywords

1 Answers   cDot, College School Exams Tests, TCS,


Do you have any idea about the use of "auto" keyword?

0 Answers  


hat is a pointer?

4 Answers   Assurgent,


Categories