Friday, January 25, 2013

Binary Counting

Ok. Let's start with counting to 8 in Binary. The best way to think about this is an old school odometer then spun till 9 and then went back to 0 and started counting over while moving the tens column to 1. Once you lock down this example it is very simple to understand except that we only have 0's and 1's so they turn over at a much faster rate.

0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8

8 Bits = 1 Byte = 1001 1010
1024 Bytes = 1 Kilobyte
1024 Kilobyte = 1 Megabyte
For fun....1 Terabyte =  ~1,100,000,000,000 Bytes

Learning for the day!

2 comments:

  1. Something extra:

    Each number in a binary sequence corresponds to x^2, where x is the position (from the right) of the number.

    More simply: if you want to convert a number from binary to decimal, add like so:

    64 32 16 8 4 2 1

    For any 1 in those positions, it corresponds to that number.

    Say you had:

    1 0 0 1 1 0 1

    Line it up:

    1 0 0 1 1 0 1
    64 32 16 8 4 2 1

    Where are the ones?
    64, 8, 4, and 1.
    Add them up: 77

    Therefore, 1001101 is binary for 77.

    ReplyDelete
  2. Well stated Mike! Thanks for the advice. I read about that as well in the PDF "How to count". It definitely makes it easier once you know at least the first 10 in 2^n to count quickly using binary. I have a new challenge that I solved that will make you happy. Polish notation calculator. That one was a doozy ;-).

    ReplyDelete