1.4. Computer Architecture

The computer is in a sense a communication system. Data is constantly being moved between the CPU, memory and the various devices. The CPU uses I/O addresses to direct data to particular devices. The devices in turn use interrupts to notify the CPU and operating system of their needs.


1.4.1. The von Neumann Architecture


1.4.2. The CPU Control Unit


1.4.3. The Arithmetic Logic Unit (ALU)


1.4.4. The von Neumann Loop

Fetch Phase

Fetch the next instruction and store it in the instruction register

Execute Phase

The ALU or I/O unit executes the instruction

  • ALU does calculations
  • I/O unit loads or stores data between main memory and registers
PC = <machine start address>;
IR = memory[PC];
haltFlag = CLEAR;
while(haltFlag not SET) {
    PC = PC + sizeof(INSTRUCT);
    IR = memory[PC]; // fetch phase