Decimal to binary and back
Results 1 to 10 of 10

Thread: Decimal to binary and back

  1. #1
    Senior Member
    Join Date
    Jun 2004
    Posts
    379

    Decimal to binary and back

    Decimal to Binary conversions

    Most people when they start learning about computers hear of binary and hex but never learn about them this tutorial will change that it will teach you a little bit about them and it will teach you how to convert them.

    *Before I say any thing about binary just remember that you read it backwards from right to left*

    First off all I hope every one know the decimal system 0-9 well if you donít this tutorial is not for you. Ok binary is a base 2 number system witch just means that it only has two numbers in it 0 and 1 un like hex witch has 16 but we will get into that much later. Binary is 8 bits or 8 1s and 0s the lowest number with hex you can represent is 0 and the highest number is 255 with the 8 bits.
    When you see binary it will look like this 00000001 this number is 1. How you would read it is by looking at the 1s only you donít look at the 0s the right most spot in the 8 digits is represented as 1 and then the next is 2 then 4 then 8 and so on so it will look like this
    Code:
    128 64 32 16 8  4  2  1
     0  0  0  0  0  0  0  0
    and now say you wanted to make the number 129 in binary what you would do is just make the 0s to 1s in the correct places by making the first one witch will represent 1 and the 8 1 witch is 128 and it makes 129
    Code:
    128 64 32 16 8  4  2  1
     1  0  0  0  0  0  0  1  this = 129.
    Now before I said that the biggest number you can represent with binary 8 bits was 255 right well numbers donít end at 255 so if you wanted to make a bigger number what you have to do is add more bits to it by adding 0s and 1s to the end of the number ( remember you read it right to left so the end of the number is the left side not the right) so what you would do is just add what you need now if you see the pattern in binary 1, 2, 4, 8, 16, 32, 64, 128 but if you needed a bigger number you just double 128 to 256 then 512, 1024, 2048. So now the new line up would be
    Code:
    2048 1024 512 256 128 64 32 16 8 4 2 1
      0    0   0   0   0   0  0  0 0 0 0 0
    then all you do is the same thing it is just you have bigger numbers. All you are doing is adding bits to the back of the list why you can do this is because back in the 80s the processors wear 8 bit so binary was limited to 8 bits but now most are 32 bit processors but the 8 bit standard stayed with binary but because we have 32 bit we can add numbers to the back of it this will come in to play in hexadecimal when you have more then 2 hex symbols.

    If you have any other questions or if you have trouble reading this PM me and I will help you out because I donít know how good I was at explaining it.

  2. #2
    Banned
    Join Date
    Sep 2004
    Posts
    305
    Mm... I like this tutorial a lot better than the longer and more complicated ones dealing with powers and etc (even though they mean the same thing in the end).

    Now I've known how to convert binary back and forth a while, would be able to explain how characters are converted back and forth? I know its getting the binary number to match the ASCII number but how does one go about differentiating whether the binary string is a number or a character... for example:

    01000001 would be 65 which is the equivalent to "A" in ASCII, but how would I know that that binary string is referring to the letter rather than the number 65?

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Posts
    379
    i will up date the tutorial in a day or 2 to explaining that ok cuz i need to find out how first ok and i will have a hexadecimal tut out soon so read that one 2 k.

  4. #4
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    Plz read before posting any thing thank you
    I could, quite reasonably say "read this" before posting a tutorial...... personal gripe.... Take it as you wish but when you start a tutorial in a "defensive" manner it taints the reamining text.

    Now, I might just be an old fart but wasn't base 10 to base 2 conversion dealt with in 7th grade, (12 years old), mathematics..... Has the education system declined so far that it requires a tutorial in 2004?

    Personal observations.......
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  5. #5
    Just my own observations (I'm in highschool), a good number of people (not me though) probably couldn't do something as simple as this. So, maybe in some sense, the education system has declined. More so, maybe less people are caring.
    --> MyWebsite <--

  6. #6
    Senior Member
    Join Date
    Apr 2004
    Posts
    1,024
    Binary isn't even touched in my high school till calc... You hit it in physics a little bit though.. Not enough to understand it though...

    Education has not declined, you just went to a really promienent school
    No... Actually it's that some things are considered more important... We can teach kids how to read in kindergarten now rather than 3rd grade, which is a HUGE improvement over the "olden" days... My sister is in 2nd grade and can read better than my mother did in 4th grade... My mom had never even been handed a book to read until 3rd grade... They had my sister reading very basic sentences and even writing small paragraphs in kindergarten... That's what I call progress... Now if we could just find a way to feed out all the kids who have no want to learn, and shove them in boot camp at kindergarten... You people would be AMAZED at the attitudes put out by 5 year olds... Society as a whole is on the decline... We get dumber every day...
    [H]ard|OCP <--Best hardware/gaming news out there--|
    pwned.nl <--Gamers will love this one --|
    Light a man a fire and you\'ll keep him warm for a day, Light a man ON fire and you\'ll keep him warm the rest of his life.

  7. #7
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    Grunt:

    I could read a year and a half before I went to school at 5 years old..... My parents taught me.... So it seems like what you are saying is that the parents suck.... Ok... I can understand that.... Can I "live" with it? No....

    It really isn't the job of school teachers to teach everything..... It's their job to apply "professional" techniques to teaching where parents aren't capable..... Anything else is parental abuse.....
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  8. #8
    () \/V |\| 3 |) |3\/ |\|3G47|\/3
    Join Date
    Sep 2002
    Posts
    744
    I think focusing on one base (base 10) is extremely short-sighted of any educational system. The ability to not have to think decimal-centrically is so important. Even outside of programming / networking...just being able to use your brain and equate decimal to binary, hex, etc....

    Come to think of it...many things taught in the public school systems in the U.S. are short-sighted. Thinking the only way to count is in base 10 is like thinking English is the only language out there....then finding the rest of the world speaks something else.

    Go Finland!
    Deviant Gallery

  9. #9
    Senior Member
    Join Date
    Jun 2004
    Posts
    379
    I think what mathgirl32 said is very true. in the united states the only thing you will learn are things you can use in the US foreign language classes are very poor and all most any one can get through the school with out ever picking up a book. O yea and one more thing Tiger Shark i live in us and base 10 to base 2 is not somthing you learn here a little of it if you take programing classes in my school but thats it and i dont think they teach it in the programing classes any more.

  10. #10
    Senior Member
    Join Date
    Apr 2004
    Posts
    1,024
    and all most any one can get through the school with out ever picking up a book.
    I wish... If you take any sorts of honors classes or anything you get LAID OUT with doing homework... You could barely graudate without doing crap, but not much else... School is still very much tough if you need it to be... Some of us still like to be prepared for life however, and preferably not in construction or fast food.
    [H]ard|OCP <--Best hardware/gaming news out there--|
    pwned.nl <--Gamers will love this one --|
    Light a man a fire and you\'ll keep him warm for a day, Light a man ON fire and you\'ll keep him warm the rest of his life.

Posting Permissions

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