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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
image
Computers and Technology, 24.06.2019 11:00, soystersoce
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
image
Computers and Technology, 24.06.2019 11:20, tiffanibell71
Colby works as a shipping clerk for a major package delivery service. some of his daily tasks include tracking shipments and entering orders. which aspect of the information technology cluster would he most likely be trained in? a. networkingb. databasesc. hardwared. software
Answers: 2
image
Computers and Technology, 24.06.2019 15:00, mbede002
Who introduced the concept of combining artificial and natural light in the studio
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 in other subjects:

Konu
Mathematics, 10.02.2021 17:50