Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

JoãoVitorMC

  • 2 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
  1. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Do you know the decimal value for each of the characters?

  2. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Take the decimal equivalent to your ascii, convert to binary, compare the results.

  3. nick67
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 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

  4. myndless
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    going from lowercase to uppercase in ascii is equivalent to subtracting 32 from the decimal notation of the lowercase letter. 'a' = 97, 97-32 = 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 97-122 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.

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Ask a Question
Find 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
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.