Java Reference
In-Depth Information
Table 5.2 Simple program to sum two numbers
Address
Content
Description
Loads into register A the content of the cell with address 5
0:
LOADA 5
Loads into register B the content of the cell with address 6
1:
LOADB 6
Sums registers A and B, the result goes into register A
2:
ADD
Stores content of register A in the cell with address 7
3:
STOREA 7
Stops the execution
4:
HALT
Cell containing the first number to sum
5:
123
Cell containing the second number to sum
6:
432
Cell that will contain the result of the sum
7:
0
Table 5.2 presents a simple program and its position in memory. The
program sums two integer numbers.
5.2
Problem analysis
The system that must be described and simulated is a computer. The
computer is made up of dynamic components that interact with each other
through the bus.
The CPU is the master of the system: it executes the instructions defined
in the assembler-like program and coordinates the functioning of all the
other components. The RAM component represents the temporary memory
which persists only while the computer is in operation. The I
O device is
made up of two components: the keyboard takes input data from the user;
the display shows output data to the user. The storage device can be identi-
fied with the hard disk: it holds information even when the computer is not
in operation.
CPU
RAM
Address
Control
Data
I/O
Storage
Figure 5.2 Detailed Von Neumann architecture
 
Search WWH ::




Custom Search