Computer Architecture and Organization: Dr. Khawar Khurshid Spring 20
Computer Architecture and Organization: Dr. Khawar Khurshid Spring 20
Organization
Operations
How many ops?
Which ops?
Data types
Addressing modes
What is an Instruction Set?
Addresses
Numbers
Logical Data
Instruction Representation
Data processing
Data movement
Program flow control
Number of Addresses
3 addresses
2 addresses
1 address
0 address
Number of Addresses
3 addresses
Operand 1, Operand 2, Result
c = a + b;
Not common
Needs very long instructions to hold
everything
Number of Addresses
2 addresses
One address doubles as operand and result
a=a+b
Reduces length of instruction
Requires some extra work
Temporary storage to hold some results
Number of Addresses
1 address
Implicit second address
Usually a register (accumulator)
Number of Addresses
0 (zero) addresses
All addresses implicit
Uses a stack
e.g. push a
push b
add
pop c
c=a+b
How Many Addresses
More addresses
More complex instructions
More registers
Fewer instructions per program
Fewer addresses
Less complex instructions
More instructions per program
Slower execution of program
Types of Operation
Data Transfer
Arithmetic
Logical
Transfer of Control
Types of Operations
• Data Transfer
• Arithmetic • Bitwise operations
• Logical • AND, OR, NOT
• Transfer of Control
• Shift left, right
Types of Operations
• Data Transfer
• Arithmetic
• Logical
• Transfer of Control
• Branch
— e.g. branch to x if
result is zero
• Skip
— e.g. increment and skip
if zero
• Subroutine call
Branch Instruction
Nested Procedure Calls
Use of Stack
Data Types
8 bit Byte
16 bit word
32 bit double word
64 bit quad word
Floating Point data
Addressing through 8 bit unit
Byte Order
Immediate
Direct
Indirect
Register
Register Indirect
Displacement
Stack
Immediate Addressing
Instruction
Opcode Operand
Direct Addressing
Instruction
Opcode Address A
Memory
Operand
Indirect Addressing
Pointer to operand
Operand
Register Addressing
No memory access
Very fast execution
Very limited address space
Multiple registers helps performance
Register Addressing
Instruction
Opcode Register Address R
Registers
Operand
Register Indirect Addressing
EA = (R)
Operand is in memory cell pointed to by
contents of register R
Large address space (2n)
One fewer memory access than indirect
addressing
Register Indirect Addressing
Instruction
Opcode Register Address R
Memory
Registers
EA = A + (R)
Address field hold two values
R = register that holds the base address
A = displacement
Displacement Addressing
Instruction
Opcode Register R Address A
Memory
Registers
Thank You