Bits and Electricity

In this activity, you will use Snap! to convert to binary and learn how data is stored in a computer.

Storing Numbers in Bits

: Bit

The word "bit" is an abbreviation for binary digit.

In a binary numeral, the digit in each place value is called a bit. So 1010 is a 4-bit number. Because there are fewer digits in binary (only 0 and 1) than in decimal (0-9), a number that's only a few digits long in decimal may be many bits long in binary.

  1. If your project isn't open already, log in to Snap! and open your "Numbers Bits Electricity" project.
  2. Drag the  binary of decimal () block into the main area. You can type decimal numbers directly into that block or you can even drag your previous calculations into the block.
    binary of decimal (300) reporting 100101100 binary of decimal (60 × 5) reporting 100101100
  3. Talk with Your Partner
    1. Can you find a number that's the same in decimal and binary?
    2. Can you get a result that's all 1s? Hint: Start by trying to get just one 1, then two 1s, etc.
    3. Can you get a result that's 11110000? You may need a calculator and/or a teacher to figure this one out.

Storing Bits as Electricity

Words and images are stored as numbers, and numbers are stored with bits (ones and zeros). You may be wondering what the ones and zeros look like inside the computer, but computers don't actually store the digits 0 and 1.

Computers store data using electricity. Generally, a 1 is stored as a charged electric signal and a 0 is stored as no charge. For example, the memory of your computer most likely stores bits by storing charge in a capacitor.

Capacitors store energy in an electric field (such as between two metal plates). Here are some capacitors of varying sizes:

Wikipedia claims image is in public domain: https://commons.wikimedia.org/wiki/File:Electronic-Component-Elec-Capacitors.jpg
three images of different-sized capacitors, which look like little cylinders with text and numbers on them and two wires coming out of one base

The bits inside your computer are tiny—around 20 nanometers, and a nanometer is so small that a billion of them (1,000,000,000) are in one meter! That's why computers are able to store so much information.

For the binary number 1010, we could imagine the computer storing it like this:
four drawings of capacitors with charges: +, none, +, none

The electric of binary () block will help you visualize how the computer stores any binary number.

  1. Drag the electric of binary block into the Scripts area, and experiment with it. You can type binary numbers directly into that block, or you can drag in a decimal to binary block. Try both ways.
    electric of binary (1010) reporting four drawings of capacitors with charges: +, none, +, none electric of binary (binary of decimal (10)) reporting four drawings of capacitors with charges: +, none, +, none
  2. Talk with Your Partner
    1. What numbers result in no capacitors charged at all?
    2. What numbers make all the capacitors light up with charge?
    3. What's a decimal numeral that charges every capacitor but one?
In this activity, you explored binary representation further and learned that binary data is stored as electric signals by capacitors in a computer.