Important Concepts Parts of the CPU Arithmetic/Logic Unit Control Unit Registers Program Counter Instruction Register Fetch/Decode/Execute Cycle Machine Language Stored-Program Concept Bus Direct Memory Access
Types of Instructions Transfer Operations Load Store Arithmetic/Logic Operations Addition, Subtraction, Multiplication,... AND, OR, NOT, XOR Shift, Rotate Control Operations Unconditional Jump Conditional Jump (Jump if Register > 0) Halt
Additional Types of Instructions Input/Output Instructions Direct Memory Access Instructions Graphics Operations
Reduced Instruction Set Computer Minimal set of instructions Complex operations are divided into simple steps Simple steps are encoded as the instructions Macro-instructions are small programs, called microcode Instructions execute very quickly Faster cycle, but requires more operations Chips require less power consumption
Complex Instruction Set Computer Complex instructions Require more time to execute, but do more More, specialized, operations Can include memory, graphic operations Instructions slower to execute, but do more
Stored Program Concept Program can be treated as data Program can be changed in memory, read/written to storage Allows computer to be flexible Different kinds of programs: Machine code Assembly Language High-level Language Logic Programming Programs can be translated from one from to another
Machine Instructions Instructions are encoded as binary strings, e.g., Instructions have op-codes and operands Operands are the data (or where to find the data) Op-code specifies the operation that is done to the data Instructions may be fixed or variable length
Fetch/Decode/Execute Cycle The program counter keeps track of the next instruction to be executed The next instruction is fetched and place into the instruction register The control unit decodes the instructions – interprets the op-code, finds the operands The instruction is executed – the control unit causes the ALU to do the proper operation based on the op-code A Jump instruction may change the program counter