• intel
  • The system bus (address, data and control busses collectively) is controlled by the processor
  • The sole purpose of the processor is to perform operations on data according to program instruction
    • These are fetched and stored in main memory
  • Program instructions and data are transmitted down the system bus in a size called a word
    • The word length is dependant on a number of factors but is expressed as the amount of binary data that can be transmitted to/from memory in a single operation
      • E.g. a 64-bit word length requires 64 parallel wires to transmit the data.
  • A typical microprocessor contains the following key components:
    • Arithmetic and logic unit (ALU)
    • Program control unit (aka control unit)
    • Registers
    • Internal clock
    • Internal buses
    • Logic gates
  • The internal clock is either derived from the system clock (by use of a multiplier) or independent.
  • The ALU is responsible for performing calculations to data such as subtraction, fixed-point and floating-point arithmetic. In addition, the logic part of the ALU deals with Boolean logic such as XOR, AND, etc.
  • Logic gates within the microprocessor control the flow of information around the circuits.
  • The program control unit manages the fetching, decoding and execution of instructions from memory.
    • Registers are very fast pots of tiny memory inside the processor (or I/O controller). They can either be dedicated to a specific purpose or, general purpose and used as the programmer wishes.
    • Registers
      • Registers are key to the efficiency of the microprocessor
        • They are extremely fast but tiny
          • A register’s size generally matches the bit architecture of the chip E.g. 64-bit
      • Two varieties:
        • Dedicated purpose
          • Most dedicated registers cannot be amended by the programmer
        • General purpose
          • Can be used by programmers to store data temporarily
          • Some computers may have up to 32 (or more) general purpose registers (R1…R32)
          • Microprocessors designers have assigned no specific role to these registers
        • Register addresses are totally separate to main memory addresses
        • Registers are useful because in CPU terms, using main memory to store temporary calculations is incredibly slow
        • There are special instructions which allow programmers to store and retrieve data from registers such as ADD, POP, PUSH etc.
      • Dedicated Registers
        • Index Register (IX) (very similar to a stack pointer)
          • Used when addressing memory
          • The contents of an index register is added to (in some cases subtracted from) an immediate address (one that is part of the instruction itself) to form the “effective” address of the actual data (operand)
        • Program counter (PC or IP)d
          • Points to the area of memory where the next instruction (op-code) can be found
          • This is the area of memory the address bus will latch on to
        • Status Register (SR)
          • Holds condition codes which show the outcome of an operation
          • E.g. if the result of subtracting a number results in a negative number, the SR can be flagged to indicate this
            • The programmer would then take the necessary action based on this
        • Accumulator (ACC)
          • Holds the current set of calculations
          • E.g. when you subtract the number 20 the processor will actually subtract 20 from whatever the number is in the accumulator
            • The result is then stored in the accumulator
        • Current instruction register (CIR or IR)
          • Holds the current instruction (op-code) which has been fetched from main memory while it is decoded and executed
        • Memory address register (MAR)
          • Holds the address of the memory location currently being accessed by the processor
        • Memory buffer register (MBR or MDR)
          • The MDR holds the current data item being transferred to/from by the microprocessor
          • This is the whole instruction (op-code and operand)
          • The operand might refer to another area of memory for the actual value, or be self contained
    • Clocks
      • Each computer has a quartz-controlled oscillator supplying a timing signal
        • The basic system clock
      • The microprocessor has a separate clock, often derived from the system clock
        • Multiplying circuitry increasing this to the desired speed
          • This is what you change when overclocking the processor
      • The system bus is also derived from the basic system clock, but often not as high as the processor
        • This synchronises the latching of data between components (RAM, I/O controllers, etc.)
      • Performance Considerations
        • A machine is measured in GOPS or MOPS
          • It was once MIPS but modern processors are too powerful for this to be a useful value
        • GOPS = 10^9^ whereas MOPS=10^6^ (Giga vs Mega)
        • Increasing the clock speed from 2GHz to 4GHz will, in theory double the speed of the program execution
          • If you assume an operation takes on clock cycle, doubling that, it will be completed in half the time
      • Multicore Vs Clock Increase
        • Increasing the clock rate increase heat
          • Heat generation has the effect of causing performance issues
          • To avoid increasing transistor density to uncontrollable limits, chip makers instead increase the number of cores
          • These cores generally operate at lower clock frequencies than single core chips (to overcome heating problems)
          • Multicore processors also bring benefits such as pipelining, true multi-tasking and threading