Binary Representation

  1. Watch this video from code.org:

Here's a collection of powers of two:

1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
  1. Find three different powers of two that add up to 21.
  2. Can you find any other ways to get 21 adding different powers of two?
  3. Find some different powers of two that add up to 66.
  4. Can you find any other ways to get 66?
  5. Find some different powers of two that add up to 15.
  6. Are there any whole numbers (positive integers) that aren't a sum of different powers of two?

In decimal notation, each place value represents a power of ten: the units place (100 = 1), the tens place (101 = 10), the hundreds place (102 = 100), the thousands place (103 = 1000), etc. So, for example:

The symbol "XVIII" in Roman numerals represents the same number as the decimal representation "18." In binary, we write "10010" for "18," but it's still the same number. So there's no such thing as a "binary number," just binary representation.

9827   =   9 × 103  +  8 × 102  +  2 × 101  +  7 × 100

Binary uses the same idea but with powers of two instead of powers of ten. So, for example:

10010 (in binary)   =   1 × 24  +  0 × 23  +  0 × 22  +  1 × 21  +  0 × 20   =   16  +  2   =   18 (in decimal)


Decimal notation is called base ten. It's the usual way of representing numbers with the digits "0"–"9." Binary is base two. It only uses two digits: "0" and "1."

In both systems, place value always starts from the units place and goes up right to left (just as you learned in elementary school):

base ten:
0 9 8 2 7
(higher places) ... ten-thousands place thousands place hundreds place tens place units place

right-to-left arrow

base two:
1 0 0 0 1 0 0 1
(higher places) ... 128s place 64s place 32s place sixteens place eights place fours place twos place units place

Computers store information in binary using bits and bytes. A bit is a "0" or "1". A byte is eight bits grouped together like "10001001", which is binary for the number "137".

  1. Represent these bytes in decimal notation:
    1. 10000111
    2. 00100000
    3. 00011111
  2. Represent these decimal numerals in binary notation:
    1. 27
    2. 28
    3. 239
 
  1. Talk with Your Partner What's the rightmost digit in the binary representation of 15551212?
  2. What's the rightmost bit ("binary digit") of 123456789?
  3. What numbers can be represented in a single bit?
  4. What numbers can be represented in a single byte?
  5. What numbers can be represented in a kilobyte?