Register Files. Single Bus Architecture. Register Files. Single Bus Processor. Term Project: using VHDL. Accumulator based architecture

Size: px
Start display at page:

Download "Register Files. Single Bus Architecture. Register Files. Single Bus Processor. Term Project: using VHDL. Accumulator based architecture"

Transcription

1 Register Files DR 3 SelS Design and simulate the LC-3 processor using VHDL Term Project: Single Processor Decoder... R R3 R mux mux S S SelDR 3 DRin Clock 3 SelS LC-3 Architecture 3 Register File consists of 8 registers: Two -bit output busses: S and S One -bit input bus: DR Register is selected by: SelS selects the register to put on S SelS SelS selects the register to put on S SelDR selects the register to be written via DR when DRin is Behaves as a combinational logic block: SelS or SelS valid => S or S valid after access time. SelS SelDR DR Register Files 3 SelS 3 S SelS 3 SelDR S DR CLK DRin S S Accumulator based architecture R R3 R6 SelS ALUop Single Architecture SelS LC-3 Architecture 2 LC-3 Architecture 4

2 Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization address space -- how may locations can be addressed? addressibility -- how many bits per location? register set how many? what size? how are they used? instruction set opcodes data types addressing modes ISA provides all information needed for someone that wants to write a program in machine language (or translate from a high-level language to machine language). Opcodes 5 opcodes Operate instructions:, AND, NOT Instruction Set Data movement instructions: LD, LDI, LDR, LEA, ST, STR, STI instructions: BR, JSR, JMP, RET, TRAP some opcodes set/clear condition codes, based on result: N = negative, Z = zero, C = carry Data Types -bit 2 s complement integer Addressing Modes How is the location of an operand specified? non-memory addresses: immediate, register memory addresses: -relative, indirect, base+offset LC-3 Architecture 5 LC-3 Architecture 7 and Registers address space: 2 locations (-bit addresses) addressability: bits Registers temporary storage, accessed in a single machine cycle accessing memory generally takes longer than a single cycle eight general-purpose registers: R - each bits wide is used to store the return address in subroutine jump how many bits to uniquely identify a register? other registers not directly addressable, but used by (and affected by) instructions (program counter), (condition codes), (memory address register), (memory data register) Data Processing Instructions Only three operations:, AND, NOT Source and destination operands are registers These instructions do not reference memory. and AND can use immediate mode, where one operand is hard-wired into the instruction. LC-3 Architecture 6 LC-3 Architecture 8

3 Data Movement Instructions Load -- read data from memory to register LD: -relative mode LDR: base+offset mode LDI: indirect mode Store -- write data from register to memory ST: -relative mode STR: base+offset mode STI: indirect mode Load effective address -- compute address, save in register LEA: immediate mode does not access memory Branch specifies one or more condition codes. If the set bit is specified, the branch is taken. -relative addressing: target address is made by adding signed offset ([8:]) to current. Note: has already been incremented by FETCH stage. Note: Target must be within 256 words of BR instruction. If the branch is not taken, the next sequential instruction is executed. Branch I nstruction x3 R3 2 YES =? NO M[] R3 R LC-3 Architecture 9 LC-3 Architecture Instructions Used to alter the sequence of instructions (by changing the Program Counter) Conditional Branch : BR[nzc] branch is taken if a specified condition is true signed offset is added to to yield new else, the branch is not taken is not changed, points to the next sequential instruction Unconditional Branch : JMP, JSR, RET always changes the LC-3 has three condition code registers: N -- negative Z -- zero C -- carry Condition Codes Set by any instruction that writes a value to a register (, AND, NOT, LD, LDR, LDI, LEA) Exactly one will be set at all times Based on the last instruction that altered a register TRAP changes to the address of an OS service routine routine will return control to the next instruction (after TRAP) LC-3 Architecture LC-3 Architecture 2

4 Instruction Format Immediate Addressing Mode Immediate field is sign-extended opcode reg reg reg opcode reg reg offset5 opcode reg reg offset6 opcode reg offset9,, # SEXT R R3 R6 opcode reg opcode offset opcode offset8 LC-3 Architecture 3 LC-3 Architecture 5 NOT R3, Register Addressing Modes NOT R3 R R3 R6 -Relative Addressing Mode Want to specify address directly in the instruction But an address is bits, and so is an instruction! After subtracting 4 bits for opcode and 3 bits for register, we have 9 bitsavailable for address. Solution: Use the 9 bits as a signed offset from the current. NOT 9 bits: 256 offset Can form any address X, such that: 256 X Remember that is incremented as part of the FETCH phase; This is done before the EVALUATE RESS stage. LC-3 Architecture 4 LC-3 Architecture

5 LD, xaf -Relative Addressing Mode Base + Offset Addressing Mode LDR,, xd LD xaf 9 SEXT R R3 R6 R LDR xd 6 SEXT R3 R6 LC-3 Architecture 7 LC-3 Architecture 9 Base + Offset Addressing Mode With -relative mode, can only address data within 256 words of the instruction. What about the rest of memory? Solution #2: Use a register to generate a full -bit address. 4 bits for opcode, 3 for src/dest register,3 bits for base register -- remaining 6 bits are used as a signed offset. Offset is sign-extended before adding to base register. Indirect Addressing Mode With -relative mode, can only address data within 256 words of the instruction. What about the rest of memory? Solution #: Read address from memory location, then load/store to that address. First address is generated from and (just like relative addressing), then content of that address is used as target for load/store. LC-3 Architecture 8 LC-3 Architecture 2

6 LDI R3, x Indirect Addressing Mode LDI R3 x 9 SEXT R R6 Instruction Set Operation opcode Example Macro-operation Addressing mode Data Processing Data Movement NOT, ~ Register AND,, R3 & R3 Register AND,, #x2 & x2 Immeadate,, R3 + R3 Register,, #x2 + x2 Immeadate LD, x23 M[+x23] Relative LDR,, x2 M[+x2] Base-Offset LDI, x23 M[ M[+x23] ] Indirect LEA, x23 + x23 Relative ST, x23 M[+x23] Relative STR,, x2 M[+x2] Base-Offset STI, x23 M[ M[+x23] ] Indirect Program BR[nzc] x23 If [nzc] + x23 Relative JMP Register JSR ; Register JSR x23 ; + x23 Relative RET Implicit LC-3 Architecture 2 LC-3 Architecture 23 BR N Z C offset9 -Relative DR SR S Register DR S Imm5 Immediate LD DR offset9 -Relative ST Rs offset9 -Relative JSR Base Base register offset -Relative AND DR SR S Register DR S Imm5 Immediate LDR DR Base offset6 Base+offset STR Rs Base offset6 Base+offset NOT DR Rs Register LDI DR offset9 Indirect STI Rs offset9 Indirect JMP Base Base register RET register LEA DR offset9 -Relative TRAP TrapVector8 Psudo-Direct Instruction Set Sample Program Address Instruction Comments x3 x3 (+xff) x3 R3 x32 x33 2 If Z, goto x3a x34 (+5) x35 Load next value to x36 Add to R3 x37 Increment (pointer) Decrement X38 (counter) x39 Goto x34 (-6) LC-3 Architecture 22 LC-3 Architecture 24

7 Program ( of 2) Address Instruction Comments x3 (counter) x3 R3 M[x32] (ptr) x32 Input to R (TRAP x23) x33 M[R3] x34 4 (EOT) Accumulator based architecture R R3 R6 SelS Single Architecture SelS x35 If Z, goto x3e x36 NOT x37 + X38 + R ALUop x39 If N or C, goto x3b LC-3 Architecture 25 LC-3 Architecture 27 Program (2 of 2) Address Instruction Comments x3a + x3b R3 R3 + x3c x3d x3e x3f M[R3] Goto x34 R M[x33] R R + x3 Print R (TRAP x2) x3 HALT (TRAP x25) X32 Starting Address of File x33 ASCII x3 ( ) LC-3 Architecture 26 Basic Single Architecture in R in R6 SelS SelS out in Sel in LC-3 Architecture 28 out bus

8 Register Transfer Logic Register Transfer Logic [5:2] M[] NOT DR ~SR Set BR [:9]&NZC False True +([8:]) AND [5] DR S&S Set DR S&([4:]) Set JMP Base JSR [] Base +([:]) [5] DR S+S Set DR S+([4:]) Set RET TRAP ZExt[[7:]] M[] LC-3 Architecture 29 LC-3 Architecture 3 Register Transfer Logic Instruction Cycle LD +([8:]) M[] DR Set LDI +([8:]) M[] LDR LEA ST STI Base+([5:]) DR +([8:]) Set M[] M[] DR Set DR Set +([8:]) SR M[] +([8:]) M[] Fetch cycle + M[] Execute cycle Execute, AND, NOT, LD, LDI, LDR, LEA, ST, STI, STR, BR JMP, JSR/JSRR, RET, TRAP STR SR M[] Base+([5:]) SR M[] [5:2] LC-3 Architecture 3 LC-3 Architecture 32

9 Architecture NOT (Register) Architecture R in Sel in R6 SelS SelS out R in Sel in R6 SelS SelS out in Sel in out bus DR SR in NOT in Sel in out bus LC-3 Architecture 33 LC-3 Architecture 35 NOT Dst Src NOT (Register) [5:2] NOT DR ~SR Set Dst Src AND Dst Src / AND (Register) this zero means register mode [5:2] [5]= AND DR S&S DR S+S Set Note: Src and Dst could be the same register. LC-3 Architecture 34 LC-3 Architecture 36

10 / AND (Register) Architecture R in Sel in R6 x DR SR S in SelS /AND in SelS out in Sel out bus / AND (Immediate) Architecture R in Sel in R6 x DR S Imm5 in SelS Sel /AND in SelS out Sel in Sel out bus LC-3 Architecture 37 LC-3 Architecture Dst Scr Imm AND Dst Src Imm5 Note: Immediate field is sign-extended. / AND (Immediate) this zero means immediate mode [5:2] [5]= AND DR S&([4:]) DR S+([4:]) Set LD Dst offset9 LD (-Relative) LD [5:2] +([8:]) M[] DR Set LC-3 Architecture 38 LC-3 Architecture 4

11 LD (-Relative) Architecture R in Sel in R6 DR offset9 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 4 out bus LDI (Indirect) Architecture R in Sel in R6 DR offset9 in SelS Sel NOT AND Tr in SelS out Sel in Sel LC-3 Architecture 43 out bus LDI (Indirect) LDR (Base+Offset) LDI Dst offset9 LDR Dst Base offset6 [5:2] [5:2] LDI LDR +([8:]) Base+([5:]) M[] M[] DR Set M[] DR Set LC-3 Architecture 42 LC-3 Architecture 44

12 LDR (Base+Offset) Architecture R in Sel in R6 DR BR Offset6 in SelS Sel NOT AND Tr in SelS out Sel in Sel LC-3 Architecture 45 out bus LEA (-Relative) Architecture R in Sel in R6 DR offset9 in SelS Sel NOT AND Tr in SelS out Sel in Sel LC-3 Architecture 47 out bus LEA (-Relative) ST (-Relative) LEA Dst offset ST Scr offset9 [5:2] [5:2] LEA ST DR +([8:]) Set +([8:]) SR M[] LC-3 Architecture 46 LC-3 Architecture 48

13 ST (-Relative) Architecture R in Sel in R6 SR offset9 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 49 out bus STI (Indirect) Architecture R in Sel in R6 SR offset9 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 5 out bus STI (Indirect) STR (Base+Offset) STI Src offset9 STR Src Base offset6 [5:2] [5:2] STI STR +([8:]) Base+([5:]) M[] SR M[] SR M[] LC-3 Architecture 5 LC-3 Architecture 52

14 STR (Base+Offset) Architecture R in Sel in R6 SR BR Offset6 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 53 out bus BR (-Relative) Architecture R in Sel in R6 NZC offset9 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 55 out bus BR (-Relative) JMP (Register) BR N Z C offset9 Jump is an unconditional branch -- always taken. Target address is the contents of a register. Allows any target address. [5:2] BR [:9]&NZC False JMP Base True +([8:]) [5:2] JMP Base What LC-3 happens Architecture if bits [:9] are all zero? All one? 54 LC-3 Architecture 56

15 JMP (Register) Architecture R in Sel in R6 BR in SelS Sel in SelS out Sel in Sel LC-3 Architecture 57 out bus JSR (Register) Architecture R in Sel in R6 BR in SelS Sel in SelS out Sel in Sel LC-3 Architecture 59 out bus JSR Base JSR offset JSR (Register/ -Relative) Base [5:2] JSR [] +([:]) LC-3 Architecture 58 JSR (-Relative) Architecture R in Sel in R6 offset in SelS Sel in SelS out Sel in Sel LC-3 Architecture 6 out bus

16 RET (Register) TRAP RET TRAP TrapVector8 [5:2] RET Calls a service routine, identified by 8-bit trap vector. vector routine x23 input a character from the keyboard x2 output a character to the monitor x25 halt the program When routine is done, is set to the instruction following TRAP. TRAP [5:2] ZExt[[7:]] M[] LC-3 Architecture 6 LC-3 Architecture 63 RET (Register) Architecture TRAP Architecture R in Sel in R6 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 62 out bus R in Sel in R6 in SelS Sel in SelS out Sel in Sel LC-3 Architecture 64 out bus

17 Complete RTL -mapped Input [5:2] M[] ; NOT AND LD LDI LDR DR ~SR; Set [5] [5] DR S&S; Set DR S&([4:]); Set DR S+S; Set DR S+([4:]); Set +([8:]) M[] DR ; Set +([8:]) M[] M[] DR ; Set Base+([5:]) M[] DR ; Set in Address Logic KBSR KBDR Input ST +([8:]) SR M[] STI STR LEA +([8:]) M[] SR M[] Base+([5:]) SR M[] DR +([8:]); Set BR [:9]&NZC +([8:]) JMP Base JSR [] Base RET +([:]) Sel in out TRAP ZExt[[7:]] M[]; LC-3 Architecture 65 LC-3 Architecture 67 Complete Architecture -mapped Output R in Sel in R6 in SelS Sel NOT AND Tr in SelS out Sel in Sel out bus Sel in out in Address Logic DSR DDR Output LC-3 Architecture 66 LC-3 Architecture 68

18 -mapped I/O revisited Keyboard Echo: combine the above in Sel in Address Logic Address Logic Input KBSR KBDR DSR DDR Output START LDI,KBSR ;Loop if KB not ready BRzp START LDI R,KBDR ;Get character ECHO LDI,CRTSR ;Loop if monitor not ready BRzp ECHO STI R,CRTDR ;Send character BR NEXT_TASK KBSR.FILL xfe ;Address of KBSR KBDR.FILL xfe2 ;Address of KBDR DSR.FILL xfe4 ;Address of DSR DDR.FILL xfe6 ;Address of DDR out LC-3 Architecture 69 LC-3 Architecture 7 Simple Polling Routines START LDI, A ;Loop if Ready not set BRzp START LDI R, B ;If set, load char to R BR NEXT_TASK A.FILL xfe ;Address of KBSR B.FILL xfe2 ;Address of KBDR Input a character from keyboard START LDI, A ;Loop if Ready not set BRzp START STI R, B ;If set, send char to DDR BR NEXT_TASK A.FILL xfe4 ;Address of DSR B.FILL xfe6 ;Address of DDR Example: Print a string LEA, STR ;Load address of string LOOP LDR R,, # ;get next char to R BRZ DONE ;string ends with LP2 LDI R3, DSR ;Loop until MON is ready BRzp LP2 STI R, DDR ;Write next character,, # ; Set address to next char BR LOOP STR.STRINGZ "Char String" DONE HALT Output a character to the monitor LC-3 Architecture 7 LC-3 Architecture 72

19 Complete Architecture Complete Architecture (MUX version) R in Sel in R6 in SelS Sel NOT AND Tr in SelS out Sel in Sel LC-3 Architecture 73 out bus R in Sel in R6 in SelS Sel NOT AND Tr in SelS Sel Sel Sel in LC-3 Architecture 75 2 bus Finite State Machine [5:2] out, in Read, SelMDT=, in Pcout, in, Sel=, in NOT AND LD LDI LDR LEA ST STI SelS=S, SelSrc=, NOT,, SelDR=DR, Drin, in [5] SelS=S, SelSrc=, SelS=S, Sel=, AND,, SelDR=DR, Drin, in SelS=S, SelSrc=, =5, Sel=, AND,, SelDR=DR, Drin, in [5] SelS=S, SelSrc=, SelS=S, Sel=, AND,, SelDR=DR, Drin, in SelS=S, SelSrc=, =5, Sel=, AND,, SelDR=DR, Drin, in, in Read, Sel=, in out, SelDR, Drin, Sel=, =9, Sel=,, in Sel=, =9, Sel=,,, in Read, Sel=, in out, in Read, Sel=, in out, SelDR=DR, Drin, in SelS=BR, Sel=, =6, Sel=,,, in Read, Sel=, in out, SelDR=DR, Drin, in Sel=, =9, Sel=,,, SelDR=DR, Drin, in Sel=, =9, Sel=,,, in SelS=SR, Sel=, Tr,, Sel=, in Write SelS=, =9, SelS=,,, in Read, Sel=, in out, in SelS=SR, Sel=, Tr,, Sel=, in Write STR BR JMP SelS=BR, Sel=, =6, Sel=,,, in SelS=SR, Sel=, Tr,, Sel=, in Write [:9]&NZC SelS=BR, Sel=, Tr,, Sel=, in Sel=, =9, Sel=,, Sel=, in JSR Pcout, SelDR=, DRin [] SelS=BR, Sel=, Tr,, Sel=, in RET SelS=, Sel=; Tr,, Sel=, in Sel=, =, Sel=, Add,, Sel=, in TRAP SelEExt=8, Sel=, Tr,, in Read, Sel=, in, out, SelDR=,DRin out, Sel=, in LC-3 Architecture 74

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2 Chapter 5 The LC-3 ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2 Instruction Set Architecture ISA = All of the programmer-visible components

More information

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Chapter 5 The LC-3 Instruction Set Architecture ISA = All of the

More information

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture Introduction to Computer Engineering CS/ECE 252, Spring 200 Prof. David A. Wood Computer Sciences Department University of Wisconsin Madison Chapter 5 The LC-3 Adapted from Prof. Mark Hill s slides Instruction

More information

Computing Layers. Chapter 5 The LC-3

Computing Layers. Chapter 5 The LC-3 Computing Layers Problems Chapter 5 The LC-3 Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Algorithms Language Instruction

More information

EEL 5722C Field-Programmable Gate Array Design

EEL 5722C Field-Programmable Gate Array Design EEL 5722C Field-Programmable Gate Array Design Lecture 12: Pipelined Processor Design and Implementation Prof. Mingjie Lin Patt and Patel: Intro. to Computing System * Stanford EE271 notes 1 Instruction

More information

Instruction Set Architecture

Instruction Set Architecture Chapter 5 The LC-3 Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization address space -- how may locations can be addressed? addressibility

More information

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin Madison Chapter 5 The LC-3 Instruction Set Architecture

More information

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers Chapter 5 The LC-3 Original slides from Gregory Byrd, North Carolina State University Modified slides by C. Wilcox, S. Rajopadhye Colorado State University Computing Layers Problems Algorithms Language

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

Load -- read data from memory to register. Store -- write data from register to memory. Load effective address -- compute address, save in register

Load -- read data from memory to register. Store -- write data from register to memory. Load effective address -- compute address, save in register Data Movement Instructions Load -- read data from memory to register LD: PC-relative mode LDR: base+offset mode LDI: indirect mode Store -- write data from register to memory ST: PC-relative mode STR:

More information

CS 2461: Computer Architecture I

CS 2461: Computer Architecture I Computer Architecture is... CS 2461: Computer Architecture I Instructor: Prof. Bhagi Narahari Dept. of Computer Science Course URL: www.seas.gwu.edu/~bhagiweb/cs2461/ Instruction Set Architecture Organization

More information

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Chapter 5 The LC-3 Announcements Homework 3 due today No class on Monday

More information

LC-3 Instruction Set Architecture

LC-3 Instruction Set Architecture CMPE12 Notes LC-3 Instruction Set Architecture (Textbookʼs Chapter 5 and 6)# Instruction Set Architecture# ISA is all of the programmer-visible components and operations of the computer.# memory organization#

More information

20/08/14. Computer Systems 1. Instruction Processing: FETCH. Instruction Processing: DECODE

20/08/14. Computer Systems 1. Instruction Processing: FETCH. Instruction Processing: DECODE Computer Science 210 Computer Systems 1 Lecture 11 The Instruction Cycle Ch. 5: The LC-3 ISA Credits: McGraw-Hill slides prepared by Gregory T. Byrd, North Carolina State University Instruction Processing:

More information

LC-3 Instruction Set Architecture. Textbook Chapter 5

LC-3 Instruction Set Architecture. Textbook Chapter 5 LC-3 Instruction Set Architecture Textbook Chapter 5 Instruction set architecture What is an instruction set architecture (ISA)? It is all of the programmer-visible components and operations of the computer

More information

Midterm 2 Review Chapters 4-16 LC-3

Midterm 2 Review Chapters 4-16 LC-3 Midterm 2 Review Chapters 4-16 LC-3 ISA You will be allowed to use the one page summary. 8-2 LC-3 Overview: Instruction Set Opcodes 15 opcodes Operate instructions: ADD, AND, NOT Data movement instructions:

More information

Ch. 5: The LC-3. PC-Relative Addressing Mode. Data Movement Instructions. James Goodman!

Ch. 5: The LC-3. PC-Relative Addressing Mode. Data Movement Instructions. James Goodman! 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD + 0001 1 0 00 2 Computer Science 210 s1c Computer Systems 1 2012 Semester 1 Lecture Notes ADD + AND + AND + BR JMP 0001 1 1 imm5 0101 1 0 00 2 0101 1 1 imm5 0000

More information

appendix a The LC-3 ISA A.1 Overview

appendix a The LC-3 ISA A.1 Overview A.1 Overview The Instruction Set Architecture (ISA) of the LC-3 is defined as follows: Memory address space 16 bits, corresponding to 2 16 locations, each containing one word (16 bits). Addresses are numbered

More information

Trap Vector Table. Interrupt Vector Table. Operating System and Supervisor Stack. Available for User Programs. Device Register Addresses

Trap Vector Table. Interrupt Vector Table. Operating System and Supervisor Stack. Available for User Programs. Device Register Addresses Chapter 1 The LC-3b ISA 1.1 Overview The Instruction Set Architecture (ISA) of the LC-3b is defined as follows: Memory address space 16 bits, corresponding to 2 16 locations, each containing one byte (8

More information

The LC-3 Instruction Set Architecture. ISA Overview Operate instructions Data Movement instructions Control Instructions LC-3 data path

The LC-3 Instruction Set Architecture. ISA Overview Operate instructions Data Movement instructions Control Instructions LC-3 data path Chapter 5 The LC-3 Instruction Set Architecture ISA Overview Operate instructions Data Movement instructions Control Instructions LC-3 data path A specific ISA: The LC-3 We have: Reviewed data encoding

More information

LC-3 ISA - II. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 10 February 17, 2011

LC-3 ISA - II. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 10 February 17, 2011 LC- ISA - II Lecture Topics LC- data movement instructions LC- control instructions LC- data path review Lecture materials Textbook 5. - 5.6 Textbook Appendix A. Homework HW due Wednesday February 2 at

More information

Chapter 5 - ISA. 1.The Von Neumann Model. The Stored Program Computer. Von Neumann Model. Memory

Chapter 5 - ISA. 1.The Von Neumann Model. The Stored Program Computer. Von Neumann Model. Memory Chapter 5 - ISA 1.The Von Neumann Model The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer. (or was it John V. Atanasoff in 1939?) Hard-wired program

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof Mark D. Hill and Prof. Gurindar Sohi TAs: Rebecca Lam, Mona Jalal, Preeti Agarwal, Pradip Vallathol Midterm Examination

More information

CIT 593: Intro to Computer Systems Homework #4: Assembly Language Due October 18, 2012, 4:30pm. Name

CIT 593: Intro to Computer Systems Homework #4: Assembly Language Due October 18, 2012, 4:30pm. Name CIT 593: Intro to Computer Systems Homework #4: Assembly Language Due October 18, 2012, 4:30pm Instructions You may print this document and write your answers here, or submit solutions on a separate piece

More information

10/31/2016. The LC-3 ISA Has Three Kinds of Opcodes. ECE 120: Introduction to Computing. ADD and AND Have Two Addressing Modes

10/31/2016. The LC-3 ISA Has Three Kinds of Opcodes. ECE 120: Introduction to Computing. ADD and AND Have Two Addressing Modes University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing The LC-3 Instruction Set Architecture The LC-3 ISA Has Three Kinds of Opcodes

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Mohit Verma, Annie Lin

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Mohit Verma, Annie Lin CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Instructor: Rahul Nayar TAs: Mohit Verma, Annie Lin Examination 4 In Class (50 minutes) Wednesday, May 3rd, 2017 Weight:

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON Prof. Mark D. Hill & Prof. Mikko H. Lipasti TAs Sanghamitra Roy, Eric Hill, Samuel Javner,

More information

Intro. to Computer Architecture Homework 4 CSE 240 Autumn 2005 DUE: Mon. 10 October 2005

Intro. to Computer Architecture Homework 4 CSE 240 Autumn 2005 DUE: Mon. 10 October 2005 Name: 1 Intro. to Computer Architecture Homework 4 CSE 24 Autumn 25 DUE: Mon. 1 October 25 Write your answers on these pages. Additional pages may be attached (with staple) if necessary. Please ensure

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Mikko Lipasti & Prof. Gurinder S. Sohi TAs: Daniel Chang, Felix Loh, Philip Garcia, Sean Franey, Vignyan Kothinti

More information

Memory Usage in Programs

Memory Usage in Programs Memory Usage in Programs ECE2893 Lecture 4a ECE2893 Memory Usage in Programs Spring 2011 1 / 17 The Little Computer 3 (LC3) ECE2893 Memory Usage in Programs Spring 2011 2 / 17 The LC3 Instruction Set,

More information

Chapter 6 Programming the LC-3

Chapter 6 Programming the LC-3 Chapter 6 Programming the LC-3 Based on slides McGraw-Hill Additional material 4/5 Lewis/Martin Aside: Booting the Computer How does it all begin? We have LC-3 hardware and a program, but what next? Initial

More information

CS 135: Computer Architecture I

CS 135: Computer Architecture I What next? : Computer Architecture I Instructor: Prof. Bhagi Narahari Dept. of Computer Science Course URL: www.seas.gwu.edu/~bhagiweb/cs135/ Low level/machine-level Programming Assembly Language programming

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi, Kai Zhao TAs: Yuzhe Ma, Annie Lin, Mohit Verma, Neha Mittal, Daniel Griffin, Examination 4 In Class

More information

Chapter 4 The Von Neumann Model

Chapter 4 The Von Neumann Model Chapter 4 The Von Neumann Model The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer. (or was it John V. Atanasoff in 1939?) Hard-wired program --

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON Prof. Mark D. Hill & Prof. Mikko H. Lipasti TAs Sanghamitra Roy, Eric Hill, Samuel Javner,

More information

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Chapter 8 & 9.1 I/O and Traps Aside Off-Topic: Memory Hierarchy 8-3

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Professor Karthikeyan Sankaralingam TAs: Kamlesh Prakash, Suriyha Balaram Sankari, Rebecca Lam, Newsha Ardalani, and Yinggang

More information

ECE 206, Fall 2001: Lab 3

ECE 206, Fall 2001: Lab 3 ECE 206, : Lab 3 Data Movement Instructions Learning Objectives This lab will give you practice with a number of LC-2 programming constructs. In particular you will cover the following topics: - Load/store

More information

Chapter 4 The Von Neumann Model

Chapter 4 The Von Neumann Model Chapter 4 The Von Neumann Model The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer. (or was it John V. Atanasoff in 1939?) Hard-wired program --

More information

Chapter 9 TRAP Routines and Subroutines

Chapter 9 TRAP Routines and Subroutines Chapter 9 TRAP Routines and Subroutines System Calls Certain operations require specialized knowledge and protection: specific knowledge of I/O device registers and the sequence of operations needed to

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Professor Guri Sohi TAs: Newsha Ardalani and Rebecca Lam Examination 4 In Class (50 minutes) Wednesday, Dec 14, 2011 Weight:

More information

LC-2 Programmer s Reference and User Guide

LC-2 Programmer s Reference and User Guide LC-2 Programmer s Reference and User Guide University of Michigan EECS 100 Matt Postiff Copyright (C) Matt Postiff 1995-1999. All rights reserved. Written permission of the author is required for duplication

More information

ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Mikko Lipasti & Prof. Gurindar S. Sohi TAs: Felix Loh, Daniel Chang, Philip Garcia, Sean Franey, Vignyan Kothinti

More information

1/17/2018. Task: Print a Number in Binary. ECE 220: Computer Systems & Programming. First Step: Break the Task into a Sequence of Two

1/17/2018. Task: Print a Number in Binary. ECE 220: Computer Systems & Programming. First Step: Break the Task into a Sequence of Two University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming LC-3 I/O Usage Example Task: Print a Number in Binary Let s write some code

More information

11/10/2016. Review the Problem to Be Solved. ECE 120: Introduction to Computing. What Shall We Keep in the Registers? Where Are the Pieces in Memory?

11/10/2016. Review the Problem to Be Solved. ECE 120: Introduction to Computing. What Shall We Keep in the Registers? Where Are the Pieces in Memory? University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Letter Frequency Coding Review the Problem to Be Solved The task: given an ASCII

More information

Chapter 9 TRAP Routines and Subroutines

Chapter 9 TRAP Routines and Subroutines Chapter 9 TRAP Routines and Subroutines ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2 System Calls Certain operations require specialized knowledge

More information

System Calls. Chapter 9 TRAP Routines and Subroutines

System Calls. Chapter 9 TRAP Routines and Subroutines System Calls Chapter 9 TRAP Routines and Subroutines Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Certain operations require

More information

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers Chapter 4 The Von Neumann Model Original slides from Gregory Byrd, North Carolina State University Modified slides by C. Wilcox, S. Rajopadhye, Colorado State University Computing Layers Problems Algorithms

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma Examination 2 In Class (50 minutes) Wednesday, March 8, 207 Weight:

More information

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison Chapter 7 & 9.2 Assembly Language and Subroutines Human-Readable Machine

More information

UNIVERSITY OF WISCONSIN MADISON

UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Lisa Ossian, Minsub Shin, Sujith Surendran Midterm Examination 3 In Class (50 minutes) Friday,

More information

TRAPs and Subroutines. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

TRAPs and Subroutines. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell TRAPs and Subroutines University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell System Calls Certain operations require specialized knowledge and protection: specific knowledge

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Pradip Vallathol and Junaid Khalid Examination 4 In Class (50 minutes) Wednesday, December 12,

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Junaid Khalid and Pradip Vallathol Midterm Examination 3 In Class (50 minutes) Friday, November

More information

Chapter 9 TRAP Routines and Subroutines

Chapter 9 TRAP Routines and Subroutines Chapter 9 TRAP Routines and Subroutines System Calls Certain operations require specialized knowledge and protection: specific knowledge of I/O device registers and the sequence of operations needed to

More information

LC-3 Instruction Processing. (Textbook s Chapter 4)

LC-3 Instruction Processing. (Textbook s Chapter 4) LC-3 Instruction Processing (Textbook s Chapter 4) Instruction Processing Fetch instruction from memory Decode instruction Evaluate address Fetch operands from memory Usually combine Execute operation

More information

LC-3. 3 bits for condition codes (more later) Fixed-length instructions, with 4-bit opcodes. IIT CS 350 S 18- Hale

LC-3. 3 bits for condition codes (more later) Fixed-length instructions, with 4-bit opcodes. IIT CS 350 S 18- Hale LC-3 (Little computer version 3) 16-bit address width, 16-bit addressability. (Word size is 16 bits) 65K possible memory addresses Signed integers are 2 s complement 8 General purpose registers (GPRs),

More information

LC-3 Instruction Processing

LC-3 Instruction Processing LC-3 Instruction Processing (Textbookʼs Chapter 4)# Next set of Slides:# Textbook Chapter 10-10.2# Instruction Processing# It is impossible to do all of an instruction in one clock cycle.# Processors break

More information

ECE Homework 8

ECE Homework 8 ECE 252 - Homework 8 Written (problems 1 & 2) Due in Discussion Wed Dec. 7 th Code (problem 3) Due Thurs. Dec 8 th at Midnight (11:59 PM) Instructions: You should do this homework in your group assigned

More information

ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON ECE/CS 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Mikko Lipasti & Prof. Gurindar S. Sohi TAs: Felix Loh, Daniel Chang, Philip Garcia, Sean Franey, Vignyan Kothinti

More information

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Chapter 8 & 9.1 I/O and Traps I/O: Connecting to Outside World So

More information

Our Simulation Equivalent: -- readmemb( "os.bin" ) -- PC <== x0200

Our Simulation Equivalent: -- readmemb( os.bin ) -- PC <== x0200 LC3 OS basics LC3 System Start-Up Assumptions We will write an OS for the LC3. What would a real LC3 do at start up? 1. BIOS execution --- PC points to BIOS (Basic IO System). --- POST: Test and initialize

More information

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss Grundlagen Microcontroller Processor Core Günther Gridling Bettina Weiss 1 Processor Core Architecture Instruction Set Lecture Overview 2 Processor Core Architecture Computes things > ALU (Arithmetic Logic

More information

Chapter 4 The Von Neumann Model

Chapter 4 The Von Neumann Model Chapter 4 The Von Neumann Model The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer. (or was it John V. Atananasoff in 1939?) Hard-wired program

More information

8.1 I/O Basics Device Registers. chapter

8.1 I/O Basics Device Registers. chapter chapter 8 Up to now, we have paid little attention to input/output (I/O). We did note (in Chapter 4) that input/output is an important component of the von Neumann model. There must be a way to get information

More information

Chapter 8 I/O. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. But where does data in memory come from?

Chapter 8 I/O. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. But where does data in memory come from? Chapter 8 I/O I/O: Connecting to Outside World So far, we ve learned how to: compute with values in registers load data from memory to registers store data from registers to memory But where does data

More information

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Review Topics

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Review Topics Second Midterm Review Slides Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Review Topics LC-3 Programming /Stack Execution

More information

Lec-memMapIOtrapJSR SYS_BUS

Lec-memMapIOtrapJSR SYS_BUS Lec-memMapIOtrapJSR Memory Mapped I/O: I/O Devices have read/write access via device registers. To send a word of data to a device, write to its memory-mapped address: ST R1, To receive a word

More information

UNIVERSITY OF WISCONSIN MADISON

UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Sujith Surendran, Lisa Ossian, Minsub Shin Midterm Examination 4 In Class (50 minutes) Wednesday,

More information

LC-3 Subroutines and Traps. (Textbook Chapter 9)"

LC-3 Subroutines and Traps. (Textbook Chapter 9) LC-3 Subroutines and Traps (Textbook Chapter 9)" Subroutines" Blocks can be encoded as subroutines" A subroutine is a program fragment that:" lives in user space" performs a well-defined task" is invoked

More information

컴퓨터개념및실습. 기말고사 review

컴퓨터개념및실습. 기말고사 review 컴퓨터개념및실습 기말고사 review Sorting results Sort Size Compare count Insert O(n 2 ) Select O(n 2 ) Bubble O(n 2 ) Merge O(n log n) Quick O(n log n) 5 4 (lucky data set) 9 24 5 10 9 36 5 15 9 40 14 39 15 45 (unlucky

More information

Microprogrammed Control. ECE 238L μseq 2006 Page 1

Microprogrammed Control. ECE 238L μseq 2006 Page 1 Microprogrammed Control ECE 238L μseq 26 Page 1 Sample Control Unit FSM Add Ld Ld1 Ld2 Jsr Jsr1 F F1 F2 D Ldi Ldi1 Ldi2 Ldi3 Ldi4 Ldr Ldr1 Ldr2 Not Sti Sti1 Sti2 Sti3 Sti4 ECE 238L μseq 26 Page 2 Sample

More information

Chapter 8 Input/Output

Chapter 8 Input/Output Lecture on Introduction to Computing Systems Chapter 8 Input/Output An Hong han@ustc.edu.cn 0 Fall School of Computer Science and Technology 0/11/3 1 Review So far, we ve learned how to: compute with values

More information

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison Chapter 4 The Von Neumann Model The Stored Program Computer 1943: ENIAC Presper

More information

Subroutines & Traps. Announcements. New due date for assignment 2 5pm Wednesday, 5May

Subroutines & Traps. Announcements. New due date for assignment 2 5pm Wednesday, 5May Computer Science 210 s1c Computer Systems 1 2010 Semester 1 Lecture Notes Lecture 19, 26Apr10: Subroutines & Traps James Goodman! Announcements New due date for assignment 2 5pm Wednesday, 5May Test is

More information

LC-3 Architecture. (Ch4 ish material)

LC-3 Architecture. (Ch4 ish material) LC-3 Architecture (Ch4 ish material) 1 CISC vs. RISC CISC : Complex Instruction Set Computer Lots of instructions of variable size, very memory optimal, typically less registers. RISC : Reduced Instruction

More information

Binghamton University. CS-120 Summer LC3 Memory. Text: Introduction to Computer Systems : Sections 5.1.1, 5.3

Binghamton University. CS-120 Summer LC3 Memory. Text: Introduction to Computer Systems : Sections 5.1.1, 5.3 LC3 Memory Text: Introduction to Computer Systems : Sections 5.1.1, 5.3 John Von Neumann (1903-1957) Princeton / Institute for Advanced Studies Need to compute particle interactions during a nuclear reaction

More information

Logistics. IIT CS 350 S '17 - Hale

Logistics. IIT CS 350 S '17 - Hale Logistics Remember: Lab 5 due next week not this week. Finish it early though so you can move on to Lab 6! Lab 2 grades in BB Required reading posted (Patt & Patel Ch. 5) First exam during class next Wednesday

More information

Input & Output. Lecture 16. James Goodman (revised by Robert Sheehan) Computer Science 210 s1c Computer Systems 1 Lecture Notes

Input & Output. Lecture 16. James Goodman (revised by Robert Sheehan) Computer Science 210 s1c Computer Systems 1 Lecture Notes Computer Science 210 s1c Computer Systems 1 Lecture Notes Lecture 16 Input & Output James Goodman (revised by Robert Sheehan) Credits: Slides prepared by Gregory T. Byrd, North Carolina State University

More information

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Chapter 7 & 9.2 Assembly Language and Subroutines Human-Readable

More information

LC-3 TRAP Routines. Textbook Chapter 9

LC-3 TRAP Routines. Textbook Chapter 9 LC-3 TRAP Routines Textbook Chapter 9 System Calls Certain operations require specialized knowledge and protection: specific knowledge of I/O device registers and the sequence of operations needed to use

More information

The Assembly Language of the Boz 5

The Assembly Language of the Boz 5 The Assembly Language of the Boz 5 The Boz 5 uses bits 31 27 of the IR as a five bit opcode. Of the possible 32 opcodes, only 26 are implemented. Op-Code Mnemonic Description 00000 HLT Halt the Computer

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON Prof. Mark D. Hill & Prof. Parmesh Ramanathan TAs Kasturi Bidarkar, Ryan Johnson, Jie Liu,

More information

The MARIE Architecture

The MARIE Architecture The MARIE Machine Architecture that is Really Intuitive and Easy. We now define the ISA (Instruction Set Architecture) of the MARIE. This forms the functional specifications for the CPU. Basic specifications

More information

Review Topics. Midterm Exam Review Slides

Review Topics. Midterm Exam Review Slides Review Topics Midterm Exam Review Slides Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University!! Computer Arithmetic!! Combinational

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON Prof. Mark D. Hill & Prof. Parmesh Ramanathan TAs Kasturi Bidarkar, Ryan Johnson, Jie Liu,

More information

LC-3 Input and Output

LC-3 Input and Output LC-3 Input and Output I/O: Connecting to Outside World So far, we ve learned how to: compute with values in registers load data from memory to registers store data from registers to memory use the TRAP

More information

LC-3 Input and Output

LC-3 Input and Output LC-3 Input and Output I/O: Connecting to Outside World So far, we ve learned how to: compute with values in registers load data from memory to registers store data from registers to memory use the TRAP

More information

Fortunately not. In LC-3, there are a variety of addressing modes that deal with these concerns.

Fortunately not. In LC-3, there are a variety of addressing modes that deal with these concerns. CIT 593 Intro to Computer Systems Lecture #8 (10/2/12) Now let's see how an LC-3 program can read data from ( load ) and write data to ( store ) memory. Whenever we load/read from memory, we always have

More information

Lab 1. Warm-up : discovering the target machine, LC-3

Lab 1. Warm-up : discovering the target machine, LC-3 Lab 1 Warm-up : discovering the target machine, LC-3 Credits This sequence of compilation labs has been inspired by those designed by C. Alias and G. Iooss in 2013/14. In 2016/17 we changed the support

More information

Review Topics. Midterm Exam Review Slides

Review Topics. Midterm Exam Review Slides Review Topics Midterm Exam Review Slides Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Computer Arithmetic Combinational

More information

That is, we branch to JUMP_HERE, do whatever we need to do, and then branch to JUMP_BACK, which is where we started.

That is, we branch to JUMP_HERE, do whatever we need to do, and then branch to JUMP_BACK, which is where we started. CIT 593 Intro to Computer Systems Lecture #11 (10/11/12) Previously we saw the JMP and BR instructions. Both are one-way jumps : there is no way back to the code from where you jumped, so you just go in

More information

11/6/2016. Let s Solve a Problem. ECE 120: Introduction to Computing. Overview of Our Task. Programs are Finite State Machines

11/6/2016. Let s Solve a Problem. ECE 120: Introduction to Computing. Overview of Our Task. Programs are Finite State Machines University of Illinot Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Typing in a Number Let s Solve a Problem Let s see how we can translate a task in

More information

ECE 411 Exam 1. This exam has 5 problems. Make sure you have a complete exam before you begin.

ECE 411 Exam 1. This exam has 5 problems. Make sure you have a complete exam before you begin. This exam has 5 problems. Make sure you have a complete exam before you begin. Write your name on every page in case pages become separated during grading. You will have three hours to complete this exam.

More information

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World Computing Layers Problems Chapter 8 I/O Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Algorithms Language Instruction Set

More information

Implement useq's FSM's --- Next-state function --- Output function. We know: Any function can be implemented in AND-OR

Implement useq's FSM's --- Next-state function --- Output function. We know: Any function can be implemented in AND-OR Implement useq's FSM's --- Next-state function --- Output function We know: Any function can be implemented in AND-OR i --- # bits input to FSM (IR, PSR,...) j --- # bits of current state k = i + j ---

More information

Chapter 10 Computer Design Basics

Chapter 10 Computer Design Basics Logic and Computer Design Fundamentals Chapter 10 Computer Design Basics Part 2 A Simple Computer Charles Kime & Thomas Kaminski 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View

More information

Advanced Computer Architecture

Advanced Computer Architecture Advanced Computer Architecture Lecture No. 22 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 5 Computer Systems Design and Architecture 5.3 Summary Microprogramming Working of a General Microcoded

More information

Major and Minor States

Major and Minor States Major and Minor States We now consider the micro operations and control signals associated with the execution of each instruction in the ISA. The execution of each instruction is divided into three phases.

More information