You are on page 1of 6

Computing Fundamentals

How Instructions are Executed


Week 4 Instructor: Shehzad Aslam
CPU & Parts
 Registers
 Stores data / results being processed
 PC, IR, MAR, A, B, C, D
 Arithmetic Logic Unit (ALU)
 Perform calculations
 Control Unit (CU)
 Monitor the overall machine
The Instructions
 Manual Provided by Manufacturer
 Generally Instructions have two parts
 Op code: tells what to do
 Operands: tell data or address or register
 Opcodes are defined by vendor
 ADD, SUB, STORE, LOAD etc

Opcode Decimal form Binary form


ADD 1 0001
SUB 2 0010
STORE 3 0011
.. .. ..
Machine Cycle
 Fetch
 Instruction is fetched from memory
 Decode
 Determined what to do
 Execute
 Performed the actions and results are
stored back
Instruction format
Load(1) Register Data Data
Example Add (5) Register Register Register
Reading

 Chapter 2.1 – 2.3 from Computer Science an Overview

You might also like