Understanding Program Execution and Memory

In this class, We discuss Understanding Program Execution and Memory.

The reader can take our complete computer science courses. Click Here.

The below diagram shows a program example and memory.

The program starts execution from the main method.

In our example, the main method contains ten lines of code.

The execution of the program is done line by line.

The program’s first line will execute, then the second line, and so on.

During the execution of the code, if the processor needs any data, it will get the data from the random access memory.

Example:

The line of code c = a+b

To add a and b, the data present in RAM.

The processor will get the data of a and b from memory and do addition in the processor, and save the result in memory.

Understanding basic RAM organization:

The random access memory contains lines.

Each line contains 8 bits of memory.

The line numbers are numbered from zero.

The line numbers are called the address of the line.

This basic RAM organization is used in this course to understand java programming.