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, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
You draw two cards from a standard deck of 52 cards, but before you draw the second card, you put the first one back and reshuffle the deck. (a) are the outcomes on the two cards independent? why?
Answers: 3
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
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
Physics, 16.07.2019 09:00