Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

JoãoVitorMC Group Title

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?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. eSpeX Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

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

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

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

    • 2 years ago
  3. nick67 Group Title
    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

    • 2 years ago
  4. myndless Group Title
    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.

    • 2 years ago
    • Attachments:

See more questions >>>

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.