instruction set characteristics, Slides of Computer Architecture and Organization

these files contain slides on main topics of coa and covers each and every topic in detail...it is for both beginners and students

Typology: Slides

2021/2022

Available from 08/16/2022

SamenKhan
SamenKhan šŸ‡µšŸ‡°

231 documents

1 / 37

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
+
Instruction Sets:
Characteristics and
Functions
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

Partial preview of the text

Download instruction set characteristics and more Slides Computer Architecture and Organization in PDF only on Docsity!

Instruction Sets:

Characteristics and

Functions

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

Example of Program Execution

Elements of a Machine Instruction

Operation code
(opcode)
  • Specifies the operation to be performed. The operation is specified by a binary code, known as the operation code, or opcode
Source operand
reference
  • The operation may involve one or more source operands, that is, operands that are inputs for the operation
Result operand
reference
  • The operation may produce a result
Next instruction
reference
  • This tells the processor where to fetch the next instruction after the execution of this instruction is complete

Source and result operands can be

in one of four areas:

3) Processor register

ā—¼ A processor contains one or
more registers that may be
referenced by machine
instructions.
ā—¼ If more than one register
exists each register is
assigned a unique name or
number and the instruction
must contain the number of
the desired register

2) I/O device

ā—¼ The instruction must specify
the I/O module and device
for the operation. If memory-
mapped I/O is used, this is
just another main or virtual
memory address

1) Main or virtual memory

ā—¼ As with next instruction
references, the main or virtual
memory address must be
supplied

4) Immediate

ā—¼ The value of the operand is
contained in a field in the
instruction being executed

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

Opcode 4 bits 6 bits 6 bits 16 bits Figure 10.2 A Simple Instruction Format Figure 12.2 A Simple Instruction Format Operand Reference Operand Reference

Instruction - Example

  • Consider a high-level language instruction:
X = X + Y;
Assume the variables X and Y correspond to locations 513 and 514
1. Load a register with the contents of memory location 513
2. Add the contents of memory location 514 to the register
3. Store the contents of the register in memory location 513
  • Any program written in a high-level language must be translated into
machine language to be executed.
  • The set of machine instructions must be sufficient to express any of the
instruction from a high-level language

Instruction Types

  • I/O instructions are needed to transfer programs and data into memory and the results of computations back out to the user
  • Test instructions are used to test the value of a data word or the status of a computation
  • Branch instructions are used to branch to a different set of instructions depending on the decision made
  • Movement of data into or out of register and or memory locations
  • Arithmetic instructions provide computational capabilities for processing numeric data
  • 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 processing Data storage Data movement Control 11

Instruction Comment SUB Y, A, B Y ¬ A – B MPY T, D, E T ¬ D Ā“ E ADD T, T, C T ¬ T + C DIV Y, Y, T Y ¬ Y Ć· T (a) Three-address instructions Instruction Comment LOAD D AC ¬ D MPY E AC ¬ AC Ā“ E ADD C AC ¬ AC + C STOR Y Y ¬ AC LOAD A AC ¬ A SUB B AC ¬ AC – B DIV Y AC ¬ AC Ć· Y STOR Y Y ¬ AC Instruction Comment MOVE Y, A Y ¬ A SUB Y, B Y ¬ Y – B MOVE T, D T ¬ D MPY T, E T ¬ T Ā“ E ADD T, C T ¬ T + C DIV Y, T Y ¬ Y Ć· T (b) Two-address instructions (c) One-address instructions

Figure 12 .3 Programs to Execute Y =
A - B

C + (^) ( D Ā“ E )

Instruction Set Design

Fundamental design issues: Operation Range How many and which operations to provide and how complex operations should be Data Types The various types of data upon which operations are performed Instruction Format Instruction length in bits, number of addresses, size of various fields, etc. Registers Number of processor registers that can be referenced by instructions and their use Addressing The mode or modes by which the address of an operand is specified Programmer’s means of controlling the processor Defines many of the functions performed by the processor Very complex because it affects so many aspects of the computer system

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
ā—¼ To form numbers 4-bit codes are strung together, usually in
multiples of 8 bits

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

Data Type Description General Byte, word (16 bits), doubleword (32 bits), quadword (64 bits), and double quadword (128 bits) locations with arbitrary binary contents. Integer A signed binary value co4ntained in a byte, word, or doubleword, using twos complement representation. Ordinal An unsigned integer contained in a byte, word, or doubleword. Unpacked binary coded decimal (BCD) A representation of a BCD digit in the range 0 through 9, with one digit in each byte. Packed BCD Packed byte representation of two BCD digits; value in the range 0 to 99. Near pointer A 16 - bit, 32-bit, or 64-bit effective address that represents the offset within a segment. Used for all pointers in a nonsegmented memory and for references within a segment in a segmented memory. Far pointer A logical address consisting of a 16 - bit segment selector and an offset of 16, 32, or 64 bits. Far pointers are used for memory references in a segmented memory model where the identity of a segment being accessed must be specified explicitly. Bit field A contiguous sequence of bits in which the position of each bit is considered as an independent unit. A bit string can begin at any bit position of any byte and can contain up to 32 bits. Bit string (^) A contiguous sequence of bits, containing from zero to 2 32 – 1 bits. Byte string A contiguous sequence of bytes, words, or doublewords, containing from zero to 2 32 – 1 bytes. Floating point See Figure 12.4. Packed SIMD (single instruction, multiple data) Packed 64-bit and 128-bit data types Table 12. x Data Types 19

Type Operation Name Description Move (transfer) Transfer word or block from source to destination Store Transfer word from processor to memory Load (fetch) Transfer word from memory to processor Exchange Swap contents of source and destination Clear (reset) Transfer word of 0s to destination Set Transfer word of 1s to destination Push Transfer word from source to top of stack Data Transfer Pop Transfer word from top of stack to destination Add Compute sum of two operands Subtract Compute difference of two operands Multiply Compute product of two operands Divide Compute quotient of two operands Absolute Replace operand by its absolute value Negate Change sign of operand Increment Add 1 to operand Arithmetic Decrement Subtract 1 from operand AND Perform logical AND OR Perform logical OR NOT (complement) Perform logical NOT Exclusive-OR Perform logical XOR Test Test specified condition; set flag(s) based on outcome Compare Make logical or arithmetic comparison of two or more operands; set flag(s) based on outcome Set Control Variables Class of instructions to set controls for protection purposes, interrupt handling, timer control, etc. Shift Left (right) shift operand, introducing constants at end Logical Rotate Left (right) shift operand, with wraparound end

Table 12.

Common Instruction Set Operations (page 1 of 2) (Table can be found on page 426 in textbook.) 20