0% found this document useful (0 votes)
45 views

Instruction Types

The document discusses topics related to computer organization and architecture, including instruction types, memory reference instructions, register reference instructions, and I/O reference instructions. It provides examples of instruction formats and the elements that make up instructions, such as operation codes, source operands, and result operands. It also discusses the completeness of an instruction set and how instructions are used to perform operations on memory, registers, and for input/output. Homework questions and answers are provided at the end regarding addition instructions and the phases of instruction execution.

Uploaded by

Shubham Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Instruction Types

The document discusses topics related to computer organization and architecture, including instruction types, memory reference instructions, register reference instructions, and I/O reference instructions. It provides examples of instruction formats and the elements that make up instructions, such as operation codes, source operands, and result operands. It also discusses the completeness of an instruction set and how instructions are used to perform operations on memory, registers, and for input/output. Homework questions and answers are provided at the end regarding addition instructions and the phases of instruction execution.

Uploaded by

Shubham Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

University Institute of

Engineering
DEPARTMENT OF COMPUTER
SCIENCE & ENGINEERING
Bachelor of Engineering (Computer Science
& Engineering)
Subject Name: Computer Organization &
Architecture
Subject Code: CST-252/ITT-252

DISCOVER . LEARN .
INSTRUCTION TYPES EMPOWER
CHAPTER 2: INSTRUCTION SET ARCHITECTURES

Topics Covered
•Instruction types
•Memory Reference instructions
•Register Reference instructions
•I/O Reference instructions

2
LECTURE 2.3
INSTRUCTION TYPES

• Data transfer Instructions : 


 MOV, LOAD     
• Arithmetic Instructions :
ADD, SUB, DIV, MUL       
• Logical Instructions : 
AND, OR, NOT, SHIFT, ROTATE   
• Input Output Instruction : 
Memory-mapped I/O (MMIO) and port I/O
• Program-control Instructions:  
Unconditional branch Subroutine call
Interrupt-handling Conditional branch

3
 
WHAT IS INSTRUCTION SET?

The complete collection of instructions that are understood by a


CPU
• Machine Code
• Binary
• Usually represented by assembly codes

4
ELEMENTS OF INSTRUCTION

• Operation code (opcode)


– Do this: ADD, SUB, MPY, DIV, LOAD, STOR
• Source operand reference
– To this: (address of) argument of op, e.g. register,
memory location
• Result operand reference
– Put the result here (as above)
• Next instruction reference (often implicit)
– When you have done that, do this: BR

  5
EXAMPLE: SIMPLE INSTRUCTION FORMAT
(USING TWO ADDRESSES))

6
INSTRUCTION SET COMPLETENESS
• A set of instructions is said to be complete if the computer includes a sufficient
number of instructions in each of the following categories:
• Arithmetic, logical and shift instructions
• A set of instructions for moving information to and from memory and processor
registers.
• Instructions which controls the program together with instructions that check
status conditions.
• Input and Output instructions
• Arithmetic, logic and shift instructions provide computational capabilities for
processing the type of data the user may wish to employ.
• A huge amount of binary information is stored in the memory unit, but all
computations are done in processor registers. Therefore, one must possess the
capability of moving information between these two units.
• Program control instructions such as branch instructions are used change the
sequence in which the program is executed.
• Input and Output instructions act as an interface between the computer and the
user. Programs and data must be transferred into memory, and the results of
computations must be transferred back to the user.
7
MEMEORY REFERENCE
INSTRUCTIONS
• These instructions refer to memory address as an operand.
The other operand is always accumulator. Specifies 12-bit
address, 3-bit opcode (other than 111) and 1-bit addressing
mode for direct and indirect addressing.

• Example –
IR register contains = 0001XXXXXXXXXXXX, i.e. ADD after
fetching and decoding of instruction we find out that it is a
memory reference instruction for ADD operation.
Hence, DR ← M[AR] AC ← AC + DR, SC ← 0

8
REGISTER REFERENCE
INSTRUCTION

• These instructions perform operations on registers rather than


memory addresses. The IR(14 – 12) is 111 (differentiates it
from memory reference) and IR(15) is 0 (differentiates it from
input/output instructions). The rest 12 bits specify register
operation.
 Example –
IR register contains = 0111001000000000, i.e. CMA after fetch
and decode cycle we find out that it is a register reference
instruction for complement accumulator.
Hence, AC ← ~AC

9
INPUT-OUTPUT REFERENCE
INSTRUCTION
• These instructions are for communication between computer and
outside environment. The IR(14 – 12) is 111 (differentiates it from
memory reference) and IR(15) is 1 (differentiates it from register
reference instructions). The rest 12 bits specify I/O operation.
• Example –
IR register contains = 1111100000000000, i.e. INP after fetch and
decode cycle we find out that it is an input/output instruction for
inputing character. Hence, INPUT character from peripheral
device.

 
10
HOMEWORK
Q1. Can you perform an addition on three operands simultaneously in ALN
using Add instruction?
A. Yes
B. Not possible using Add, we’ve to use AddSetCC
C. Not permitted
D. None of the mentioned

Q2. The two phases of executing an instruction are __________


A. Instruction decoding and storage
B. Instruction fetch and instruction execution
C. Instruction execution and storage
D. Instruction fetch and Instruction processing

Answers:1.C, 2.B.
11
REFERENCES
Reference Books:
1. J.P. Hayes, “Computer Architecture and Organization”, Third Edition.
2. Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall.
3. Stallings, W., “Computer Organization and Architecture”, Eighth Edition,
Pearson Education.
Text Books:
4. Carpinelli J.D,” Computer systems organization &Architecture”, Fourth Edition,
Addison Wesley.
5. Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon
Kauffman.
Reference Website
6. https://thebittheories.com/levels-of-programming-languages-b6a38a68c0f2
7. https://www.cs.toronto.edu/~gpenn/csc324/lecture2.pdf

12
THANK YOU

You might also like