UConn CSE 241 1 CSE241: Instruction Level Architecture Base CPU/Memory Architecture Registers Fetch-Execute Cycle Instructions Addressing Modes.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
There are two types of addressing schemes:
Damian BrowneLuis PabonPedro Tovar The operation of a computer in executing a program consists of a sequence of Instruction Cycles, with one machine.
Computer Organization and Architecture
Instruction Set Architecture & Design
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Execution of an instruction
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Memory - Registers Instruction Sets
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
LAB 9 Simulator Chap 14 REED. Datapath Simulator accompanying the text is a datapath simulator a.k.a. the Knob & Switch Computer developed by Grant Braught.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
The Microarchitecture Level The level above the digital logic level is the microarchitecture level.  Its job is to implement the ISA (Instruction Set.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Some material taken from Assembly Language for x86 Processors by Kip Irvine © Pearson Education, 2010 Slides revised 2/2/2014 by Patrick Kelley.
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
Machine Instruction Characteristics
Memory and Addressing How and Where Information is Stored.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
CPU How It Works. 2 Generic Block Diagram CPU MemoryInputOutput Address Bus Data Bus.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Computer Architecture And Organization UNIT-II General System Architecture.
Execution of an instruction
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Computer Architecture Lecture 03 Fasih ur Rehman.
September 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 2: Implementation of a Simplified Computer Jeremy R. Johnson Wednesday,
8086 Internal Architecture
Computer Organization 1 Instruction Fetch and Execute.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Jeremy R. Johnson William M. Mongan
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Lec 4-2 Five operations of the machine cycle Fetch- fetch the next program instruction from memory. (PC+1); instruction to IR Decode- decode the instruction.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Computer Architecture
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
Control Unit Operation
Control Unit Lecture 6.
Computer Science 210 Computer Organization
The Processor and Machine Language
Computer Science 210 Computer Organization
Functional Units.
CSCE Fall 2013 Prof. Jennifer L. Welch.
Computer Architecture and the Fetch-Execute Cycle
Introduction to Micro Controllers & Embedded System Design
CSCE Fall 2012 Prof. Jennifer L. Welch.
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
ECE 352 Digital System Fundamentals
Basic components Instruction processing
Instruction execution and ALU
Presentation transcript:

UConn CSE CSE241: Instruction Level Architecture Base CPU/Memory Architecture Registers Fetch-Execute Cycle Instructions Addressing Modes

UConn CSE Basic CPU Architecture CPU Control Path -instruction fetch and execution sequencing Data Path -user registers and ALU MARMDR Memory Data Bus Memory Address Bus

UConn CSE CPU Divisions Control Path responsible for instruction fetch and execution sequencing responsible for operand fetch responsible for saving results Data Path contains user registers contains ALU “executes” instructions

UConn CSE Control Path Registers PC Program Counter –points to the next instruction to be executed –thus, it contains a memory address MAR Memory Address Register –contains the address of the memory location for the current memory operation MDR Memory Data Register –contains the data to be written to or the data read from the memory location in the current memory operation IRInstruction Register –contains the current instruction being executed

UConn CSE Memory Organization Data is stored as sequences of bits --basic grouping is the byte -- 8 bits Bytes are grouped into words --words may be 2 (older), 4 (current) or 8+ (modern) bytes long The byte is the basic unit for addressing memory. However, our life will be simplified if we adopt the word as the basic unit. The size of memory (almost always in bytes) is usually given by S = 2 p, where p = word size of machine (but this may be machine dependent)

UConn CSE Memory Organization Word size = 16, memory size = (64KB) Word size = 20, memory size = (1MB) Word size = 32, memory size = (4GB) Word size = 64, memory size = x10 19 this is ? bytes?

UConn CSE Memory Organization MAR MDR 512 Recall: MAR contains the address of the memory location addressed MDR either contains data to be written to that address, or data read from that address Memory is viewed as an array of bytes. Addresses start at 0 and increase by 1 up to maximum size 0 1

UConn CSE Memory operations Memory Read –Place address of memory location to be read into MAR –Issue a Memory_Read command to memory –Data read from memory is placed into MDR automatically (by control logic) Memory Write –Place address of memory location to be written to into MAR –Place data to be written into MDR –Issue Memory_Write command to memory –Data in MDR is written to memory automatically (by control logic)

UConn CSE Fetch-Execute Cycle Basic machine cycle; repeats indefinitely Do until halted –Fetch instruction to be executed –(Decode instruction) –Fetch operands –Point PC to next instruction to be executed –Execute instruction –Save result operand

UConn CSE Instruction Types There are 4 basic instruction types (3 basic) –Data movement instructions these move but do not alter data –ALU instructions these alter (operate upon) data –Flow of Control instructions these sequence instructions –Input-Output instructions these transfer data to and from the real world note that these may get classed as Data movement

UConn CSE Operands Operands are the entities operated upon by instructions Operands may be stored in memory Operands may be stored in CPU registers Both memory and CPU registers have addresses Specifying the address of an operand in an instruction is called an addressing mode

UConn CSE Instruction Types by Function (Examples) data movement –mov a,b a = b; ALU –add a,b a = a + b; sequencing –jsr label jump to the subroutine which starts at label I/O –in r5, portread from io port “port” to register 5

UConn CSE Instruction Types by Operands As well as being distinguished by type, instructions can be distinguished by the number of operands they have Typically, instructions may have 3,2,1 or 0 operands 3-operand instructions are almost always instructions which implement binary operations e.g., –adda,b,c a = b + c 2-operand instructions are like 3-operand instructions, but one operand serves as both a source and a destination, e.g. –adda,b a = a+b 1-operand instructions are instructions which only require one operand –clra a = 0 0-operand instructions do not operate on operands e.g. –hlthalt the computer

UConn CSE Source and Destination Operands An operand is called a source operand if –it appears on the right-hand side of an expression e.g., add a,b meaning a = a + b –b is a source operand, as is a An operand is called a destination operand if –it appears on the left-hand side of an expression e.g.,add a,b meaning a = a + b –a is a destination operand Some operands may be both source and destination operands (a above)

UConn CSE Data encoding Data (strings of bits) in a machine may represent unsigned integers signed integers instructions character data floating point data abstract data etc. addresses What any particular string of bits “means” depends on how that string of bits gets interpreted The same string of bits is interpreted as an address by the MAR, an instruction by the IR, or a floating-point number by the FPU.

UConn CSE Instruction Encoding An instruction must encode –the instruction itself –the (or a partial) address of its operand(s) –the addressing mode used to generate the address of its operand(s) Instructions can be encoded in –a variable number of bytes –a constant number of bytes this is machine-dependent

UConn CSE Instruction-level architecture the architecture of the machine at this level consists of –the instructions and addressing modes –the user registers this is the “level” of the machine that an assembly-language programmer sees. It is the first “obvious” place where different machines can be seen to clearly differ Compare this to the “application program” architecture, as seen by (say) a C++ programmer; how different is a Pentium to a PowerPC at this level (discount the different OSs)

UConn CSE Basic Addressing Modes There are five basic addressing modes –Immediate addressing the instruction contains the operand itself –Register addressing the instruction refers to a register which contains the operand –Direct addressing the instruction contains the address of the operand –Indirect addressing the instruction contains the address of the address of the operand –Indexed addressing the instruction contains a value to be added to an index register to give the address of the operand

UConn CSE Simple Model Suppose we consider only 1-operand instructions Suppose each instruction occupies 2 32-bit words The first word identifies the instruction (and addressing mode) The second word gives the operand address

UConn CSE Direct Addressing Before After clear value in second word is direct address of operand; value in location is operand memory

UConn CSE Indirect Addressing clear value in second word is indirect address of operand; value in location is address of operand memory Before After

UConn CSE Indexed Addressing clear indexed R3 100 R = Before After

UConn CSE Mixed modes? Indexed indirect? It is possible to mix addressing modes We could define an indexed indirect But note that we could have two ways of implementing this indexing before indirection indexing after indirection

UConn CSE Indirect Indexed mode (preindexing) clear indexed R3 100 R = this is the address of the address of the operand Before After

UConn CSE Indirect Indexed Mode (postindexing) clear indexed R3 100 R =1024 this is the address of the operand Before After