Question: Write a C program that converts a string of upper case letters to their corresponding lower case using only bitwise operators. ASCII chart. Table 2.6
Write a C program that converts a string of upper case letters to their corresponding lower case using only bitwise operators. ASCII chart. Table 2.6 ASCII code chart Most Significant Digit DLE DC2 DC4 SYN NUL SP 0 Aa 5ENQ NAK % 5 E U ACK Significant BS HT CAN EM SUB :Zz ESC + FS DEL Upper to lower involves adding 20h. For example, given the letter H,-48H, the letter h -48H-20H = 68H. The pseudocode is simply result result +Ox20 //add 20h However, since addition is disallowed, the operation must be implement using bitwise operators. Using the Boolean equation for addition, each bit of the result can be computed using bitwise operators. Since bits b0-b4 of the second addend (0x20) are all zeros, the carry bits for these bit positions will also be zero. It's only starting with bit5 that a carry must be computed. The carry-in to bit5 is zero, so the sum is the xor of the addend and 1, i.e
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
