subject

In this lab you will convert an integer to an ASCII string of 1 and o characters representing the 32 individual bits of the integer, from most significant bit to least significant bit. This will require you to use bit manipulations and masking, as well as reinforce the structure of integers. Requirements
You must implement the function bitstring() in bitstring. c. This function accepts an integer and a character pointer, and writes a string of exactly 32 ASCII '1' and 'o' characters followed by a terminating NUL byte to the location beginning at the character pointer, containing the bit representation in the input integer. void bitstring(int32_t in, char *out); The bits of in, from 0 to 31, should be placed into the string out , with bit 31 in out[0] and bit 0 in out[31], followed by a terminating NUL character, with an ASCII '1' character representing a one bit and an ASCII o' character representing a O bit. Thus, the integer 1 would produce the string "00000000000000000000000000000001". Possible Strategies There are two likely strategies for pulling the individual bit values out of an integer:
• Shifting a mask one bit at a time, and applying it to the fixed integer
• Shifting the integer one bit at a time, and applying a fixed mask to it
It is also (because the number of bits in the integer is a fixed constant) possible to process the integer in either most- significant to least-significant bit order, or least-significant to most significant.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
What do you need to know & understand about global expansion.
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
The gene form of a trait is called a(n) 
Answers: 2
You know the right answer?
In this lab you will convert an integer to an ASCII string of 1 and o characters representing the 32...
Questions
question
History, 03.12.2021 19:40
Questions on the website: 13722363