Back to homeAP® Computer Science Principles · AP Computer Science Principles · Change subject
Start for free
AP CSP · AP® Computer Science Principles
Digital devices · Inside the computer

Information inside the computer

To a computer, a photo, a song and this text are all the same thing: long rows of zeros and ones. Here you will find out what bits and bytes are, and how the capacities you see on the box of a cell phone or a flash drive are measured. Mia wants to know how many photos fit on a 64 GB phone, and you will find out.

The bit: the smallest unit

Practice★☆☆Not started
True or false? Justify each answer: (a) a bit can only be $0$ or $1$; (b) a byte consists of $10$ bits; (c) computers work in binary because their circuits only…

True or false? Justify each answer: (a) a bit can only be $0$ or $1$; (b) a byte consists of $10$ bits; (c) computers work in binary because their circuits only distinguish two states; (d) using the standard classroom convention, $1\ \text{KB}$ are $1000$ bytes.

Solve
Practice★☆☆Not started
Explain in your own words why computers use the binary system instead of our ten digits. Use the idea of a light switch, which can only be off or on, and the millions of…

Explain in your own words why computers use the binary system instead of our ten digits. Use the idea of a light switch, which can only be off or on, and the millions of tiny switches inside a processor to help you.

Solve
Practice★☆☆Not started
A bit is like a light bulb that can only be off ($0$) or on ($1$). How many "light bulbs" are needed to form a byte? Draw eight light bulbs in your notebook representing…

A bit is like a light bulb that can only be off ($0$) or on ($1$). How many "light bulbs" are needed to form a byte? Draw eight light bulbs in your notebook representing the byte $01100001$ and explain what each one means.

You can do it on paper and send a photo with your answer.

Solve
Practice★★☆Not started
Explain why a computer does not directly store letters, colors or sounds, but zeros and ones: what the transistors in its circuits have in common with a light switch and…

Explain why a computer does not directly store letters, colors or sounds, but zeros and ones: what the transistors in its circuits have in common with a light switch and what advantage working with only two possible states offers.

Solve

The byte: a group of 8 bits

A single bit is too small to be useful, so computers group bits. With more bits you can represent numbers, characters and colors.

A byte shown as 8 squares with the bits 0110 0001, shown as two groups of four (top row and bottom row), which form the letter "a". 1 byte = 8 bits 0 1 1 0 0 0 0 1 8 bits = 1 byte (here, the letter "a")
Practice★☆☆Not started
Match each unit to its definition: (a) bit, (b) byte, (c) kilobyte, (d) gigabyte. Definitions: 1. group of $8$ bits; 2. the smallest unit of information, a $0$ or a $1$;…

Match each unit to its definition: (a) bit, (b) byte, (c) kilobyte, (d) gigabyte. Definitions: 1. group of $8$ bits; 2. the smallest unit of information, a $0$ or a $1$; 3. using the school convention, $1024$ megabytes; 4. using the school convention, $1024$ bytes.

Solve
Practice★☆☆Not started
The figure shows eight boxes that together form a byte: seven already have a value and the last one is covered with a question mark, as shown in the diagram. Which two…

The figure shows eight boxes that together form a byte: seven already have a value and the last one is covered with a question mark, as shown in the diagram.

1 0 2 1 3 1 4 0 5 0 6 1 7 0 8 ? 1 byte

Which two values could the covered box hide? How many bits make up a byte? Write a byte created by you with its eight digits and explain what each box represents.

Solve
Practice★☆☆Not started
In the code computers use for text, each letter takes up $1$ byte. Calculate how many bytes the word "HOLA" takes up and how many bits that is in total, and explain the…

In the code computers use for text, each letter takes up $1$ byte. Calculate how many bytes the word "HOLA" takes up and how many bits that is in total, and explain the calculation you made.

Solve

Place values and counting in binary

Each bit has a place value, just like the digits in a decimal number, but each place is worth double the one to its right. In a byte, from left to right, the values are $128, 64, 32, 16, 8, 4, 2, 1$. To read a binary number, add the place values where there is a $1$.

With $n$ bits you can make $2^n$ different values. For example, $4$ bits give $2^4 = 16$ values ($0$ to $15$), and $8$ bits give $256$ values ($0$ to $255$).

From bytes to gigabytes

Diagram of the scale of multiples of the byte showing that each step up, from byte to kilobyte, megabyte and gigabyte, multiplies by 1024. byte KB MB GB ×1024 ×1024 ×1024
Practice★☆☆Not started
Match each file to the most reasonable size: (a) a short text message, (b) a photo taken with a cell phone, (c) a song, (d) a movie. Sizes: 1. around $4\ \text{MB}$; 2.…

Match each file to the most reasonable size: (a) a short text message, (b) a photo taken with a cell phone, (c) a song, (d) a movie. Sizes: 1. around $4\ \text{MB}$; 2. more than $1\ \text{GB}$; 3. a few bytes; 4. around $8\ \text{MB}$. Explain which of the four you based on your own experience.

Solve
Practice★☆☆Not started
Order these units from smallest to largest: megabyte, bit, gigabyte, byte, terabyte, kilobyte. Then explain, using the school convention…

Order these units from smallest to largest: megabyte, bit, gigabyte, byte, terabyte, kilobyte. Then explain, using the school convention $1\ \text{KB} = 1024\ \text{bytes}$, the relationship between each unit and the next one in the list.

Solve
Practice★★☆Not started
The figure shows the ladder of information units: each step is climbed by multiplying, but the last step has lost its name, as shown in the diagram. Which unit is…

The figure shows the ladder of information units: each step is climbed by multiplying, but the last step has lost its name, as shown in the diagram.

bit byte KB MB GB ? ×8 ×1024 ×1024 ×1024 ×1024

Which unit is missing from the last step? Write the full chain of equivalences from the bit up to that unit using the school convention ($1\ \text{KB} = 1024\ \text{bytes}$ and the same when going up to each larger unit) and explain in your own words why the step from bit to byte is different from the others.

Solve
Practice★★☆Not started
A cell phone photo takes up $4\ \text{MB}$. Using the school convention ($1\ \text{GB} = 1024\ \text{MB}$), calculate how many photos fit into $1\ \text{GB}$ and how…

A cell phone photo takes up $4\ \text{MB}$. Using the school convention ($1\ \text{GB} = 1024\ \text{MB}$), calculate how many photos fit into $1\ \text{GB}$ and how many into $64\ \text{GB}$, and explain why in practice slightly fewer fit than calculated.

Solve
Practice★★★Not started
Mara's cell phone has a capacity of $64\ \text{GB}$. In the storage settings, it details: Operating system $12\ \text{GB}$, Apps $20\ \text{GB}$, Photo gallery…

Mara's cell phone has a capacity of $64\ \text{GB}$. In the storage settings, it details: Operating system $12\ \text{GB}$, Apps $20\ \text{GB}$, Photo gallery $28\ \text{GB}$, and Free space $4\ \text{GB}$. To install a critical update, the device requires having at least $10\ \text{GB}$ free. Mara states: "By deleting $150$ photos of about $7\ \text{MB}$ each, I will already have enough space by adding the $4\ \text{GB}$ of free space I have left."

  1. a) Numerically prove, using the school convention ($1\ \text{GB} = 1024\ \text{MB}$), why Mara's statement is incorrect and determine how many photos of that size she would actually need to delete to obtain the $6\ \text{GB}$ she is missing.
  2. b) Justify two alternative technical solutions that allow her to free up that space without having to delete any of her photos from the phone.
Solve

Back to the beginning: When you see a 64 GB flash drive, it means it can store about 64 billion bytes in SI units (with the school convention, $64 \times 1{,}024^3$ bytes, a little more): more than 500 billion bits stored as tiny zeros and ones in its chips!

Summary

See all the exercises in this section