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

Linked lists -- can you tell me how to check whether a linked list is circular?

0 Answers  


Explain how can you tell whether a program was compiled using c versus c++?

0 Answers  


HOW DO YOU HANDLE EXCEPTIONS IN C?

2 Answers   AppLabs,


How many data structures are there in c?

0 Answers  


how do we remove the printed character in printf statement and write next it it

1 Answers  






my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details

2 Answers  


#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā€); #endif

4 Answers   IBM, Vector,


what is a constant pointer in C

0 Answers  


Can a pointer be null?

0 Answers  


Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

4 Answers   TCS,


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

0 Answers   Wilco,


What is self-referential structure in c programming?

0 Answers  


Categories