Computer Science 210 Computer Organization

Slides:



Advertisements
Similar presentations
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Advertisements

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.
CS25410 Memory Machine Code. Common types of non-rotating memory (1) RAMRandom Access Memory In reality, read/write memory This is usually volatile, meaning.
Chapter 5 The LC-3.
Chapter 4 - ISA 1.The Von Neumann Model. 4-2 The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer.
LC-3 Computer LC-3 Instructions
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
Chapter 9 Overview Traps mechanism & RET Subroutines & JSR & JSRR & RET Interrupt mechanism & RTI.
LC-3 Instruction Set Architecture (Textbook’s Chapter 5)
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter 6 Programming in Machine Language The LC-3 Simulator
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Chapter 9 & 10 Subroutines and Interrupts. JSR Instruction: JSR offset (11 bit) xxxxxxxxxxx [PC ]  R7, JMP Offset Jump to Subroutine at offset.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
LC-3 Instruction Set Architecture
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.
Spring 2007W. Rhett Davis with slight modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 11: Memories,
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-2 Instruction Set Architecture Operate instructions Data Movement instructions.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-3 Instruction Set Architecture ISA Overview Operate instructions Data.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Data Movement Instructions Load --
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.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the.
© BYU LC3-DC Page 1 ECEn 224 LC3-DC Designing The LC-3 Control IR PC enaMARMenaPC enaALU enaMDR ALU AB.
Spring 20067W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 Design of Complex Digital Systems Lecture 11: Data Converter,
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Connecting Hardware to InstructionsConnecting Hardware to Instructions.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the LC-3 Micro-architecture.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Introduction to Computing Systems and Programming The LC-2.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb.
Computer Science 210 Computer Organization Machine Language Instructions: Control.
Computer Science 210 Computer Organization
Chapter 9 TRAP Routines and Subroutines
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
COSC121: Computer Systems: Review
Decode and Operand Read
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
The LC-3 Instruction Set Architecture Data Movement instructions
Computer Science 210 Computer Organization
Introduction to Computer Engineering
LC-3 Details and Examples
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Computer Science 210 Computer Organization
Chapter 9 TRAP Routines and Subroutines
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Chapter 9 TRAP Routines and Subroutines
LC-2: The Little Computer 2
Chapter 9 TRAP Routines and Subroutines
Program Execution.
Example 1: (expression evaluation)
Chapter 9 TRAP Routines and Subroutines
Chapter 9 TRAP Routines and Subroutines
Chapter 5 The LC-3.
Presentation transcript:

Computer Science 210 Computer Organization Machine Language Instructions: Computation

Types of Instructions Operate (computation): NOT, AND, ADD Data movement: LD, LDR, LDI, LEA, ST, STR, STI Control: BR, JMP, JSR, JSRR, RET, RTI, TRAP

Bitwise NOT RDst  NOT RSrc R3  NOT R5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst  NOT RSrc NOT Dst Src 1 1 1 1 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 R3  NOT R5 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 1

Data Path for NOT RDst  NOT RSrc 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 NOT Dst Src 1 1 1 1 1 1 RDst  NOT RSrc

Bitwise AND (2 flavors) RDst  RSrc1 AND RSrc2 RDst  RSrc1 AND Data 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst  RSrc1 AND RSrc2 AND Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst  RSrc1 AND Data AND Dst Src1 1 imm5 Data is the sign-extend of imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Clear R1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 0 0

ADD (2 flavors) RDst  RSrc1 ADD RSrc2 RDst  RSrc1 ADD Data 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst  RSrc1 ADD RSrc2 ADD Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst  RSrc1 ADD Data ADD Dst Src1 1 imm5 Data is the sign-extend of imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Increment R1 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1

Data Path for AND/ADD (register mode) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 AND Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD Dst Src1 0 0 0 Src2 RDst  RSrc1 AND RSrc2 0 bit means register mode RDst  RSrc1 ADD RSrc2

Data Path for AND/ADD (immediate mode) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 AND Dst Src1 1 imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD Dst Src1 1 imm5 RDst  RSrc1 AND Data 1 bit means immediate mode RDst  RSrc1 ADD Data

Other Useful Operations Decrement the contents of a given register Copy the contents of RA to RB Subtract RB from RA and store the result in RC

The LC-3 Simulator Various versions, ours comes from U Texas Supports assembly, loading of object files, and visualized execution Next, Step, Finish, Continue, Stop Can edit PC, registers, and memory

Using the Simulator Run /opt/lc3tools/lc3sim-tk Enter instructions starting at x3000 Set PC to x3000, then Next or Continue

Memory access: load and store instructions For Wednesday Memory access: load and store instructions