How to convert a binary number to Hexa decimal number??
(Note:Do not convert it into binary and to Hexadecimal)
Answer Posted / 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 View All Answers
What is keyword with example?
string reverse using recursion
explain what is an endless loop?
How do you do dynamic memory allocation in C applications?
Can we change the value of constant variable in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
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.
Write the Program to reverse a string using pointers.
What is a rvalue?
What are the types of unary operators?
What are linked lists in c?
write a program to create a sparse matrix using dynamic memory allocation.
Explain output of printf("Hello World"-'A'+'B'); ?
Differentiate between a for loop and a while loop? What are it uses?
What is the use of ?: Operator?