CPU Notes

CPU Operations

  • Fetch instruction: Reads instruction from memory.
  • Interpret instruction: Decodes instruction to determine required action.
  • Fetch data: Reads data from memory or I/O module if needed.
  • Process data: Performs arithmetic or logical operations on data.
  • Write data: Writes results to memory or I/O module.

CPU Components

  • Arithmetic and Logic Unit (ALU): Performs computation and data processing.
  • Control Unit (CU): Controls data/instruction movement and ALU operation.
  • Registers: Internal memory for temporary data storage.

Register Organization

  • User-visible registers: Optimize memory use by assembly language programmers.
  • Control and status registers: Control processor operation; used by OS.

User-Visible Registers

  • General purpose: Assigned variety of functions by programmer.
  • Data: Hold data; not for address calculation.
  • Address: For addressing modes (segment pointers, index registers, stack pointer).
  • Condition codes (flags): Bits set by processor hardware as result of operations.

Program Status Word (PSW)

  • Contains status information like sign, zero, carry, equal, overflow, interrupt enable/disable, supervisor mode.

Example Microprocessor Register Organizations

  • MC68000: 32-bit registers partitioned into data and address registers.
  • Intel 8086: Special-purpose registers, some usable as general purpose; segment registers.
  • Intel 80386: 32-bit registers with compatibility for 8086 programs.