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

Program to find the absolute value of given integer using Conditional Operators

6 Answers   N Tech,


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

0 Answers  


Explain pointers in c programming?

0 Answers  


What is Generic pointer? What is the purpose of Generic pointer? Where it is used?

3 Answers  


Write a program for deleting duplicate elements in an array

3 Answers   Subex,






What is a shell structure examples?

0 Answers  


which is an algorithm for sorting in a growing Lexicographic order

0 Answers  


explain about storage of union elements.

2 Answers   ABC, Bosch,


What is a ternary operator in c?

0 Answers  


Why is the code below functioning. According to me it MUST NOT.

1 Answers  


where do we use volatile keyword?

1 Answers  


#include <stdio.h> int main ( int argc, char* argv [ ] ) { int value1 = 10; int value2 = 5; printf ( "\n The sum is :%d", value1 | value2 ); } This is the answer asked by some one to add two numbers with out using arithmetic operator?Yes this answer is write it given out put as 15.But how????? what is need of following line? int main ( int argc, char* argv [ ] ) how it work?what is the meaning for this line? please explain me.Advance thanks

9 Answers   Excel,


Categories