Skip to content

Lab · Computer science

Find the drawer. Then the slot.

A computer needs a way to find the value it stored. See how one address can identify a group of cells and a place inside that group.

Explore all labs
Pilot · Computer science

How an address finds a stored value

Start with drawers and slots. Then read the computer’s two-part address.

Start with a question

How do you find one value among many stored values?

A computer needs to know where to look when a program asks for a stored value. We’ll use a small drawer-and-slot model to make that address readable.

Before you start: You only need counting and simple addition. We introduce binary below. The rotating arm is a teaching analogy; real memory uses electronic circuits.

Your goal: Read an address in two parts: choose the bank first, then the cell inside it.

  1. Think of drawers with numbered slots

    Each drawer is a bank: a group of storage places. Each slot is a cell: one place holding a value. This model has four banks, with eight cells in each. An address identifies both the bank and the cell.

  2. Read the bank part first

    The computer writes the address using bits: digits that are either 0 or 1. The first two bits name the bank: 00, 01, 10 or 11. Their positions have values 2 and 1, so these codes mean banks 0, 1, 2 and 3. The remaining three bits name a cell inside it. The space in 10 001 shows the split; it is not an extra bit.

  3. Turn binary digits into a slot number

    For three bits, the positions have values 4, 2 and 1, from left to right. Add the values whose digits are 1. So 001 means 1, 011 means 2 + 1 = 3, and 110 means 4 + 2 = 6. The eight slots are numbered 0 to 7; 000 is slot 0.

Words you’ll see

Address
The location to read. Here it contains a bank code followed by a cell code.
Bank and cell
A bank is a group of storage places. A cell is one storage place inside that group.
Selector
The model’s rotating arm connects one bank at a time. The cell bits choose a place inside that bank; they do not turn the arm.

Read 10 001 together

  1. The first two bits are 10. Choose the bank engraved 10 (bank 2 in ordinary numbers).
  2. The last three bits are 001. Only the 1-place is switched on; the 4- and 2-places are off. Choose cell 1 in that bank.
  3. The selector connects the bank; the cell code picks its slot. Cell 1 in bank 10 holds the letter “O”.

Now use Step on the model. Watch whether the first two bits change. A new cell inside the same bank does not require a turn.

Addressnone yet

Read—

Step 1 of 7

Reduced motion is on. Use Step to inspect one still position at a time.

What’s happening

Step 1 of 7

Four banks, one selector.

A 5-bit address is split in two. The first 2 bits choose a bank; the last 3 bits choose one of its 8 cells. The selector arm connects one bank at a time. It starts on bank 00.

A free lesson. The rotating selector is a teaching analogy; real computer memory uses electronic circuits.