Von Nemann Model
The Von Neumann architecture or Von Neumann model, is a theoretical computer architecture. It includes:
- π¨βπ¬ A processing unit (ALU)
- π€ A control unit (CU)
- π Registers (IR, PC, ...)
- π£οΈ I/O mechanisms
- ...
This page further extends general architectural notes with a few notes related to Von Nemann Model.
General Overview
Central Processing Unit (CPU)
The CPU is the combination of the ALU and the CU. When the CPU is contained on a single integrated circuit (IC) or chip, when often call it a "microprocessor." Some well-known CPU architectures are:
- x86/i386 - (AMD & Intel)
- x86-64/amd64 - (Microsoft & Sun)
- ARM - (Acorn RISC Machine)
Control Unit (CU)
The control unit reads the instructions, delegate the tasks to other components such as the ALU, while ensuring that all instructions are handled in the correct order, one by one.
Executing one instruction involves five functions:
-
Fetching: read
IP
/PC
and locate the instruction. UpdateIR
. -
Decoding: decode the instruction. Determine the data needed and the operations to be performed. Coordinate with ALU.
-
Read Register: read data from registers.
-
Execute: execute an operation (
opcode, r1, r2
) -
Write dest: write the result to the destination register
The CPU can write and read data from the RAM. For reference, for a file, a register will contain the file descriptor pointing to the RAM.
Arithmetical Logical Unit (ALU)
This unit is responsible for calculations and logical operations.
Instruction
An instruction includes a few elements such as:
- π The
opcode
determining which operation is executed - π€ The
operands
which are the registers used by the operation. It includes a destination registerRd
and often two others. - ποΈ It may include additional information for complex operations
Refer to your processor ISA for which opcodes/instructions are supported. ISA are classified in categories such as:
- CISC: many operations, some are rarely used
- RISC: only the more common operations
- See also: VLIW, EPIC, MISC, and OISC
Bus system
A communication system used by system components such as the CPU or I/O devices to transfer data between each other.
Computer Memory
Primary Memory
Primary memory is volatile, meaning that its contents are lost when the power is turned off. It includes the RAM and cache memory.
The Random Access Memory (RAM) is used to store data that is actively being used or processed by the CPU.
β‘οΈ See also: DRAM (SDRAM, EDO/BEDO DRAM, DDR SDRAM)
β‘οΈ See also: SRAM (Static Random Access Memory)
Secondary Memory
Secondary memory refers to storage devices that are used to store data for the long term. It includes hard disk drives (HDDs), solid-state drives (SSDs), CDs, DVDs, and USB drives.
π Electronic devices have the Read-Only Memory (ROM) that they use to store the firmware (see also: PROM, EPROM, EEPROM).
π Flash memory is a non-volatile memory that can be electrically erased and reprogrammed.
Registers
Registers are small, fast storage locations within the CPU itself.
Program Counter (PC)
The program counter (PC) or instruction pointer (IP) on Intel x86 is a register containing the address of the next instruction to execute.
It's sometimes called instruction address register (IAR).
Instruction Register (IR)
The instruction register (IR) is a register that contains the current instructions being decoded or executed.
Heap and Stack
The Stack memory is a LIFO data structure in the RAM containing:
- The return address of the executed function
- The function parameters of the executed function
- Frame pointers, if added during compilation
- Local variables
- Compiled code
The head of the stack address is stored in the stack pointer (SP).
π» To-do π»
Stuff that I found, but never read/used yet.
- Each app has its memory space and others can't access it