Contents of Main Memory

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

  • Each byte of main memory has a unique address.   True
  • If main memory is 4 megabytes large, there will be 4 * 220 addresses.   True

Contents of Main Memory

memory array

 

Main memory (as all computer memory) stores bit patterns. That is, each memory location consists of eight bits, and each bit is either "0" or "1". For example, the picture shows the first few bytes of memory.

The only thing that can be stored at one memory location is eight bits, each with a value of "0" or "1". The bits at a memory location are called the contents of that location.

Sometimes people will say that each memory location holds an eight bit binary number. This is OK, as long as you remember that the "number" might be used to represent a character, or anything else.

Remember that what a particular pattern represents depends on its context (ie., how a program is using it.) You cannot look at an arbitrary bit pattern (such as those in the picture) and say what it represents.


 

QUESTION 8:

In the picture, what is the contents of:

  • Memory location 0?
  • Memory location 4?