<< Chapter < Page Chapter >> Page >
  • Three addresses:
  • Operand 1, Operand 2, Result

Example: a = b + c

  • Three-address instruction formats are not common, because they require a rel­atively long instruction format to hold the three address references.
  • Two addresses:
  • One address doubles as operand and result

Example: a = a + b

  • The two-address formal reduces the space requirement but also introduces some awkwardness. To avoid altering the value of an operand, a MOVE instruction is used to move one of the values to a result or temporary location before performing the operation.
  • One addresses:
  • a second address must be implicit. This was common in earlier machines, with the implied address being a CPU register known as the accumulator. or AC. The accumulator contains one of the operands and is used to store the result.
  • Zero addresses
  • Zero-address instructions are applicable to a special memory organization, called a Stack. A stack is a last-in-first-out set of locations.

How many addresses?

The number of addresses per instruction is a basic design decision.

Fewer addresses:

  • Fewer addresses per instruction result in more primitive instructions, which requires a less complex CPU.
  • It also results in instructions of shorter length. On the other hand, programs contain more total instructions, which in general results in longer execu­tion times and longer, more complex programs

Multiple-address instructions:

  • With multiple-address instructions, it is common to have multiple general-purpose registers. This allows some operations to be performed solely on registers.
  • Because register references are faster than memory references, this speeds up execution.

1.5 design decisions

One of the most interesting and most analyzed, aspects of computer design is instruction set design. The design of an instruction set is very complex, because it affects so many aspects of the computer system. The instruction set defines many of the functions performed by the CPU and thus has a significant effect on the imple­mentation of the CPU. The instruction set is the programmer's means of control­ling the CPU. Thus, programmer requirements must be considered in designing the instruction set. The most important design issues include the following:

  • Operation repertoire: 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, and so on.
  • Registers: Number of CPU registers that can be referenced by instructions, and their use.
  • Addressing: The mode or modes by which the address of an operand is specified

2. types of operands

Machine instructions operate on data. The most important general categories of data are:

  • Addresses
  • Numbers
  • Characters
  • Logical data

2.1 numbers

All machine languages include numeric data types. Even in nonnumeric data pro­cessing, there is a need for numbers to act as counters, field widths, and so forth. An important distinction between numbers used in ordinary mathematics and num­bers stored in a computer is that the latter are limited. Thus, the programmer is faced with understanding the consequences of rounding, overflow and underflow.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Computer architecture. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10761/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Computer architecture' conversation and receive update notifications?

Ask