• Lucid Dreaming - Dream Views




    Results 1 to 13 of 13
    1. #1
      Upside down Achievements:
      Tagger First Class Made lots of Friends on DV Vivid Dream Journal 5000 Hall Points Veteran Second Class
      Taffy's Avatar
      Join Date
      May 2010
      LD Count
      ~40
      Gender
      Posts
      1,416
      Likes
      807
      DJ Entries
      163

      Can someone explain base conversions (Java?)

      So I have to take my AP computer science test next week and I know for a fact that base conversions will be on it. Can anyone explain how to do these, both from a higher base to a lower base and from a lower base to a higher base? On paper I mean.

    2. #2
      Achievements:
      Veteran First Class 5000 Hall Points
      reci's Avatar
      Join Date
      Feb 2008
      LD Count
      18
      Gender
      Location
      -
      Posts
      380
      Likes
      90
      Jeez, look it up on google [-]

      Oh, and good luck
      Last edited by reci; 05-04-2012 at 12:46 AM.
      Tutorial: How to Fall Asleep Faster
      You are dreaming.Do a reality check.

    3. #3
      Upside down Achievements:
      Tagger First Class Made lots of Friends on DV Vivid Dream Journal 5000 Hall Points Veteran Second Class
      Taffy's Avatar
      Join Date
      May 2010
      LD Count
      ~40
      Gender
      Posts
      1,416
      Likes
      807
      DJ Entries
      163
      But this is just a calculator. And that little piece of info at the bottom didn't help much. I need to know how to do it by hand, and I did try searching, I couldn't find any sites that explain it simply enough for me to understand. That's why I was hoping someone here may know. :C

      And thanks, I'll try my best, even though I'm not too confident that I'll get a high grade. ^___^;;
      Last edited by Taffy; 05-04-2012 at 03:13 AM.

    4. #4
      ├┼┼┼┼┤
      Join Date
      Jun 2006
      Gender
      Location
      Equestria
      Posts
      6,315
      Likes
      1191
      DJ Entries
      1
      I don't undestand what you mean by base conversion. Do you mean simply turning for example 8 (in base 10) into binary? Or from binary to hexadecimal? How many different bases are you supposed to know?

      ---------
      Lost count of how many lucid dreams I've had
      ---------

    5. #5
      Upside down Achievements:
      Tagger First Class Made lots of Friends on DV Vivid Dream Journal 5000 Hall Points Veteran Second Class
      Taffy's Avatar
      Join Date
      May 2010
      LD Count
      ~40
      Gender
      Posts
      1,416
      Likes
      807
      DJ Entries
      163
      Just a regular number to different bases. Like 125 base 10 to base 4.

    6. #6
      Achievements:
      Veteran First Class 5000 Hall Points
      reci's Avatar
      Join Date
      Feb 2008
      LD Count
      18
      Gender
      Location
      -
      Posts
      380
      Likes
      90
      Jeez, can't you read?

      From the aforementioned link, it says to convert the decimal (base 10) number 640,000 to base 60, it is:
      2 x 60^3 + 57 x 60^2 + 46 x 60^1 + 40 x 60^0 = 640,000
      therefore the base 60 number is 2,57,46,40 (numerals separated by commas)

      As another example, from 753 (base 8) to base 4:

      1) convert 753 (base 8) to base 10
      7 x 8^2 + 5 x 8^1 + 3 x 8^0
      7*64 + 5*8 + 3*1 = 491 (base 10)

      2) convert that to base 4
      1*4^4 + 3*4^3 + 2*4^2 + 2*4^1 + 3*4^0 = 491 (base 10)
      so, 491 (base 10) = 13223 (base 4)

      3) in summary, 753 (base 8) = 13223 (base 4)



      Notice the patterns:
      a*Q^x + b*Q^(x-1) + ... + j*Q^1 + k*Q^0

      Always maximize the coefficients of the higher exponents (without going over);
      i.e. 1*4^4 + 3*4^3 + 2*4^2 + 2*4^1 + 3*4^0
      It is incorrect to have 1*4^2 because that would cause an overflow in the coefficients of lower powers.

      Clear?
      Last edited by reci; 05-04-2012 at 04:52 PM. Reason: formatted text for clarity
      Tutorial: How to Fall Asleep Faster
      You are dreaming.Do a reality check.

    7. #7
      Member Achievements:
      Created Dream Journal Referrer Bronze 5000 Hall Points Tagger First Class Populated Wall Veteran First Class
      Arra's Avatar
      Join Date
      Jan 2011
      Posts
      3,838
      Likes
      3887
      DJ Entries
      50
      Reci's answer is great. I'll explain it in a slightly different more tedious but less difficult way if it helps.

      First convert to base 10. This is easy, and it's clear how to do it from looking at reci's (1).

      Then, convert that result to the base you need.
      Ex: Base-2 is the easiest. Make a simple table like this, with 2's and their powers on the left, and the base 10 versions (which you should have memorized) on the right:


      2^0 1
      2^1 2
      2^2 4
      2^3 8
      2^4 16
      2^5 32
      2^6 64
      2^7 128
      2^8 256
      2^9 1024
      2^10 2048


      357 in base 10 to base 2:

      Look for the highest number in the right column of the table that is lower than 357.
      That number is 256. To the left of 256 is 2^8, so write 1 * 2^8.
      Now subtract 256 from 357 to get 101.

      Repeat those steps with 101 instead of 357:

      Spoiler for Same steps with 101:


      Keep repeating until you get to 0, then add all the numbers. The result should be 1 * 2^8 + 1 * 2^6 + 1 * 2^5 + 1 * 2^2 + 1 * 2^0.

      Now, starting from the left, write the coefficient of 2^8: 1
      Then keep going down with the exponents. Since there is no 2^7, an invisible 0 * 2^7 is implied, so add a 0: 10
      Then go down to 2^6. Since there is one 2^6, add another 1: 101

      Spoiler for The rest, same steps:



      To convert base-10 to any other base, make another table.
      For example, with base 4, this would be the table:

      4^0 1
      4^1 4
      4^2 16
      4^3 64
      4^4 256
      4^5 1024
      4^6 4096

      Convert the number 1273 from base-10 to base-4:

      As before, find the highest number in the right column that is lower than 1273. That number is 1024, so you need to write 4^5.
      Now, this step is different from the binary table.
      Count how many times 1024 can be multiplied before going over 1273. This number is your coefficient for the current term. In this case, it is 1, so you have 1 * 4^5.

      That is the only difference in every step. The rest is similar to the above base-2 example.

      Spoiler for The rest:

    8. #8
      Upside down Achievements:
      Tagger First Class Made lots of Friends on DV Vivid Dream Journal 5000 Hall Points Veteran Second Class
      Taffy's Avatar
      Join Date
      May 2010
      LD Count
      ~40
      Gender
      Posts
      1,416
      Likes
      807
      DJ Entries
      163
      @Reci, yes, I can read, but I needed it to be explained much more simply. Obviously I didn't understand it when I read it, and needed a step by step explanation, which Dianeva was kind enough to type out for me. Thank you very much for that, Dianeva.

      Reci, looking at your explanation now, I see that it makes sense, and I appreciate you writing it up for me. I'll do some practice problems and hopefully get those questions right on the test. Thanks, both of you.

    9. #9
      ├┼┼┼┼┤
      Join Date
      Jun 2006
      Gender
      Location
      Equestria
      Posts
      6,315
      Likes
      1191
      DJ Entries
      1
      What is their rationale for requiring all students to know base conversion by head? This makes zero sense. It has no application in the real world.

      ---------
      Lost count of how many lucid dreams I've had
      ---------

    10. #10
      Upside down Achievements:
      Tagger First Class Made lots of Friends on DV Vivid Dream Journal 5000 Hall Points Veteran Second Class
      Taffy's Avatar
      Join Date
      May 2010
      LD Count
      ~40
      Gender
      Posts
      1,416
      Likes
      807
      DJ Entries
      163
      I know, I don't get it either.

    11. #11
      Member Achievements:
      Created Dream Journal Referrer Bronze 5000 Hall Points Tagger First Class Populated Wall Veteran First Class
      Arra's Avatar
      Join Date
      Jan 2011
      Posts
      3,838
      Likes
      3887
      DJ Entries
      50
      Conversions among binary, base-10 and hex might make sense in CS. Maybe they just want to make sure you understand the concept of bases. Base-3 computers might be in the future and are supposed to work more efficiently in theory. Making everyone memorize it all still seems to be overdoing it to me though.

    12. #12
      Wololo Achievements:
      Created Dream Journal Tagger Second Class 1000 Hall Points Made lots of Friends on DV Populated Wall Referrer Bronze Veteran First Class
      Supernova's Avatar
      Join Date
      Jul 2009
      LD Count
      Gender
      Location
      Spiral out, keep going.
      Posts
      2,909
      Likes
      908
      DJ Entries
      10
      I saw CS on the AP schedule and just lol'ed. My school has one CS-related course, which was cancelled this year because not enough people signed up.

      Best of luck though. Know that I can commiserate - I have Spanish tomorrow, and it shall indeed totally suck . My hopes for statistics are somewhat higher, though.

    13. #13
      Member Achievements:
      Made Friends on DV Veteran First Class 5000 Hall Points

      Join Date
      Jun 2010
      Gender
      Posts
      709
      Likes
      348
      Don't forget to study your binary vectors (and translations, or any n-ary vector system), which is fundamental to many modern applications, computer languages, and other sciences.

    Similar Threads

    1. My brainfuck (Java)
      By Sornaensis in forum Tech Talk
      Replies: 2
      Last Post: 02-04-2012, 09:00 PM
    2. quick java question
      By Abra in forum Tech Talk
      Replies: 7
      Last Post: 05-20-2009, 03:10 AM
    3. PHP / Java scripting help.
      By Adam in forum Tech Talk
      Replies: 11
      Last Post: 05-16-2008, 08:42 AM
    4. Hmm, anyone know why Java never loads?
      By Jdeadevil in forum Tech Talk
      Replies: 7
      Last Post: 07-29-2007, 03:16 PM
    5. Starting On Java
      By Lonestar in forum Tech Talk
      Replies: 6
      Last Post: 01-02-2007, 02:18 PM

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •