Binary

Collapse

Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kamui
    Imperial Advisor

    Binary

    Anybody good at Binary Language?We started learning this today and this kinda has me confused.....,so I figure maybe theres a tech head here that can give me an idea how to convert it into a number since I got kinda confused with it earlier.I'm going to read the book later,but anyhelp is appreciated.
    <a href="http://s11.photobucket.com/user/dsaBOSS/media/mui_sig_zpsdfb059b2.png.html" target="_blank"><img src="http://i11.photobucket.com/albums/a178/dsaBOSS/mui_sig_zpsdfb059b2.png" border="0" alt=" photo mui_sig_zpsdfb059b2.png"/></a><a href="http://psnprofiles.com/XxkamuixX1"><img src="http://card.psnprofiles.com/1/XxkamuixX1.png" border="0"></a>
  • #2
    EagleOne
    Honorary DSA

    brain teaser 10011101011001101011110010010100011101100101010011 101

    Work on that Mui


    Comment

    • #3
      RaTix
      Emperor

      Well what part of it has you confused?

      Binary is just 1s and 0s right?

      Not really, for computers to register a 1 or a 0 it needs a separately distinct signal for each. In other words, it is not as simple as: "the presence of a signal represents a 1 and the lack of a signal represents a 0". Instead, the way binary works is by registering a high signal for 1s and a low signal for 0s.
      Bits and Bytes

      A bit is a single binary digit. This is a useless amount of information but when you group them together and have 8 bits, this makes one byte. A single byte can have up to 256 different combinations of 1s and 0s. Typically information is broken up into bytes to be stored, calculated, or transmitted.
      Binary Counting

      The way we are all used to counting is by using the numbers 0 through 9. Then when we start all over again, we put a 1 for the first digit and increment the second digit from 0 to 9 again. The same goes for binary, except that we can only use the numbers 0 through 1. Check out the counting below:

      Decimal Binary
      0 0
      1 1
      2 10
      3 11
      4 100
      5 101
      6 110
      7 111
      8 1000
      9 1001

      Ok so I know this is looking pretty weird by now but you can probably see the pattern and can guess what the next number is in binary. The Decimal equivalent of 10 (ten) is 1010 (the fact that there is 2 tens in a row is a coincidence).

      CLUE: If you make each of your fingers represent a binary digit, you can count to ten with just 4 fingers. In the paragraph above the number ten is represented in binary as 1010, so hold your right hand up showing four fingers, then drop your middle finger and your pinkie, that is ten in binary. How high can you count with all ten fingers? Find the answer at the end of this article.
      Converting to and from binary

      But there has to be a better way to convert decimal numbers to and from binary. With the table above we only counted to 9 in decimal and it is already quite large. The solution to that problem is pretty easy with a few observations. Look back at the example. The number 1 is the same in both columns. Then look at number 2, in the binary column it is a 1 followed by a zero, then look at 4 and 8, these are also a 1 followed by zeros. The same goes for 16, 32, and so forth. And the relationship between, 1, 2, 4, 8, and 16 is they are all powers of 2. (2 to the power of zero is 1 - in case if you were wondering).

      Clue: The decimal equivalent to each binary digit is by powers of 2. (Example: The third binary digit's decimal equivalent is 2 to the 3rd power. The fourth binary digit's equivalent value is 2 to the 4th power, and so on.)
      Conversion in action
      Converting to binary

      First you must create a line listing the powers of two to just beyond the number you want to convert. In other words, if you want to convert 237 to binary, list all the powers of two until you reach 256. This will ensure you have all the binary bits available to you. Check out the example:

      256 128 64 32 16 8 4 2 1

      Now flag each digit needed to add up to 237 starting from the left. So we would not flag 256 since that is too big, the first power of two we will flag is 128. Then 64 and 32. So far this adds up to 224.

      256 128 64 32 16 8 4 2 1
      -----------------------------------------
      1 1 1

      Remember we need to flag the binary digits that add up to 237. We only have 224 so let's keep going. We cannot flag 16 because that will put us over 237. The next digit to flag is 8, we skip 4 (too large), and flag the 2 and 1. So our flagging should look like this:

      256 128 64 32 16 8 4 2 1
      -----------------------------------------
      1 1 1 1 1 1

      Notice I flagged each digit I needed with a 1. By now I am sure you have figured out that the digits I do not need will be flagged with a 0. See below:

      256 128 64 32 16 8 4 2 1
      -----------------------------------------
      0 1 1 1 0 1 1 0 1

      Now just as with our normal counting, we do not have any number prefixed with a zero. In other words if I was to display the digits for nine hundred fifty seven I would not write 0957. It would only be the digits that are significant, 957. So that is it, the binary version of 237 is: 11101011.

      Clue: Just as with decimal numbers, the largest most significant number is on the left and the digit on the right is the least significant.
      Converting from Binary

      Now that we know the decimal value of each binary digit, converting back to decimal is a piece of cake. This time we will convert the binary number 1101011001 to decimal.

      First write out your decimal equivalents for each binary digit. Since this binary number 1101011001 is made up of 10 bits we need to write out the first 10 powers of two (starting from right to left):

      512 256 128 64 32 16 8 4 2 1

      Then write your binary number under the values.

      512 256 128 64 32 16 8 4 2 1
      ------------------------------------
      1 1 0 1 0 1 1 0 0 1

      Finally add up each binary value that is flagged with a 1.

      512
      256
      64
      16
      8
      + 1
      ___
      857
      Now when it comes to letters and converting to and from binary, ASCII comes into play.
      Ascii character table - What is ascii - Complete tables including hex, octal, html, decimal conversions
      "POWER!!! UNLIMITED POOWWWEEEER!!!!!!

      "Tell me what you regard as your greatest strength, so I will know how best to undermine you; tell me of your greatest fear, so I will know which I must force you to face; tell me what you cherish most, so I will know what to take from you; and tell me what you crave, so that I might deny you."
      ?Darth Plagueis

      "Peace is a lie, there is only passion. Through passion, I gain strength. Through strength, I gain power. Through power, I gain victory. Through victory, my chains are broken. The Force shall free me."

      Comment

      • #4
        keyser28146
        Honorary DSA

        In case that was hard, here's a step by step for you.


        Look. You go 0 - 9 because we have ten digits. When you go from 9 to TEN you run out of symbols. If you are using HExadecimal, you use A for TEN, B for eleven, up to F for 15. Eventually, you run out of single digits, so you have to go to two digits, then three digits, etc etc etc.

        In base10 you have the number 2008 like this:


        THOUSANDS PLACE (0-9) HUNDREDS PLACE (0-9) TENS PLACE (0-9) ONES PLACE (0-9)
        2 0 0 8

        Since Binary only has two place holders, you don't have a thousands place, hundreds place, tens place, etc... You have this:

        Ones PLACE (0 or 1)

        If it's 0 the number is 0, if 1 then it is 1, but then you have to already go to the next digit to even get to the number 2... there are NO OTHER SYMBOLS to use.

        Twos place (0 or 1) Ones place (0 or 1)
        1 0

        If you want 3 then you go up to

        1 1

        but now you've used both ones... the next number is FOUR, so you have to add a place for your four.

        Fours place (0 or 1) twos place(0 or 1) ones place (0 or 1)
        1 0 0

        If you want a 5 you have to add a one to the four, so you get...

        1 0 1

        For a six you have to add a 4 + 2, but no one.

        1 1 0

        For a seven, you have to add 4 + 2 + 1...

        1 1 1

        Ok, but you can't go to 8... without going to 4 digits... so here we go...


        8's place (0 or 1) 4's place (0 or 1) 2's place(0 or 1) 1's place (0 or 1)

        1 0 0 0

        nine (8 +1)

        1 0 0 1

        ten (8 + 2)

        1 0 1 0


        Eleven (8 + 2 + 1)

        1 0 1 1

        Twelve (8+4)

        1 1 0 0

        Thirteen (8 + 4 + 1)

        1 1 0 1

        Fourteen (8 + 4 + 2)

        1 1 1 0

        Fifteen (8 + 4 + 2 + 1)

        1 1 1 1

        Note that once EVERY digit is used, you need to add a new placeholder digit... to get 16 you need 10000 in binary... 31 is 11111 and to get to 32 you need the new digit: 100000.... 63 is 111111 you have to add a digit to get 64: 1000000... Just like you add a digit to go from 9 to 10, 99 to 100, 999 to 1000 etc.


        ***WARNING***WARNING***WARNING***WARNING***WARNING ***WARNING

        Now if you are doing this as part of a data cirriculum, you can NOT cram... you need to understand this concept on a fundamental level... if you don't, when you get to subnets and subnet masking and ANDing processes you will be in deep deep trouble, to say nothing of hexadecimal. If you understand the concept of "carrying the zero" to the next place NOW, you'll have no trouble when the teacher explains that 10 in hex is 16, or that 15 in hex is 21, or 32 in Hex is the decimal number 50. Wait until you get into legal subnets and busting those up.
        sigpic

        Comment

        • #5
          LvDevilsFan
          Honorary DSA

          my brain just exploded trying to understand that info... where's c3po when you fucking need him.
          <img src=http://i2.photobucket.com/albums/y11/CaDevilsFan/Banner.bmp>

          Comment

          • #6
            R2D2
            Civilian
            • Mar 2006
            • 381

            Originally posted by LvDevilsFan
            my brain just exploded trying to understand that info... where's c3po when you fucking need him.
            Dude, why is it always C3P0, why doesn't any one ever remember me?

            Comment

            • #7
              Reaver
              Imperial Advisor

              Because R2D2 had a wiring Mal-function getting shot at and only understands special people and ewoks.
              " I need a beer "

              Comment

              • #8
                captnjeter
                Honorary DSA

                I'll use R2 when I'm flying around in my X-Wing, thank you.


                Mui, I took into to Comp Sci last year and this confused me at first. But like others have said, it's very simple once you break it down. Instead of having ten digits/numbers (base ten), you use two (binary). Just say to yourself that you can't do anything other than put a 0 or a 1 in a numerical place.

                The other thing you need to know is that when you advance to a higher numerical place, like when you go from tens to hundreds, to get to the next place you multiply by ten. In Binary, when you advance to a higher numerical place, you multipy by two. If you remember how you did 2^8 (the 8th power of 2) in high school, then remembering the correct numbers for all the numerical places in Binary should be easy. You have 1, 2, 4, 8, 16, 36, etc.


                The way I solved problems to conver Binary into Base 10 is exactly like how Ratix posted it. Count out the number of numerical places, if you have a value in that place, write the base 10 form of that number down, do it for the rest of the numbers and add up.

                If you need to go from Base 10 to binary, I always started out with doing the highest numerical placement first (say you had to write 73). I'd put one in the "64" place, one in the "8" place and one in the "1" place giving me 1001001.
                "You gotta have fun. Regardless of how you look at it, we're playing a game. It's a business, it's our job, but I don't think you can do well unless you're having fun." - Derek Jeter

                Comment

                • #9
                  Kamui
                  Imperial Advisor

                  Originally posted by LvDevilsFan
                  my brain just exploded trying to understand that info... where's c3po when you fucking need him.
                  Or Spock for the matter and I have never seen Star Trek and i'm referencing him.

                  Thanks guys i'll read more into Chapter 2 of my book which goes into binaries.Makes alot more sense now that i've read the replies and my only trouble was converting the simple binaries.
                  <a href="http://s11.photobucket.com/user/dsaBOSS/media/mui_sig_zpsdfb059b2.png.html" target="_blank"><img src="http://i11.photobucket.com/albums/a178/dsaBOSS/mui_sig_zpsdfb059b2.png" border="0" alt=" photo mui_sig_zpsdfb059b2.png"/></a><a href="http://psnprofiles.com/XxkamuixX1"><img src="http://card.psnprofiles.com/1/XxkamuixX1.png" border="0"></a>

                  Comment

                  • #10
                    captnjeter
                    Honorary DSA

                    Originally posted by Kamui
                    Or Spock for the matter and I have never seen Star Trek and i'm referencing him.
                    I thought you were talking about our Spock for a moment...


                    Speaking of which, where is he?
                    "You gotta have fun. Regardless of how you look at it, we're playing a game. It's a business, it's our job, but I don't think you can do well unless you're having fun." - Derek Jeter

                    Comment

                    Ad

                    Collapse
                    Working...