Computer Architecture

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

CPU Review and Programming Models CT101 – Computing Systems.
There are two types of addressing schemes:
Computer Organization and Architecture
Computer Organization and Architecture
Chapter 11 Instruction Sets
The Central Processing Unit Instruction Sets: Addressing Modes and Formats.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
Operand And Instructions Representation By Dave Maung.
Abdullah, Ibrahim Ali, Javeed Budhram, Dharmendra Galiana, Thomas Monegro, Wesley Silva, Frank.
Execution of an instruction
Mod-Mod Pengalamat Segera (Immediate) Terus (Direct)
CH11 Instruction Sets: Addressing Modes and Formats
Pentium Addressing Modes
Unit -II CPU Organization By- Mr. S. S. Hire. CPU organization.
Part II: Addressing Modes
Processor Organization and Architecture Module III.
Machine Instruction Characteristics
Instruction Set Architecture
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 15 & 16 Stacks, Endianness Addressing Modes Course Instructor: Engr. Aisha Danish.
L/O/G/O The Instruction Set Chapter 9 CS.216 Computer Architecture and Organization.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Computer Architecture and the Fetch-Execute Cycle
Operating Systems Lecture No. 2. Basic Elements  At a top level, a computer consists of a processor, memory and I/ O Components.  These components are.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
Execution of an instruction
COMPUTER ARCHITECURE INSTRUCTION SET ARCHITECTURE.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 19 & 20 Instruction Formats PDP-8,PDP-10,PDP-11 & VAX Course Instructor: Engr. Aisha Danish.
Computer Organization
Chapter 11 Instruction Sets: Addressing Modes and Formats
Operand Addressing And Instruction Representation Cs355-Chapter 6.
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
Chapter 11 Instruction Sets: Addressing Modes and Formats Gabriel Baron Sydney Chow.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Addressing Modes and Formats
WEEK 3 I/O Port Programming ET2640 Microprocessors and Microcontrollers.
MicroProcessors Lec. 3 Dr. Tamer Samy Gaafar. Course Web Page
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
1 ADDRESSING MODES Addressing Modes: * Specifies a rule for interpreting or modifying the address field of the instruction (before the operand is actually.
EEL 4709C Prof. Watson Herman Group 4 Ali Alshamma, Derek Montgomery, David Ortiz 11/11/2008.
İnformasiya texnologiyaları kafedrası Mövzu № 7. Ünvanlaşdırma üsulları. (Ünvanlaşdırma rejimləri. Bilavasitə ünvanlaşdırma. Birbaşa ünvanlaşdırma. Registrli.
Displacement (Indexed) Stack
William Stallings Computer Organization and Architecture 6th Edition
Immediate Addressing Mode
Chapter 11 Instruction Sets
A Closer Look at Instruction Set Architectures
Alvaro Mauricio Peña Dariusz Niworowski Frank Rodriguez
William Stallings Computer Organization and Architecture 8th Edition
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Processor Organization and Architecture
Central Processing Unit
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture
Classification of instructions
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Presentation transcript:

Computer Architecture Chapter (13): Instruction Sets: Addressing Modes and Formats Eng. Nader Taleb

Addressing Modes The most common addressing techniques, or modes: The address field or fields in a typical instruction format are relatively small. We would like to be able to reference a large range of locations in main memory or, virtual memory. The most common addressing techniques, or modes: Immediate. Direct. Indirect. Register. Register indirect. Displacement (Indexed). Stack.

Cont. Notations: A = contents of an address field in the instruction. R = contents of an address field in the instruction that refers to a register. EA = actual (effective) address of the location containing the referenced operand. (X) = contents of memory location X or register X. Several approaches are used, so different opcodes will use different addressing modes. Also, bits in the instruction format can be used as a mode field.

1. Immediate Addressing Example: ADD 5. Operand is part of instruction. Operand = A Example: ADD 5. Add 5 to contents of accumulator. 5 is operand. It used to define and use constants or set initial values of variables. No memory reference to fetch data (saving one memory or cache cycle). Fast. Limited range (instruction sets is small compared with the word length). Opcode

2. Direct Addressing Address field contains address of operand. EA = A Example: ADD A. Add contents of cell A to accumulator. Look in memory at address A for operand. Single memory reference to access data. No additional calculations to work out effective address. Limited address space.

3. Indirect Addressing The address field refer to the address of a word in memory. Memory cell pointed to by address field contains the address of (pointer to) the operand. EA = (A) Look in A, find address (A) and look there for operand. Example: ADD (A). Add contents of cell pointed to by contents of A to accumulator (AC). The disadvantage is that instruction execution requires two memory references to fetch the operand (address + value). Pointer

4. Register Addressing It is similar to direct addressing. The only difference is that the address field refers to a register rather than M.M address. EA = R Limited number of registers. No memory access. Very fast execution. The advantages are: Only a small address field is needed in the instruction. No time-consuming memory references are required. The main disadvantage is very limited address space. In modern Processors, multiple registers helps performance.

5. Indirect Register Addressing It is analogous to indirect addressing. The only difference is that the address field refers to a register. EA = (R) Operand is in memory cell pointed to by contents of register R. Large address space (2 ). One fewer memory access than indirect addressing. n

6. Displacement Addressing “A very powerful mode of addressing that combines the capabilities of direct addressing and register indirect addressing”. EA = A + (R) The value contained in one address field (value = A) is used directly. The other address field, or an implicit reference refers to a register (R) whose contents are added to A to produce the effective address.

Cont. There are three of the most common uses of displacement addressing: Relative addressing Base-register addressing Indexing (a) Relative addressing: R = Program counter( PC). EA = A + (PC). Get operand from A cells from current location pointed to by PC. This share the locality of reference & cache usage.

Cont. (b) base-register addressing: The referenced register contains a main memory address, and the address field contains a displacement from that address. A holds displacement. R holds pointer to base address. The register reference may be explicit or implicit. (c) Indexing addressing: The address field references a main memory address, and the referenced register contains a positive displacement from that address. This usage is just the opposite of the interpretation for base- register addressing.

Cont. A = base R = displacement EA = A + R The value A is stored in the instruction’s address field, and the chosen register, called an index register, is initialized to 0. After each operation, the index register is incremented by 1. Some systems automatically do this as part of the same instruction cycle. This is known as autoindexing. EA = A + (R) (R) (R) + 1 In some machines, both indirect addressing and indexing are provided, and it is possible to employ both in the same instruction. There are two possibilities: the indexing is performed either before or after the indirection.

Cont. If indexing is performed after the indirection, it is termed postindexing EA = (A) + (R) First, the contents of the address field are used to access a memory location containing a direct address. This address is then indexed by the register value. With preindexing, the indexing is performed before the indirection. EA = (A + (R)) An address is calculated as with simple indexing. In this case, however, the calculated address contains not the operand, but the address of the operand.

7. Stack Addressing A stack is a linear array of locations. It is sometimes referred to as a pushdown list or last-in-first-out queue. The top two elements of the stack may be in processor registers, in which case the stack pointer references the third element of the stack. The stack pointer is maintained in a register. Thus, references to stack locations in memory are in fact register indirect addresses. The machine instructions need not include a memory reference but it is (implicitly) on top of stack.

Summary

Instruction Formats Instruction Length Layout of bits in an instruction. Includes opcode. Includes (implicit or explicit) operand(s). Usually more than one instruction format in an instruction set. Instruction Length Affected by and affects: Memory size & Memory organization. Bus structure. CPU complexity. CPU speed. Trade off between powerful instruction repertoire and saving space.

Allocation of Bits For a given instruction length, there is clearly a trade-off between the number of opcodes and the power of the addressing capability. The use of variable-length opcodes is helpful. The following interrelated factors go into determining the use of the addressing bits: Number of addressing modes. Number of operands. Register versus memory. Number of register sets. Address range. Address granularity.

Example

Thank you