0% found this document useful (0 votes)
24 views35 pages

CH12-WS - 10thed

Chapter 12 of 'Computer Organization and Architecture' discusses machine instruction characteristics, including the structure of instructions and the elements involved such as operation codes and operand references. It covers the various types of instructions, including arithmetic, logic, and data transfer, as well as the complexities of instruction set design and the representation of different data types. Additionally, it addresses input/output operations and transfer of control mechanisms within instruction sets.
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)
24 views35 pages

CH12-WS - 10thed

Chapter 12 of 'Computer Organization and Architecture' discusses machine instruction characteristics, including the structure of instructions and the elements involved such as operation codes and operand references. It covers the various types of instructions, including arithmetic, logic, and data transfer, as well as the complexities of instruction set design and the representation of different data types. Additionally, it addresses input/output operations and transfer of control mechanisms within instruction sets.
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/ 35

+

William Stallings
Computer Organization
and Architecture
10th Edition

Developed based on 2016 Pearson Educati


on, Inc., Hoboken, NJ
+ Chapter 12
Instruction Sets:
Characteristics and
Functions
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
+
Machine Instruction
Characteristics

 The operation of the processor is determined by the


instructions it executes, referred to as machine
instructions or computer instructions
 The collection of different instructions that the
processor can execute is referred to as the processor’s
instruction set
 Each instruction must contain the information required
by the processor for execution

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Elements of a Machine
Instruction
Operation code Source operand
(opcode) reference
• Specifies the • The operation may
operation to be involve one or more
performed. The source operands,
operation is specified that is, operands that
by a binary code, are inputs for the
known as the operation
operation code, or
opcode

Result operand Next instruction


reference reference
• The operation may • This tells the
produce a result processor where to
fetch the next
instruction after the
execution of this
instruction is
complete

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Source and result operands can
be in one of four areas:
3) Processor register
 A processor contains one or
1) Main or virtual memory more registers that may be
 As with next instruction referenced by machine
references, the main or instructions.
virtual memory address
must be supplied
 If more than one register
exists each register is
assigned a unique name or
number and the instruction
2) I/O device must contain the number
 The instruction must of the desired register
specify the I/O module and 4) Immediate
device for the operation. If
memory-mapped I/O is
 The value of the operand is
used, this is just another contained in a field in the
main or virtual memory instruction being executed
address
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
+
Instruction Representation
 Within the computer each instruction is represented by
a sequence of bits
 The instruction is divided into fields, corresponding to
the constituent elements of the instruction

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Instruction Representation
 Opcodes are represented by abbreviations
called mnemonics
 Examples include:
 ADD Add
 SUB Subtract
 MUL Multiply
 DIV Divide
 LOAD Load data from memory
 STOR Store data to memory

 Operands are also represented symbolically


 Each symbolic opcode has a fixed binary representation
 The programmer specifies the location of each symbolic
operand
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Instruction Types
• Arithmetic instructions provide • Movement of data into or
computational capabilities for out of register and or
processing numeric data memory locations
• Logic (Boolean) instructions
operate on the bits of a word as
bits rather than as numbers, thus
they provide capabilities for
processing any other type of
data the user may wish to
employ
Data
Data
processin
storage
g

Data
Control movemen
t
• Test instructions are used to test the • I/O instructions are
value of a data word or the status of needed to transfer
a computation programs and data into
• Branch instructions are used to memory and the results
branch to a different set of of computations back out
instructions depending on the to the user
decision made

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Table 12.1
Utilization of Instruction Addresses
(Non-branching Instructions)

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Instruction Set Design
Very complex because it affects so many aspects of the computer
system

Defines many of the functions performed by the processor

Programmer’s means of controlling the processor

Fundamental design issues:

Operation Data types Instruction format Registers Addressing


repertoire • The various types of data • Instruction length in bits, • Number of processor • The mode or modes by
• How many and which upon which operations number of addresses, registers that can be which the address of an
operations to provide are performed size of various fields, etc. referenced by operand is specified
and how complex instructions and their use
operations should be

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Types of Operands

sse s
d re
Ad Num
bers

Char
acte
rs i c al
Log
Data

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+ Numbers

 All machine languages include numeric data types


 Numbers stored in a computer are limited:
 Limit to the magnitude of numbers representable on a
machine
 In the case of floating-point numbers, a limit to their precision

 Three types of numerical data are common in computers:


 Binary integer or binary fixed point
 Binary floating point
 Decimal

 Packed decimal
 Each decimal digit is represented by a 4-bit code with two
digits stored per byte

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Characters

 A common form of data is text or character strings


 Textual data in character form cannot be easily stored
or transmitted by data processing and communications
systems because they are designed for binary data
 Most commonly used character code is the
International Reference Alphabet (IRA)
 Referred to in the United States as the American Standard
Code for Information Interchange (ASCII)

 Another code used to encode characters is the


Extended Binary Coded Decimal Interchange Code
(EBCDIC)
 EBCDIC is used on IBM mainframes

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Logical Data

 An n-bit unit consisting of n 1-bit items of


data, each item having the value 0 or 1
 Advantages to bit-oriented view:
 To manipulate the bits of a data item
 If floating-point operations are implemented in
software, we need to be able to shift significant bits
in some operations

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Table 12.3
Common
Instruction Set
Operations
(page 1 of 2)

(Table can be found on page


426 in textbook.)
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Table 12.3
Common
Instruction Set
Operations
(page 2 of 2)

(Table can be found on page


426 in textbook.)

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Table 12.4
Processor Actions for Various Types of Operations

(Table can be found on page 427 in textbook.)


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Data Transfer

Must specify:
• Location of the
source and
destination
Most operands
fundamental • The length of
type of data to be
transferred must
machine be indicated
instruction • The mode of
addressing for
each operand
must be
specified

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Table 12.5
Examples of IBM EAS/390 Data Transfer
Operations

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ (Table can be found on page 428 in textbook.)
+  Most machines provide the basic arithmetic
operations of add, subtract, multiply, and
divide
 These are provided for signed integer (fixed-
point) numbers
 Often they are also provided for floating-
point and packed decimal numbers
 Other possible operations include a variety
of single-operand instructions:
Arithmetic
 Absolute
 Take the absolute value of the operand
 Negate
 Negate the operand
 Increment
 Add 1 to the operand
Decrement
 Subtract 1 from the operand
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Table 12.6
Basic Logical Operations

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Table 12.7

Examples of Shift and Rotate Operations

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Instructions
that change
the format or Conversion
operate on the
format of data

An example of
a more
complex
editing
An example instruction is
is the EAS/390
converting Translate (TR)
from instruction
decimal to
binary

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Input/Output

 Variety of approaches taken:


 Isolated programmed I/O
 Memory-mapped programmed I/O
 DMA
 Use of an I/O processor

 Many implementations provide only a few I/O


instructions, with the specific actions specified by
parameters, codes, or command words

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Transfer of Control

 Reasons why transfer-of-control operations are


required:
 It is essential to be able to execute each instruction more
than once
 Virtually all programs involve some decision making
 It helps if there are mechanisms for breaking the task up
into smaller pieces that can be worked on one at a time

 Most common transfer-of-control operations found in


instruction sets:
 Branch
 Skip
 Procedure call

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Skip Instructions
Typically implies that
one instruction be
skipped, thus the
Includes an implied
implied address equals
address
the address of the next
instruction plus one
instruction length

Example:
Because the skip 301
instruction does not Example is the .
require a destination increment-and-skip-if- .
address field it is free to zero (ISZ) instruction 309 ISZ R1
do other things 310 BR 301
311

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ


+
Procedure Call Instructions
 Self-contained computer program that is incorporated into a
larger program
 At any point in the program the procedure may be invoked, or
called
 Processor is instructed to go and execute the entire procedure and
then return to the point from which the call took place

 Two principal reasons for use of procedures:


 Economy
 A procedure allows the same piece of code to be used many
times
 Modularity

 Involves two basic instructions:


 A call instruction that branches from the present location to the
procedure
 Return instruction that returns from the procedure to the place from
which it was called
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Developed based on 2016 Pearson Education, Inc., Hoboken, NJ
Status flags are bits in special registers
that may be set by certain arithmetic and Table 12.8
compare operations and used in conditional
branch instructions
x86 Status Flags

Developed based on 2016 Pearson Education, Inc., Hoboken, NJ

You might also like