Lecture 1.2.5 (Instruction Set Formats)
Lecture 1.2.5 (Instruction Set Formats)
ASSISTANT PROFESSOR
BE-CSE
INSTRUCTION SET CLASSIFICATION
The instruction set of any processor broadly fits into the categories as in figure
below along with examples. The first five categories are mandatory while the
next four are generally
available in advanced or new generation processors. The Instruction set is part of
the Instruction Set Architecture (ISA). Therefore, the Data path, the Registers,
Memory Interface and the Instruction set, altogether ensure the design of the
CPU and its best utilization. The number of instructions for a processor may
range from less than 100 to few hundreds plus. It is noteworthy, that a large
number of instructions does not imply that the processor is powerful. More often,
to provide downward compatibility within the processor family variants of each
instruction adds up to the list, making the set larger.
Generic Classification of Instruction Set
Generic types of instructions are already discussed in previous chapters. Let us
understand others and previous ones in brief.
For easy understanding, the examples are written in the mnemonic code. R
refers to register in CPU, any name refers to the variable.
First part is the instruction mnemonic.
The example instructions do not pertain to any particular CPU.
For example:
IN Port#232
OUT Port#234
Move R1, #FFEE
Miscellaneous Instructions: NOP (No Operation) is a famous dummy instruction
but a very useful one in this category. Some of the CPUs allow user-defined
interrupt. These interrupts can be activated using Instructions. HALT is another very
important instruction which brings the system to halt when "Shutdown". System
Control is either grouped here or as Control Instructions.
For example:
HALT
NOP
INT
Floating Point Instructions: We had seen in the previous chapter that specialised
hardware is required for efficient Floating-point operations. This hardware
works independently of the CPU. Floating-Point Arithmetic instructions with
unique opcode are helpful.
FLD FP Load
FST FP Store
FADD FP ADD
FSUB FP Subtract
FMUL FP Multiply
Emulated Instructions: User-defined opcode and operation fall into this category.
Very few CPU support this type.
CPU architecture design radically differs based on the size of the Instruction set.
Accordingly, there are two categories namely Reduced Instruction Set
Computer (RISC) and Complex Instruction Set Computer (CISC).
As the name implies, RISC has fewer instructions in the set and CISC has a large
number of instructions. No matter, both are equally functionally complete. MIPS,
ALPHA, PA-RISC, Intel i860, Motorola 88000, ARM are all examples of RISC
CPU. Intel X86 series, Motorola 68K series, VAX are all examples of CISC CPU.
Frequently we will be referring to RISC and CISC. The trade-off is between the
size of the program code and the simplicity in decoding the instructions by the
hardware.
INSTRUCTION SET FORMATS
Encoding of Instructions is called Instruction Format. There are two generic ways
to encode instructions.
1.Three-Address Format
Used when two operands are specified. The result is stored in one of the source
operands.
Example:
ADD A ;AC = AC + A
Format: Opcode
Exercise:
LOAD A ;AC=M[A]
ADD B ;AC=AC+M[B]
STORE T ;M[T]=AC
LOAD C ;AC=M[C]
ADD D ;AC=AC+M[D]
MUL T ;AC=AC*M[T]
STORE X ;M[X]=AC
X = (A+B)*(C+D) in Zero Address Format
PUSH A ;TOP=A
PUSH B ;TOP=B
ADD
PUSH C ;TOP=C
PUSH D ;TOP=D
ADD ;TOP=C+D
MUL ;TOP=(C+D)*(A+B)
POP X ;M[X]=TOP
References Reference Books:
J.P. Hayes, “Computer Architecture and Organization”,
Third Edition.
Mano, M., “Computer System Architecture”, Third
Edition, Prentice Hall.
Stallings, W., “Computer Organization and Architecture”, Eighth Edition,
Pearson Education.
Text Books:
Carpinelli J.D,” Computer systems organization &Architecture”, Fourth
Edition, Addison Wesley.
Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon
Kauffman.
Reference Website
Instruction Set Architecture : Instructions and Formats | Computer
Architecture (witscad.com)