The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP 2620.

Slides:



Advertisements
Similar presentations
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Advertisements

Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
MIPS Assembly Tutorial
Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
INSTRUCTION SET ARCHITECTURES
Topics covered: CPU Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Chapter 5 The LC-3.
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
State Machines Used to Design Sequential Circuits.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Machine Instruction Characteristics
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Chapter 4 MARIE: An Introduction to a Simple Computer.
Chapter 4 The Von Neumann Model
The von Neumann Model – Chapter 4
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
Execution of an instruction
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Chapter 4 The Von Neumann Model
Computer Organization Instructions Language of The Computer (MIPS) 2.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
A Closer Look at Instruction Set Architectures
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
A Closer Look at Instruction Set Architectures
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
Chapter 5 The LC-3.
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Topic 6 LC-3.
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
LC-2: The Little Computer 2
The Stored Program Computer
CPU Structure CPU must:
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP 2620

The LC-3 So far, we’ve discussed the basic parts of a computer: memory, processing unit, control unit, I/O devices We also looked at the six phases of the instruction cycle: FETCH, DECODE, EVALUATE ADDRESS, OPERAND FETCH, EXECUTE, and STORE RESULT

The LC-3 We now want to introduce a “real” computer, the LC-3 We are going to introduce the instruction set architecture (ISA) of the LC-3 We have looked at some of it before We will examine it now in a comprehensive way

The LC-3 Recall the ISA is the interface between software commands and what the hard carries out We will discuss the features of the LC-3 and now to write programs in LC-3’s own language – LC-3’s machine language

The ISA: Overview The ISA specifies all the information about the computer the software has to be aware of It tells you what commands you can issue Also used when you translate from a high level language to machine language The ISA also specifies the memory organization, registers, and instruction set

Memory Organization The LC-3 memory has an address space of 216 locations and the addressability of 16 bits Not all 65536 locations are used for memory We will discuss it further in Chapter 8 We refer to 16 bits as one word since the LC-3 works 16 bit units We also say it is word-addressable

Registers The LC-3 provides high speed temporary storage This is because memory requires more than one machine cycle to access memory The most common types of temporary storage is the general purpose register set Each register in the set is called a general purpose register (GPR)

Registers Registers have the same properties as memory for storing information The number of bits available in each register is one word That is, on the LC-3, they are 16 bits

Registers Each register must be uniquely identifiable The LC-3 has 8 GPRs, each identified by a 3 bit register number They are referred to as R0, R1, R2,…,R7 Consider a snapshot of LC-3’s register set, called a register file with values 1,3,5,6,-2, -4,-6,-8 stores in R0-R7 respectively

Registers Register 0 (R0) 0000000000000001 Register 1 (R1) 0000000000000011 Register 2 (R2) 0000000000000101 Register 3 (R3) 0000000000000111 Register 4 (R4) 111111111111111110 Register 5 (R5) 111111111111111100 Register 6 (R6) 111111111111111010 Register 7 (R7) 111111111111111000

Registers Recall the ADD instruction: 15 14 13 12 11 10 9 8 7 6 5 4 3 ADD R2 R0 R1

Registers Register 0 (R0) 0000000000000001 Register 1 (R1) 0000000000000011 Register 2 (R2) 0000000000000100 Register 3 (R3) 0000000000000111 Register 4 (R4) 111111111111111110 Register 5 (R5) 111111111111111100 Register 6 (R6) 111111111111111010 Register 7 (R7) 111111111111111000

Instruction Set An instruction is made of two parts: Opcode – what the instruction does Operands- what the instructions acts upon The ISA is defined by the set of opcodes, data types, and addressing modes The addressing modes determine where the operands are located The ADD is an example of a register mode addressing mode

Opcodes The number of opcodes vary considerably between different architectures Some have a lot of opcodes, which other contain relatively few For example, the HP Precision Architecture (HP-PA) has an instruction that combines multiply with add: (AxB)+C

Opcodes The Intel x86 ISA has MMX instructions because they extend the ISA to help with multimedia The decision on what instructions include are hotly debated usually at design time

Opcodes The LC-3 has 15 instructions, each with a unique opcode The opcode is specified in bits [15:12] of the instruction Since there are 4 bits used, there are 16 possible opcodes Code 1101 has been left unspecified for now

Opcodes There are three different types of opcodes: Operates – process information Data movement – moves information between registers and memory or input/output devices Control – change sequence of execution

Opcodes

Data Types A data type is a representation of information so the ISA has opcodes that operate on that representation If the ISA has an opcode that operates on info represented by a data type, then we say the ISA supports the data type The only support data type on the LC-3 is two’s complement integers

Addressing Modes An addressing mode is a way of specifying where an operand is located There are three places for operands: Memory Registers Part of the instruction

Addressing Modes If the operand is part of the instruction, we refer to it as a literal or immediate operand The term literal comes from the fact the bits of the instruction literally form the operand The term immediate comes from the fact we have the operand immediately – we do not look for it elsewhere

Addressing Modes The LC-3 has 5 addressing modes: Immediate Register Three memory addressing modes: PC-relative Indirect Base+Offset

Condition Codes All ISAs allow execution to change based on the result of a previous instruction The LC-3 has three single bit that are set (1) or cleared (0) each time one of the GPRs are written to

Condition Codes The three bit registers are N – negative Z – zero P – positive These correspond to whether the written result was positive, negative, or zero Only one of them are set at any given time

Condition Codes These three single registers are referred to as condition codes They are called this since they are used by control instructions to influence sequence of execution