Architecture of CPU

Cards (17)

  • How does CPU carry out instructions?
    Fetch - Execute Cycle
  • Fetch Instructions
    Copy memory address from program counter to MAR
    Copy the instruction stored in the MAR address to the MDR
    Increase the program counter to point to the address of the next instruction, ready for the next cycle
  • Decode Instruction
    The instruction in the MDR is decoded by the CU
    The CU may then prepare for the next step
  • Execute Instruction
    The instruction is performed - (e.g. load data from memory, write data to memory, do a calculation, change the address in the PC or halt the program)
  • Common CPU components
    Control Unit
    Arithmetic Logic Unit (ALU)
    Cache
    Registers
  • Control Unit
    Main job is to manage fetching, decoding and execution of program instructions by following the ‘fetch-execute cycle’
    It controls the flow of data inside CPU (registers, ALU, cache etc.) and outside CPU (main memory and input/output device)
  • Arithmetic Logic Unit (ALU)

    does all the calculations
    completes simple addition and subtraction
    compares size of numbers and can do multiplications and divisions using repeated addition and subtraction
    performs logic operations such as AND, OR and NOT and binary shifts
    contains accumulator register
  • The Cache
    Very fast memory in CPU (slower than registers but faster than RAM)
    Stores regularly used data so CPU can access it quickly
    (when CPU requests data, cache is checked first, if not it will be fetched from RAM)
    Caches have low capacity and is expensive compared to RAM/secondary storage
  • Different Levels of Cache
    L1 (quickest but lowest capacity)
    L2 (slower than L1 but can hold more)
    L3 (slower than L2 but can hold more)
  • Registers
    temporarily hold small amounts of data needed by the CPU
    they are very quick to read/write (quickest memory)
  • Von Neumann’s Design
    main features of the design is that it only uses one memory for both data and instructions
  • Components in Von Neumann's Design
    Program Counter (PC)
    Accumulator
    Memory
    Memory Data Register (MDR)
    Memory Address Register (MAR)
  • Program Counter (PC)

    holds the memory address of the instruction for each cycle
  • Accumulator
    stores intermediate results of calculations in the ALU
  • Memory
    holds the program instructions and the program data
  • Memory Data Register (MDR)

    Holds the actual data or instruction
    This may be fetched from Memory or be waiting to be written to Memory
  • Memory Address Register (MAR)

    Holds any memory address about to be used by the CPU
    The address might point to data or a CPU instruction