Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, loveworld3798
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
image
Computers and Technology, 22.06.2019 17:00, Janznznz1121
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
image
Computers and Technology, 23.06.2019 12:40, Emilyvite6251
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, ahmedeldyame
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
Do you know the correct 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
English, 06.01.2021 02:20