Operand And Instructions Representation - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Operand And Instructions Representation

Description:

To add an instruction using zero operand, take two values and add them together ... Relies on implicit operand for each instruction to store in special register ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 33
Provided by: hom4484
Category:

less

Transcript and Presenter's Notes

Title: Operand And Instructions Representation


1
Operand And Instructions Representation
  • By
  • Dave Maung

2
Different types of Operand/Instruction
  • Zero Operands per instruction
  • One Operands per instruction
  • Two Operands per instruction
  • Three operands per instruction

3
Zero Operand Per Instruction
  • Also known as Stack Architecture because Operand
    are kept in stack.
  • To add an instruction using zero operand, take
    two values and add them together and put the
    result back to then stack.
  • Operand must be implicit

4
An example of Instruction used on a stack
computer
  • Push X
  • Push 7
  • Add
  • Pop X

5
One Operand Per Instruction
  • Architecture that limit each instruction to
    single operand is known as 1-address design.
  • Relies on implicit operand for each instruction
    to store in special register known as an
    accumulator.

6
Step to process one operand per Instruction
  • Processor extracts the current value of the
    accumulator
  • Performs the specified operation using the
    extracted value and the operand
  • place the result back in the accumulator

7
Example of One operand per instruction
  • Add X
  • Accumulator ? accumulator X

8
Disadvantage of One Operand Per Instruction
  • It does not allow instructions to specify two
    values.
  • It requires two instructions that load the value
    into the accumulator and then need to store the
    values back in the new location

9
Two Operands Per Instruction
  • Overcomes the limitation 1-address systems
  • Using 2 address process, an operation can be
    applied to a specified value.
  • It also offers data movement instructions that
    treat the operand as source and destination.

10
Example two operand per instruction
  • Add X Y
  • Specifies that the value of X is to be added to
    the current value of Y
  • Y ? Y X

11
Three Operand Per Instruction
  • Similar as Two Operand Per Instruction except
    that it can operate three input value per
    instruction

12
Example of three operand per instruction
  • Add X Y Z
  • Specifies an assignment of
  • Z ? X Y

13
Operand that specifies a source must be
  • A signed constant
  • An Unsigned constant
  • The content of a register
  • The value in a memory location

14
Operand the specifies a destination must be
  • A signed register
  • A pair of contiguous registers
  • A memory location

15
Von Nuemann Boottleneck
  • Operand addressing is the central weakness of a
    von Neumann architecture.
  • memory access may become a bottleneck because
    instructions are stored in memory and a processor
    must make at least one memory per instruction.
  • To Optimize the performance, operand must be
    taken from a register instead of memory.

16
Types of Encoding
  • 1. Explicit Operand Encoding
  • 2. Implicit Operand Encoding

17
Implicit Operand Encoding
  • The Opcode specifies the types of operands.
  • A processor that uses a implicit encoding
    contains multiple operand code for a given
    operation

18
Example of Implicit Encoding
19
Disadvantage of Implicit encoding
  • Multiple opcodes are needed for a given
    operation.
  • A list of opcodes can become large, when a
    processor allows many types of operands.

20
Explicit Encoding
  • Using Explicit can overcome the disadvantage of
    implicit encoding.
  • Each operand is represented by two fields
  • Type of Operand
  • Type of Value

21
Example of Explicit Operand Encoding
22
Tradeoffs in the choice of operands
  • Ease of Programming
  • Fewer Instructions
  • Smaller Instructions
  • Larger Range of Immediate Values
  • Faster Operand Fetch and Decode
  • Decreased Hardware size

23
Ease of Programming
  • We know that complex forms of operands make
    programming easier
  • 3-address approach mean we do not need to code
    separate instructions.

24
Fewer Instructions
  • Reduces the number of instruction in a program by
    increasing the expressive power of operands
  • Lowers the count of instructions by increasing
    the number of addresses
  • Disadvantage
  • Each instruction will be larger

25
Disadvantage of keeping smaller instruction
  • Decreases the expressive power.
  • Increases the number of instructions

26
Smaller Instructions
  • How to keep smaller Instruction?
  • 1. Limiting the number of operands
  • 2. Limiting the set of operands types
  • 3. Limiting maximum size of an operand keep
    instruction small

27
Larger Range of Immediate values
  • Increasing the size allows larger values because
    the size of a field in the operand determines the
    numeric range of immediate values.
  • Disadvantage
  • Larger instruction results

28
Faster Operand Fetch and Decode
  • How to operate hardware faster?
  • First, limit the number of operands
  • Second, limit the possible types of each operand

29
Decreased Hardware size
  • How to decrease the hardware size?
  • limits the types and complexity of operands
  • Reduces the size of circuitry

30
Values in Memory
  • Every processors include at least one instruction
    that allows an operand to specify value in memory
  • Values in the operand interpreted as an memory
    address.
  • This memory address is for the professor to
    perform memory lookup.

31
Advantage of memory look up
  • Helps ease programming
  • Helps allowing arbitrary instruction to
    reference memory.
  • improves performance.

32
Operand Addressing Modes
  • Instruction register is used to hold an
    instruction that is being decoded.
  • A immediate value can be found in instruction
    register

33
Summary
  • Covered different type of Operand instruction,
    Von Neumann Bottleneck, different choice of
    operand
Write a Comment
User Comments (0)
About PowerShow.com