Question: unsigned int oddParitySet 3 ( unsigned int intArg, unsigned int startBit ) ; This function will determine the odd parity for a 3 - bit

unsigned int oddParitySet3(unsigned int intArg, unsigned int startBit);
This function will determine the odd parity for a 3-bit segment of intArg starting at bit startBit and set the parity bit (low-order bit) appropriately.
E.g., suppose intArg=6 and startBit =2. The 32 bit representation, from high to low, would be 29 zeros then 110. So, bits 2-0 are 110. To make the parity odd, you would set bit zero to 1.
The return value is the modified intArg, in this case it would be 29 zeros then 111 or a value of 7.
Do not convert intArg to a string and operate on that. Use only integers or unsigned integers.
Note: If the start bit is greater than 31 or less than 2, this would present a problem (do you see this?). If this is the case, return a zero.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!