Topic 6 LC-3.

Slides:



Advertisements
Similar presentations
Processor Data Path and Control Diana Palsetia UPenn
Advertisements

The Fetch – Execute Cycle
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Central Processing Unit
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Execution of an instruction
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Basic Computer Organization, CPU L1 Prof. Sin-Min Lee Department of Computer Science.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-2 Instruction Set Architecture Operate instructions Data Movement instructions.
Computer Science 210 Computer Organization The von Neumann Architecture.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
Computer Architecture and the Fetch-Execute Cycle
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Chapter 4 The Von Neumann Model
The von Neumann Model – Chapter 4
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Execution of an instruction
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
Fetch-execute cycle.
Computer Architecture Lecture 03 Fasih ur Rehman.
Computer Systems Organization
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
© BYU LC3-DC Page 1 ECEn 224 LC3-DC Designing The LC-3 Control IR PC enaMARMenaPC enaALU enaMDR ALU AB.
Our programmer needs to do this !
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Chapter 4 The Von Neumann Model
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Click to edit Master title style Click to edit Master text styles – –Second level Third level – –Fourth level » »Fifth level 1 – –Second level Third level.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
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.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Implementing Instructions
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
The LC-3 Instruction Set Architecture Data Movement instructions
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Functional Units.
Computer Organization and ASSEMBLY LANGUAGE
Design of the Control Unit for One-cycle Instruction Execution
Introduction to Computer Engineering
The Von Neumann Model Basic components Instruction processing
Computer Architecture and the Fetch-Execute Cycle
The Little Man Computer
PZ01C - Machine architecture
Computer Architecture
Chapter 4 The Von Neumann Model
The Stored Program Computer
Program Execution.
Drawbacks of single cycle implementation
Basic components Instruction processing
Information Representation: Machine Instructions
Introduction to Computer Engineering
Computer Architecture
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

Topic 6 LC-3

Notations Sets of Bits Bit Assignment A[3:0] denotes a set of 4 bits: A0, A1, A2, A3 The content of an n-bit register R is referred to as R[n-1:0] Rn-1 is the most significant bit (MSB), or leftmost bit R0 is the least significant bit (LSB), or rightmost bit Given R[31:0], R[7:4] refers to the four bits from R4 to R7 Bit Assignment R[5:0]  I[13:8] Means that bits 5 to 0 of register R get assigned the values of bits 13 to 8 of register I.

The LC-3 Data and Control Paths

LC 3 Instructions Instruction word: 16 bits Examples Opcode Operands defines (names) the instruction to be executed bits[15:12]: 4 bits allow 16 instructions Operands Registers: 8 registers (i.e. require 3 bits for addressing) Address parameters: Offset (9 bits) or Index (6 bits) (more later) Immediate value: 5 bits Examples ADD DR, SR1, SR2 ; DR  (SR1) + (SR2) [15:12] [11:9] [8:6] [2:0] - Note: (Reg1) means “content of Reg1” LDR DR, BaseR, Offset ; DR  Mem[BaseR + Offset] [15:12] [11:9] [8:6] [5:0] - Note: Mem[loc] means “content of memory location loc”

Instruction Cycle - 1 Six phases (steps) Fetch: load IR with instruction from memory Decode: determine action to take (which instructions) Evaluate address: compute memory address of operands, if any Fetch operands: read operands from memory or registers Execute: perform instruction Store results: write result to destination (register or memory)

Instruction Cycle - 2 Fetch Decode This actually takes several steps, represented here as “micro- instructions”, each of which can take a number of machine cycles to implement: MAR  (PC) ; use the value in PC to access memory MDR  Mem[MAR] ; read memory location to MDR IR  (MDR) ; move (MDR) to IR PC (PC) + 1 ; increment the value of PC Decode A decoder reads the opcode bit pattern & sets up the next state of the machine to appropriately use the remaining bits of the instruction.

Instruction Cycle - 3 Evaluate Address Fetch Operands Computes the address of the memory location required to process the instruction (if any): e.g. the location from which to obtain a value. This is known as the Effective Address (EA). Fetch Operands Obtains the source operand(s) (if any) either from Registers or from memory, i.e. from the EA calculated in the previous step.

Instruction Cycle - 4 Execute Store Result Start over … Carries out the execution of the instruction - e.g. add two operands present at the input of the ALU Store Result Writes the result (if any) to its designated destination, either register or memory (using the EA calculated earlier) Start over … Recall that the PC was incremented already in the first step, so the next Fetch will bring back the next instruction - unless the instruction just executed changed the PC.

Instruction Cycle - 5 Some instructions don't need all 6 phases If only using registers, skip Evaluate Address If only moving data, skip Execute Control Instructions These change the sequence of instructions Branch Loop Function or procedure call Execute phase changes the content of the PC, so the next instruction will be out of sequence.