Question: Let's attempt implementing an algorithm we have seen before: decimal to binary conversion ( 8 bits only ) Create a function that takes in an
Let's attempt implementing an algorithm we have seen before: decimal to binary conversion bits only
Create a function that takes in an unsigned int as its input and has a void output.
The function will print the binary value of the unsigned int.
ALGORITHM: Pick either this algorithm or the alternative one you only have to implement one
Do not use a recursive solution or your own procedure.
Start with an exponent of
whileexponent
if exponent
print
exponent
else if exponent
print
exponent exponent ;
Alternative Algorithm This one may be harder, but more interesting
There is an alternative method you may consider but may be more difficult
You may extract the actual bit from the unsigned int as shown on slide from this week.
Beware Endianness ordering of bits
This means you may find the bits
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
