A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 3 years ago
How many bits must be “flipped” (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase ‘a’ that’s represented in ASCII?
anonymous
 3 years ago
How many bits must be “flipped” (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase ‘a’ that’s represented in ASCII?

This Question is Closed

eSpeX
 3 years ago
Best ResponseYou've already chosen the best response.2Do you know the decimal value for each of the characters?

eSpeX
 3 years ago
Best ResponseYou've already chosen the best response.2Take the decimal equivalent to your ascii, convert to binary, compare the results.

nick67
 3 years ago
Best ResponseYou've already chosen the best response.0@JoãoVitorMC it's more useful to start from hex values: A <=> 41 <=> 0100 0001 a <=> 61 <=> 0110 0001 B <=> 42 <=> 0100 0010 b <=> 62 <=> 0110 0010 ... ... Z <=> 5A <=> 0101 1010 z <=> 7A <=> 0111 1010 just toggle b5 from 0 to 1 to transform uppercase to lowercase or toggle b5 from 1 to 0 to transform from lowercase to uppercase: that's all

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0going from lowercase to uppercase in ascii is equivalent to subtracting 32 from the decimal notation of the lowercase letter. 'a' = 97, 9732 = 65 = 'A'. Subtracting 32 is equivalent to doing an XOR with 00100000, with the possibility of a carry bit in the case that you XOR a 0 with a 1, which could in turn trigger a bit flip, which means that at most the 3 most significant bits could flip. However, the lowercase alphabet in ASCII is only 97122 in decimal. That entire range begins with 011 in binary, thus subtracting 00100000 will always only flip the '32' place bit. So not only for 'a', but for all 26 letters in the english alphabet, exactly 1 bit must be flipped to capitalize it in ASCII.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.