Memory structure |
Primary memory will hold -
- The operating system
- Currently running programs
- Current files you are working on
Instructions and data are all stored in the same memory, intermingled. Data is stored in binary and split into bytes. Memory is divided into small containers, each a byte long, and data/instructions are stored into these containers. Some computers may have larger containers (4 bytes or even 8 bytes). Data is then located by using a memory address.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Address |
H | E | L | L | O | Data |
The above table shows how the word "HELLO" might be stored in memory. The address of this data starts at 0 and ends at 4. It uses 5 containers or simply 5 bytes. The start address of this word is 0 and it's end address is 5.
If a computer has 128Mb of memory then it will have a memory address range of 0 - 134,217,728.
128 x 1024 x 1024 = 134,217,728
A lot of computers have 2Gb or even 4GB. The memory range for 2Gb would be 0 - 2,147,483,648. 4Gb would be 0 - 4,294,967,296!
When we talk about addresses we are normally talking about where to find data in main memory.