Bits and numbers · A place to remember
Where does
a byte live?
So far, we have played with one byte. Now there are eight, each in its own numbered location. Choose a location and change what it holds.
The small number names the address.
The large number is the stored byte, shown in decimal.
Enable JavaScript to explore memory. All eight bytes start at zero.
Enable JavaScript to change this byte. This example shows 0.
Edits change only the selected location. Choosing another address reads its stored byte. “Clear all bits” sets only the selected byte to zero.
Where, and what.
An address tells us where to look. The contents tell us what is stored there. At address 3, we might find 0, 200, or any other byte value. Changing that value does not change the address.
Think of eight numbered boxes. Writing something new inside box 3 does not turn it into a different box.
Eight places, starting at zero.
The addresses are 0, 1, 2, 3, 4, 5, 6, and 7. There are eight locations, even though the last address is 7. Address 0 is the first location; address 3 is the fourth.
A byte at any of these addresses can hold a number from 0 to 255. The number of locations and the range of values stored in each are two different things.
A small memory.
This is RAM: random-access memory. We can read or write any location by choosing its address; we do not have to visit the earlier locations first.
Reading asks, “What is at this address?” Writing says, “Store this byte at this address.” A write replaces the previous contents of that location.
This explorer starts each byte at zero to make it easy to experiment. That is a choice for this lesson, not a promise about real RAM when power is first turned on. Starting again or reloading the page clears our little memory.