Instruction Types
Instruction Types
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
3
WHAT IS INSTRUCTION SET?
4
ELEMENTS OF INSTRUCTION
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
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
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