machine instruction characteristics machine instructions- are instructions executed by the...
TRANSCRIPT
![Page 1: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/1.jpg)
![Page 2: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/2.jpg)
Machine Instruction CharacteristicsMachine Instructions- are instructions
executed by the processor.
Instruction set- a collection of instructions that the processor can execute
![Page 3: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/3.jpg)
Elements of a machine instructionOpcode- uses a binary code which specifies
the operation to be preformed.Source operand reference- the input for the
operationResult operand reference- the result
produced by the operationNext instruction reference- tells the
processor where to get the next instruction
![Page 4: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/4.jpg)
Source and result operands can be found inMain or virtual memoryProcessor register- contains registers that
can be used by machine instructions Immediate- the operand value is being
contained when the instruction is being executed
I/O devices- instruction specifies I/O module and device but if memory mapped then just another main or virtual memory address
![Page 5: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/5.jpg)
Representation of instructionRepresentation of instruction
OPCODE (4 Bits)
Ref to Operand 1 (6 Bits)
Ref to Operand 2(6 Bits)
• An instruction format is used to define the layout of the bits allocated to these elements of instructions.• The instruction format explicitly or implicitly indicates the addressing Modes used for each operand in that instruction.
![Page 6: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/6.jpg)
Instruction formatInstruction format
Instruction length: -Instruction length: - The longer instruction length gives: More Opcodes More operands More addressing modes Greater address range.
![Page 7: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/7.jpg)
Factors considered for instruction lengthFactors considered for instruction length
Memory Size.Memory organization.Bus structureProcessor speedProcessor complexity.
![Page 8: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/8.jpg)
Allocation of Bits for different fields in an Allocation of Bits for different fields in an instructioninstructionNumber of addressing modes.Number of operands.Register versus memory.Number of register sets.Address range.Address granularity.
![Page 9: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/9.jpg)
Variable length instructionsVariable length instructions
Advantages: -Provides flexibility in addressing modes.Provides complex addressing modes.Reduces number of instruction fetch cycles.Reduces amount of space taken by a program.Disadvantages: -Disadvantages: -Requires more complex CPU.Decoding of instruction becomes difficult.
![Page 10: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/10.jpg)
Instruction SetsInstruction Characteristics
Types of Operands
Types of Operations
![Page 11: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/11.jpg)
Instruction Representation Are represented by a sequence of bits It is common to use “symbolic
representation” of machine instructions Op codes and operands are represented by
abbreviations called “mnemonics”
![Page 12: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/12.jpg)
Mnemonics ADD addSUB subtractMUL multiplyDIV divideLOAD load data from memorySTOR store data to memory
![Page 13: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/13.jpg)
Instruction typesData processing- arithmetic and logic
instructionsData storage- moving data into or out of
register or memory locationsData movement- I/O instructions Control- test and branch instructions
![Page 14: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/14.jpg)
Number of Addresses• A traditional way of describing processor
architecture• What is the maximum number of addresses
one might need in an instruction?• An instruction could be required to contain
four addresses
![Page 15: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/15.jpg)
Number of Addresses• 3 addresses
instructions• Operand 1,
Operand 2, Result• a = b + c;• May be a forth -
next instruction (usually implicit)
• Not common• Needs very long
words to hold everything
![Page 16: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/16.jpg)
Number of Addresses• 2 addresses
instructions• One address doubles
as operand and result
• a = a + b;• Reduces length of
instruction• Requires some extra
work• Temporary storage to
hold some results
![Page 17: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/17.jpg)
Number of Addresses• 1 address
instructions• Implicit second
address• Usually a register
(accumulator)• Common on early
machines• E.g. ADD B
![Page 18: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/18.jpg)
Number of Addresses• Zero address instruction:
• Special memory organization
• Last in first out (Stack)
• Stack is a known location
• E.g. CMA
![Page 19: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/19.jpg)
Number of AddressesUtilization of Instruction Addresses
(Nonbranching Instructions)
![Page 20: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/20.jpg)
Number of Addresses1 address instructions 2 Or 3 address
instructions• One general purpose
registerMultiple general
purpose registers
![Page 21: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/21.jpg)
Instruction Set DesignOperation Repertoire- How many and which
operations to provide, and how complex the operations should be.
Data Types- The various types of data upon which operations are performed.
Instruction Format- Instruction length (in bits), number of addresses and size of fields.
![Page 22: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/22.jpg)
Instruction Set DesignRegisters- 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.
![Page 23: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/23.jpg)
![Page 24: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/24.jpg)
TYPES OF OPERANDS Addresses Numbers Characters Logical Data Specialized Data Types Data Structures
![Page 25: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/25.jpg)
Addresses Main or Virtual memory address Unsigned Integers
![Page 26: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/26.jpg)
NumbersAll machine languages include numeric typesNon-numeric processing: counters, field
widths, etcNumbers in a machine are limited by
magnitude and precisionConsequences: rounding, overflow, underflow
![Page 27: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/27.jpg)
Numerical DataBinary integer or Binary fixed pointBinary floating pointDecimal
![Page 28: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/28.jpg)
DecimalMajority of users deal with decimalsNecessity to convert from decimal to binary
on input and binary to decimal on outputPacked decimal
![Page 29: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/29.jpg)
Packed DecimalUsed when there is a great deal of I/O and
simple computationEach decimal digit is represented by a 4-bit
code. Ex: 0 = 0000, 1 = 0001Numbers are formed by a string of 4-bit
codes usually in multiples of 8-bit246 = 0000 0010 0100 0110Positive: 1100Negative: 1101
![Page 30: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/30.jpg)
CharactersText or character stringsRepresented by a sequence of bitsMorse CodeInternational Reference Alphabet (IRA)American Standard Code for Information
Interchange (ASCII)Extended Binary Coded Decimal Interchange
Code (EBCDIC)
![Page 31: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/31.jpg)
Logical DataConsider n-bit unit as consisting of n 1-bit
items of data, each having a value of 0 or 1Advantages:
Store array of Boolean or Binary data itemsManipulating bits of data items
![Page 32: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/32.jpg)
Types of OperationsData TransferArithmeticLogicalConversionInput/outputSystem ControlTransfer of Control
![Page 33: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/33.jpg)
Data TransferOperation Name DescriptionMove(Transfer)StoreLoad (Fetch)ExchangeClear ( Reset)Set PushPop
Transfer word from source to destination
From processor to memory From memory to processor Swap contents of source
and destination Transfer 0s to destination Transfer 1s to destination Word from source to top of
stack From top of stack to
destination
![Page 34: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/34.jpg)
Arithmetic
Operation Name DescriptionAddSubtractMultiply DivideAbsoluteNegateIncrementDecrement
Compute sum of two operands
Difference of two operands
Product of two operands Quotient of two
operands Replace by its absolute
value Change sign Add 1 to operand Subtract 1 to operand
![Page 35: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/35.jpg)
LogicalOperation Name DescriptionAND; OR; NOT; ORTestCompareSet Control VariablesShift Variables
Perform the specified logical operation bitwise
Test specified condition; set flags based on outcome
Make logical and arithmetic comparison of two operands
Class of instructions to set controls for protection purposes, interrupt handling, timer control.
Left/right operand introducing constants at end.
Left/right with wraparound end
![Page 36: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/36.jpg)
Conversion
Operation Name DescriptionTranslate Convert
Translate values in a section of memory based on a table of correspondences
Convert the contents of a word from one form to another. E.g(packed decimal to binary
![Page 37: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/37.jpg)
I/OOperation Name DescriptionInput (Read)Output ( Write)Start I/OEnd I/O
Transfer data from specified I/O port or device to destination
From specified source to I/O port or device
Transfer instructions to I/O processor to initiate I/O operation
Transfer status info from I/O system to specified destination
![Page 38: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/38.jpg)
System Of Control Can be executed only while the processor is in a
certain privileged state or is executing a program in a special privileged area of memory.
These instructions, are reserved for the use of the operating system.
Examples: A system control instruction may read or alter a
control register An instruction to read or modify a storage
protection key Access to process control blocks in
multiprogramming system
![Page 39: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/39.jpg)
Transfer Of Control
Operation Name
Description
Jump (Branch) Jump Conditional Jump to Subroutine Return Execute Skip Skip conditional Halt Wait (Hold) No Operation
Unconditional Transfer: load PC with specified address
Test condition: either load PC with specified address or do nothing.
Place current program control info in known location; jump to specified address
Replace contents of PC and other register from known location
Fetch operand from location and execute as instructed
Increment PC to skip next instruction
Either skip or do nothing based on condition
Stop program execution Test specified repeatedly and
resume condition No operation is performed; but
program execution is continued.
![Page 40: Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that](https://reader038.vdocument.in/reader038/viewer/2022102523/56649e6f5503460f94b6c76f/html5/thumbnails/40.jpg)
QUESTIONSHow many different address designs are there?Name two types of operations.What are the most general categories of data?What type of endian mode does x86 use?What are the most used Character Codes
nowadays?What are the elements of machine instruction?What are the advantages of Logical Data?