NIMCET 2009 — Computer PYQ
NIMCET | Computer | 2009To change upper case to the lower case letter in ASCII, correct mask and operation should be
Choose the correct answer:
- A.
0100000 and NOR.
- B.
0100000 and NAND.
- C.
0100000 and OR.
(Correct Answer) - D.
None of the above
0100000 and OR.
Explanation
To understand how to convert uppercase to lowercase in ASCII, we look at the binary patterns of the characters:
-
ASCII Pattern: In the ASCII table, the difference between an uppercase letter and its lowercase counterpart is exactly 32 in decimal.
-
Example: 'A' is 65 (01000001 in binary).
-
Example: 'a' is 97 (01100001 in binary).
-
-
The Bit Difference: If you compare the two binary strings, the only difference is at the 6th bit (the bit representing 25=32).
-
Uppercase has a 0 at the 6th bit.
-
Lowercase has a 1 at the 6th bit.
-
-
The Operation: To change a 0 to a 1 while keeping all other bits the same, we use the bitwise OR operation with a mask that has a 1 only at the target position.
-
Mask: 0100000 (which is 32 in decimal).
-
Calculation: ′A′(01000001) OR 0100000=01100001(′a′).
-
Thus, using the mask 0100000 with the OR operation correctly performs the conversion.

