Von Neumann Architecture and Programs

Context: FIT1047_MOC, FIT2102_MOC · the blueprint of every modern computer + what a program actually is · concretised by MARIE (MARIE Assembly (Instruction Set and Patterns)) · executed by Fetch-Decode-Execute and RTL (Control) FIT2102 (W1): treated as a model of computation, not just hardware — it shares with the Turing Machine an imperative, instruction-following paradigm, and the lambda calculus is the alternative the unit builds toward. Language-design consequences in Levels of Abstraction (Machine to High-Level); paradigm contrast in Programming Paradigms.

Quick Revision

  • 🎯 Objective: Von Neumann = CPU (ALU + registers + control) + memory + I/O, with memory holding both data AND program code.
  • 📦 Core Components: machine code ➔ ISA ➔ assembly (mnemonics) ➔ compilers/interpreters bridge to high-level languages.
  • ⚡ Key Constraint: “stored program” is THE idea — instructions live in the same addressed memory as data, moved over a bus.

📝 Core

1. The Architecture

  • CPU ➔ ALU (arithmetic + Boolean ops) · registers (fast temporary storage, data movement) · control unit (switches every component per instruction).
  • Memory ➔ stores data and program code; a sequence of addressed “boxes” (), each holding one word; CPU reads/writes via a bus.
  • I/O ➔ everything else attached: keyboard, screen, disk, sensors, USB…
  • MARIEMachine Architecture that is Really Intuitive and Easy — simulator with all components; 16-bit data words, 12-bit address bus, 16-bit data bus.

2. Programs: Machine Code up to Python

  • CPUs execute ONLY machine code ➔ sequences of instructions, stored in memory, one-or-more words each; architecture-specific (phone ≠ laptop code).
  • ISA ➔ the instruction set a CPU type understands: maths ops, data movement (memory↔registers↔I/O), conditionals/jumps.
  • Assembly language ➔ one mnemonic per machine instruction (Load, Add, Store, Jump); the assembler translates 1-to-1 to machine code — readable machine code, nothing more.
  • Compiler ➔ translates high-level → lower-level (C/C++ → machine code; Java → bytecode for an interpreter).
  • Interpreter ➔ a machine-code program that executes high-level code directly (Python) — some languages use both stages.

⚖️ Core Decision Matrix

LayerExampleExecuted byPortable?
high-levelPython / Java / C++via interpreter / compileryes
assemblyLoad 0xA003, R0assembler → machine codeno (per-ISA)
machine code0001000110001110CPU directlyno (per-ISA)

⚠️ Common Mistakes

  • 💡 Assembly ≠ high-level ➔ 1-to-1 with machine instructions; a compiler does real translation, an assembler only renames.
  • 💡 Data vs code is a convention ➔ the same 16-bit word in memory is an instruction OR a number depending on how execution reaches it — the stored-program idea’s double edge.

🧠 Active Recall