I am trying to convert a string representation of a 32 bit binary number to a string representative of the hex value of that number in a function called hexConversion()
. To do this, I am required to use only basic C programming (for loops, basic arrays) and bit shifting/masking. In this assignment, the binary representation used is one that is returned as an array from another function binaryConversion()
.
I do have an idea of how to convert the 4 bit values into their hex values, but I am confused on how to actually break up the 32 bit value into smaller and more workable 4 bit values.
For example, I might want to change 11111111111111111111111111111111
to 1111 1111 1111 1111 1111 1111 1111 1111
so that I might be able to work with each 1111
separately to convert each to F