COMPUTER ORGANIZATION & ARCHITECTURE

Similar documents
Chapter 13 Reduced Instruction Set Computers

Computer Architecture and Organization. Instruction Sets: Addressing Modes and Formats

Addressing Modes. Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

RISC Principles. Introduction

Chapter 11. Instruction Sets: Addressing Modes and Formats. Yonsei University

Computer Organization CS 206 T Lec# 2: Instruction Sets

William Stallings Computer Organization and Architecture. Chapter 12 Reduced Instruction Set Computers

RISC & Superscalar. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 12. Instruction Pipeline no hazard.

Lecture 4: RISC Computers

COMPUTER ORGANIZATION & ARCHITECTURE

Chapter 2 Instruction Set Architecture

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer

CHAPTER 5 A Closer Look at Instruction Set Architectures

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the

MICROPROCESSOR TECHNOLOGY

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Instruction Sets: Characteristics and Functions Addressing Modes

Processing Unit CS206T

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures

EKT 303 WEEK Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Chapter 2: Instructions How we talk to the computer

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Chapter 5. A Closer Look at Instruction Set Architectures

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces

Instruction content (2/2) Instruction content (1/2) The Instruction Set. Chapter 9. Each instruction must contain 4 basic pieces of information

COSC 6385 Computer Architecture. Instruction Set Architectures

REDUCED INSTRUCTION SET COMPUTERS (RISC)

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Understand the factors involved in instruction set

Major Advances (continued)

Computer Architecture, RISC vs. CISC, and MIPS Processor

Instruction Set Architecture. "Speaking with the computer"

Lecture 4: RISC Computers

Instruction Set Principles and Examples. Appendix B

We briefly explain an instruction cycle now, before proceeding with the details of addressing modes.

Outline. What Makes a Good ISA? Programmability. Implementability. Programmability Easy to express programs efficiently?

ECE 486/586. Computer Architecture. Lecture # 7

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

INTEL Architectures GOPALAKRISHNAN IYER FALL 2009 ELEC : Computer Architecture and Design

William Stallings Computer Organization and Architecture

55:132/22C:160, HPCA Spring 2011

ARSITEKTUR SISTEM KOMPUTER. Wayan Suparta, PhD 17 April 2018

COMP3221: Microprocessors and. and Embedded Systems. Instruction Set Architecture (ISA) What makes an ISA? #1: Memory Models. What makes an ISA?

Author : Dalbir Singh, Computer Science Deptt. CPU Structure and Functions. 1. Processor Organization

Introduction to Microcontrollers

Chapter 5. A Closer Look at Instruction Set Architectures

Instruction Sets: Characteristics and Functions

Computer Architecture

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CISC Attributes. E.g. Pentium is considered a modern CISC processor

CPU Structure and Function

Topics/Assignments. Class 10: Big Picture. What s Coming Next? Perspectives. So Far Mostly Programmer Perspective. Where are We? Where are We Going?

Instruction Set Architectures. Part 1

Outline. What Makes a Good ISA? Programmability. Implementability

Computer Architecture

Lecture 4: Instruction Set Architecture

Microcomputer Architecture and Programming

Reduced Instruction Set Computer

Computer Systems Laboratory Sungkyunkwan University

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation

2. ADDRESSING METHODS

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA)

Chapter 5. A Closer Look at Instruction Set Architectures

Chapter 2. Instruction Set Principles and Examples. In-Cheol Park Dept. of EE, KAIST

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

instruction set computer or RISC.

Pipelining, Branch Prediction, Trends

Module 3 Instruction Set Architecture (ISA)

Instruction Set Architectures. CS301 Prof. Szajda

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

Topic Notes: MIPS Instruction Set Architecture

Central Processing Unit

3.0 Instruction Set. 3.1 Overview

STRUCTURE OF DESKTOP COMPUTERS

CS4617 Computer Architecture

UNIT 2 PROCESSORS ORGANIZATION CONT.

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 17. Microprogrammed Control. Yonsei University

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

RISC Processors and Parallel Processing. Section and 3.3.6

Digital System Design Using Verilog. - Processing Unit Design

Concepts Introduced in Chapter 3

Cpu Architectures Using Fixed Length Instruction Formats

Computer Architecture

COE608: Computer Organization and Architecture

Processor Organization and Performance

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

UNIT V: CENTRAL PROCESSING UNIT

Processor Architecture

COS 140: Foundations of Computer Science

Chapter 12. CPU Structure and Function. Yonsei University

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

Instruction Set Principles. (Appendix B)

Transcription:

COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5b 1

STACKS A stack is an ordered set of elements, only one of which can be accessed at a time. The point of access is called the top of the stack. The number of elements in the stack, or length of the stack, can varies. The last element in the stack is the base of the stack Items may only be added to or deleted from the top of the stack. For this reason, a stack is also known as a pushdown list or a last-in-first-out (LIFO) list 2

Stack Implementation The stack is a useful structure that forms part of a processor implementation. Stacks are used to manage procedure calls and returns. Stacks may also be useful to the programmer. An example of this is stack expression Some stack operations are shown below 3

4

Three addresses are needed for proper operation, and these are often stored in processor registers: Stack pointer (SP): Contains the address of the top of the stack. If an item is appended to or deleted from the stack, the pointer is incremented or decremented to contain the address of the new item. Stack base: Contains the address of the bottom location in the reserved block. If an attempt is made to POP when the stack is empty, an error is reported. Stack limit: Contains the address of the other end of the reserved block. If an attempt is made to PUSH when the block is fully utilized for the stack, an error is reported. 5

Stack implementations have two key attributes: Ascending/descending: An ascending stack grows in the direction of ascending addresses, starting from a low address and progressing to a higher address. An ascending stack is one in which the SP is incremented when items are pushed and decremented when items are pulled. A descending stack grows in the direction of descending addresses, starting from a high address and progressing to a lower one. Most machines implement descending stacks as a default. 6

Full/empty: This is a misleading terminology, because this does not refer to whether the stack is completely full or completely empty. Rather, the SP can either point to the top item in the stack (full method), or the next free space on the stack (an empty method). For the full method, when the stack is completely full, the SP points to the upper limit of the stack. For the empty method, when the stack is completely empty, the SP points to the base of the stack 7

Example of Stack Computation f = (a b) / (c + (d * e)) 8

9

INSTRUCTION FORMAT Defines the layout of bits in an instruction Includes opcode and includes implicit or explicit operand(s). It must indicate the addressing mode for each operand. For most instruction sets, more than one instruction format is used. Usually there are several instruction formats in an instruction set Huge variety of instruction formats have been designed; they vary widely from processor to processor 10

INSTRUCTION LENGTH This is the most basic design issue faced in COA. The decision on the length of instruction is affected by and affects: -Memory size -Memory organization -Bus structure -CPU complexity -CPU speed There are some trade-offs that are related to instruction length. The most basic one is between powerful instruction repertoire and saving space. 11

ALLOCATION OF BITS There is a trade-off between the number of opcodes and the power of the bit addressing capability. Below are factors used in determining the addressing bits Number of addressing modes Number of operands Register versus memory Number of register sets Address range Address granularity 12

Number of addressing modes An addressing mode can be indicated implicitly. For example, certain opcodes might always call for indexing. Also the addressing modes must be explicit, and one or more bits will be needed. Number of operands We saw earlier that fewer addresses can make for complex programs. Computer systems today provide for two operands. Each operand address in the instruction might require its own mode indicator or may have one limited to just one of the address fields. 13

WHAT IS CISC? A complex instruction set computer, CISC, is a microprocessor instruction set architecture (ISA) in which each instruction can execute several low-level operations, such as a load from memory, an arithmetic operation, and a memory store, all in a single instruction. One of the most visible forms of revolution with computers is that of programming languages. As the cost of hardware has dropped the relative cost of software has risen. Complexity of modern software has increased the prevalence of faults(bugs). Hence the major cost in the lifecycle of a system is software. 14

RATIONALE FOR CISC The response from researchers and industry has been to develop ever powerful and complex high level languages. These high level languages allow the programmer to express algorithms more concisely, take care of much of the detail and normally support structured programming and objectoriented design This solution gave rise to another problem know as the semantic gap Some problems cause by this gap include: -Execution inefficiency -Excessive program size -Compiler complexity 15

RATIONALE FOR CISC CONT Designers responded with architectures intended to close this gap. Some key features they considered are; -Large instruction sets -Dozens of addressing modes -Various HLL statements implemented in hardware. Such complex instruction sets are intended to; -Easy the task of the compiler writer -Improve the execution efficiency, because complex sequence of operations can be implemented in microcode -Provide support for even more complex and sophisticated HLLs 16

MOTIVATION FOR CISC Complier simplification: The task of the compiler writer is to generate machine instructions for each HLL statement. Machine instructions that resembles HLL statement simplifies the task to be executed. Smaller Programs: Smaller programs improves performance. They also take up less memory. Smaller programs may mean fewer instructions which implies fewer instruction bytes to be fetched. Improved Performance: A complex HLL operation will execute more quickly as a single machine instruction than as a set of more primitive instructions. This also implies that execution time is increased. 17

WHAT IS RISC? RISC, or Reduced Instruction Set Computer, is a type of microprocessor architecture that utilizes a small, highlyoptimized set of instructions, rather than a more specialized set of instructions often found in other types of architectures. RISC systems have been defined and designed in a variety of ways the elements used by most designs are: -A limited and simple instruction set -A large number of general purpose registers and the use of technology to optimize register usage -An emphasis on the instruction pipeline. 18

CHARACTERISTICS OF RISC One-instruction-per-cycle: RISC machine instructions comprise only one cycle of fetch, execute and store. With simple one-cycle instructions, there is no need for microcode Such instructions should execute faster than comparable machine instructions on CISC machines, as it is not necessary to access a micro program control. Register-to-Register O: If most register operations are register-to-register, this simplifies the instruction set and hence the control unit. It also encourages the optimization of the register use. 19

CHARACTERISTICS OF RISC Simple addressing modes: Almost all RISC instructions use simple register addressing. Complex addressing modes can be synthesized in software from simple ones. This again simplifies the instruction set and the control unit Simple instruction formats: Generally only one of the few formats are used. Instruction length is fixed and aligned on word boundaries. 20

CHARACTERISTICS OF RISC cont Field locations especially the opcodes are fixed. Some benefits include; Simultaneous occurrence of opcode decoding and register operand accessing Simplified formats simplify the control unit Instruction fetching is optimized because word length units are fetched Alignment on word boundary also means that a single instruction does not cross page boundaries 21

These characteristics can be assessed to determine the potential benefits of RISC. They can be grouped into two main categories: performance and VLSI implementation Performance More optimizing compilers can be developed. With more smaller primitive instructions, there are major opportunities for moving functions out of loops, reorganizing codes for efficiency, maximizing register utilization. 22

Performance cont With simple instructions, a relatively simple control unit is required. It is likely that a simple control unit could be made to execute faster than a more complex one. Instruction Pipelining: Researchers believe that this technique can be applied much more effectively with reduced instruction set 23

VLSI IMPLEMENTATION Chip real estate: A CISC processor typically devotes about half of its area to the control unit. A RISC processor typically uses only about 10% of the area for the control unit, using real estate for registers instead Design and implementation time: the simple control unit and circuitry of RISC result in faster design cycles. 24

EXAMPLE OF CISC ISA Intel X86, 386/486/Pentium Has 12 addressing modes Register, immediate, Direct, Base, Base+Displacement, index+displacement etc Operand Sizes Can be 8, 16,32,48,64, 0r 80 bit long. It also support string operations Instruction Encoding Smallest instruction is one byte. Longest instruction is 12 bytes. The first bytes contain opcode, mode specifiers and registers. The reminder bytes caters for address displacement and immediate data 25

EXAMPLE OF RISC ISA PowerPC Has 8 addressing modes Register direct, immediate, Register indirect, Register indirect with immediate index (load and store), Register indirect, Register indirect with register index (load and store), Operand Sizes Has four operands sizes: 1, 2, 4 or 8 bytes Instruction Encoding Instruction set has 15 different formats with many minor variations All are 32 bits in length. 26