10/30/2016. How Do We Write Instructions? ECE 120: Introduction to Computing. Put Bits into Memory, Then Execute the Bits

Size: px
Start display at page:

Download "10/30/2016. How Do We Write Instructions? ECE 120: Introduction to Computing. Put Bits into Memory, Then Execute the Bits"

Transcription

1 University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Instructions Illustrated How Do We Write Instructions? Previously, we looked at some instruction and talked about executing instructions. It s natural to wonder: How did those get there? Similarly, when making a peanut butter sandwich: Why was the bag closed? Where did the bread come from? Why was it whole wheat bread? ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 1 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 2 Put Bits into Memory, Then Execute the Bits Let s Illustrate LC-3 Instruction Processing All perfectly valid questions, but be patient! Our model of programming: Place into locations (you ll see how in the lab, and later in class). Then tell the LC-3 to interpret our as instructions. We can also put data in. But be careful! The LC-3 can t tell the difference between instructions and data. Both are. Let s execute the LC-3 for a few cycles and see how it works. We ll show a few pieces of the datapath: PC and IR MAR and MDR ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 3 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 4

2 What s in the Blank Boxes? Why are Some Values in Hex? R x1230 Bits! (not blanks!) PC x3000 IR MAR MDR For us humans (only). R x1230 Computers always use. PC x3000 IR MAR MDR ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 5 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 6 Fetch #1: MAR PC, PC PC + 1 Fetch #2: MDR M[MAR] R x1230 PC x3000 IR MAR MDR x3001 x R x1230 PC x3001 IR MAR x3000 MDR x670a ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 7 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 8

3 Fetch #3: IR MDR DECODE, then EXECUTE R x1230 PC x3001 IR MAR x3000 MDR x670a x670a These are the instruction to R be 0000decoded x1230 and executed. ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 9 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 10 Let s Decode the Instruction The IR has x670a. In, that s destination base 6-bit 2 s complement opcode register register offset LDR, R4, x0a Which means what? Let s decode it. M[R4 + x000a] What is the address? The LC-3 Reads the Bits from R Look at the stored in R4. R x1230 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 11 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 12

4 Let s Calculate the Memory Address M[R4 + x000a] R4 is x1230. Adding x000a, we obtain? x123a What is stored at address x123a? The LC-3 Reads Memory at x123a 16 Here is address x123a. 16 R x1230 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 13 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 14 The LC-3 Stores x0f0f into M[R4 + x000a] R4 is x1230. Adding x000a, we obtain? x123a What is stored at address x123a? x0f0f So the LC-3 stores x0f0f into. The LC-3 Stores x0f0f into x0f0f R x1230 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 15 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 16

5 What s Next? Fetch #1: MAR PC, PC PC Fetch another instruction! x0f0f R x x0f0f R x1230 x3002 x3001 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 17 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 18 Fetch #2: MDR M[MAR] Fetch #3: IR MDR x0f0f R x1230 Not shown, but say it s x16c3. PC x3002 IR x670a MAR x3001 MDR x670a x16c x0f0f R x1230 PC x3002 IR x670a MAR x3001 MDR x16c3 x16c3 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 19 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 20

6 DECODE, then EXECUTE Let s Decode the Instruction These are the instruction to x0f0f R be 0000decoded x1230 and executed. The IR has x16c3. In, that s destination source source opcode register register 1 register ADD,, Which means what? Let s decode it. + Add to, storing the sum back into. ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 21 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 22 The LC-3 Stores x1e1e into What s Next? x0f0f x1e1e R x x1e1e R x1230 Fetch another instruction! Life is not so exciting for LC-3 processors ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 23 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 24

7 Fetch #1: MAR PC, PC PC + 1 Fetch #2: MDR M[MAR] x1e1e R x1230 x3003 x x1e1e R x1230 Not shown, but say it s x770a. PC x3003 IR x16c3 MAR x3002 MDR x16c3 x770a ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 25 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 26 Fetch #3: IR MDR DECODE, then EXECUTE x1e1e R x1230 PC x3003 IR x16c3 MAR x3002 MDR x770a x770a These are the instruction to x1e1e R be 0000decoded x1230 and executed. PC x3003 IR x770a MAR x3002 MDR x770a ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 27 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 28

8 Let s Decode the Instruction The IR has x770a. In, that s source base 6-bit 2 s complement opcode register register offset STR, R4, x0a Which means what? Let s decode it. M[R4 + x000a] What is the address? The LC-3 Reads the Bits from R x1e1e Look at the stored in R4. R x1230 PC x3003 IR x770a MAR x3002 MDR x770a ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 29 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 30 Let s Calculate the Memory Address M[R4 + x000a] R4 is x1230. Adding x000a, we obtain? x123a So the LC-3 stores the in to address x123a. The LC-3 Writes x1e1e to Memory Address x123a x1e1e x1e1e R x1230 PC x3003 IR x770a MAR x3002 MDR x770a ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 31 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 32

9 What s Next? Computers Just Execute Instructions x1e1e For the LC-3, x123a x1e1e R x1230 fetch another instruction! But as for us, we re done. What does that instruction sequence do? Multiplies the value at address x123a by 2 (shifts it left by 1 bit). What if held something important before we executed those instructions? Too bad. Those are gone. The programmer controls the computer. The computer just does what it s told. ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 33 ECE 120: Introduction to Computing 2016 Steven S. Lumetta. All rights reserved. slide 34

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

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

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

11/29/2016. ECE 120: Introduction to Computing. Microinstruction Branch Conditions for LC-3. LC-3 State Transition Diagram Has Few Outgoing Arcs

11/29/2016. ECE 120: Introduction to Computing. Microinstruction Branch Conditions for LC-3. LC-3 State Transition Diagram Has Few Outgoing Arcs University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing The Patt and Patel Control Unit LC-3 State Transition Diagram Has Few Outgoing

More information

2/5/2018. Learn Four More Kinds of C Statements. ECE 220: Computer Systems & Programming. C s if Statement Enables Conditional Execution

2/5/2018. Learn Four More Kinds of C Statements. ECE 220: Computer Systems & Programming. C s if Statement Enables Conditional Execution 2/5/218 University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 22: Computer Systems & Programming Control Constructs in C (Partially a Review) Learn Four More Kinds

More information

11/28/2016. ECE 120: Introduction to Computing. Register Loads Control Updates to Register Values. We Consider Five Groups of LC-3 Control Signals

11/28/2016. ECE 120: Introduction to Computing. Register Loads Control Updates to Register Values. We Consider Five Groups of LC-3 Control Signals University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing LC-3 Control Signals Time to Examine a Processor s Control Signals in Detail Recall

More information

11/16/2016. Review Our Process for Programming. ECE 120: Introduction to Computing. A Typical Programming Process. Can a Computer Help Us Program?

11/16/2016. Review Our Process for Programming. ECE 120: Introduction to Computing. A Typical Programming Process. Can a Computer Help Us Program? University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Assembly Language Review Our Process for Programming Step 1: Figure out the instruction

More information

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor Lecture 13 - Introduction to the Central Processing Unit (CPU) Outcomes What is a CPU? How are instructions prepared by the CPU before execution? What registers and operations are involved in this preparation

More information

9/10/2016. Time for Some Detailed Examples. ECE 120: Introduction to Computing. Let s See How This Loop Works. One Statement/Step at a Time

9/10/2016. Time for Some Detailed Examples. ECE 120: Introduction to Computing. Let s See How This Loop Works. One Statement/Step at a Time University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Examples of C Programs with Loops Time for Some Detailed Examples Let s do some

More information

1/31/2017. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types

1/31/2017. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Expressions are Used to Perform Calculations Let s talk in more detail starting

More information

9/2/2016. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types

9/2/2016. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Expressions are Used to Perform Calculations Let s talk in more detail starting

More information

2/8/2017. SOP Form Gives Good Performance. ECE 120: Introduction to Computing. K-Maps Can Identify Single-Gate Functions

2/8/2017. SOP Form Gives Good Performance. ECE 120: Introduction to Computing. K-Maps Can Identify Single-Gate Functions University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Two-Level Logic SOP Form Gives Good Performance s you know, one can use a K-map

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

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

10/24/2016. We Can Perform Any Computation with an FSM. ECE 120: Introduction to Computing. Find the Minimum Value Among Ten Integers

10/24/2016. We Can Perform Any Computation with an FSM. ECE 120: Introduction to Computing. Find the Minimum Value Among Ten Integers University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing From FSM to Computer We Can Perform Any Computation with an FSM Let s build an

More information

1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous

1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming The Stack Abstraction Conventions Provide Implicit Information What does

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

9/10/2016. ECE 120: Introduction to Computing. The Domain of a Boolean Function is a Hypercube. List All Implicants for One Variable A

9/10/2016. ECE 120: Introduction to Computing. The Domain of a Boolean Function is a Hypercube. List All Implicants for One Variable A University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing To Simplify, Write Function as a Sum of Prime Implicants One way to simplify a

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

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

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

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

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

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

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

2/6/2018. Let s Act Like Compilers! ECE 220: Computer Systems & Programming. Decompose Finding Absolute Value

2/6/2018. Let s Act Like Compilers! ECE 220: Computer Systems & Programming. Decompose Finding Absolute Value University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Let s Act Like Compilers! Let s have some fun! Let s pretend to be a C compiler!

More information

2/5/2018. Expressions are Used to Perform Calculations. ECE 220: Computer Systems & Programming. Our Class Focuses on Four Types of Operator in C

2/5/2018. Expressions are Used to Perform Calculations. ECE 220: Computer Systems & Programming. Our Class Focuses on Four Types of Operator in C University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Expressions and Operators in C (Partially a Review) Expressions are Used

More information

10/27/2016. ECE 120: Introduction to Computing. The LC-3 Memory is Bit. Recall the Five Parts of the von Neumann Model

10/27/2016. ECE 120: Introduction to Computing. The LC-3 Memory is Bit. Recall the Five Parts of the von Neumann Model University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing LC-3 as a von Neumann Machine Build an LC-3 Processor as a von Neumann Machine

More information

8/30/2016. In Binary, We Have A Binary Point. ECE 120: Introduction to Computing. Fixed-Point Representations Support Fractions

8/30/2016. In Binary, We Have A Binary Point. ECE 120: Introduction to Computing. Fixed-Point Representations Support Fractions University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Fixed- and Floating-Point Representations In Binary, We Have A Binary Point Let

More information

1/29/2018. Starting a Program Executes its main Function. ECE 220: Computer Systems & Programming. The Function main Divides into Two Parts

1/29/2018. Starting a Program Executes its main Function. ECE 220: Computer Systems & Programming. The Function main Divides into Two Parts University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Starting a Program Executes its main Function Let s take a look at a C program

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

ADD R3, R4, #5 LDR R3, R4, #5

ADD R3, R4, #5 LDR R3, R4, #5 ECE 109 Sections 602 to 605 Exam 2 Fall 2007 Solution 6 November, 2007 Problem 1 (15 points) Data Path In the table below, the columns correspond to two LC/3 instructions and the rows to the six phases

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

2/28/2018. Let s Talk About Testing the Nonogram Code. ECE 220: Computer Systems & Programming. Example Nonogram Code Solution

2/28/2018. Let s Talk About Testing the Nonogram Code. ECE 220: Computer Systems & Programming. Example Nonogram Code Solution University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Testing the Nonogram Code Let s Talk About Testing the Nonogram Code What

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

Machine Language and Assembly Language

Machine Language and Assembly Language Machine Language and Assembly Language In the following lectures, we will learn: How instructions are represented and decoded Introduction to different types of Addressing Modes Most commonly used assembly

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

1/25/2018. ECE 220: Computer Systems & Programming. Write Output Using printf. Use Backslash to Include Special ASCII Characters

1/25/2018. ECE 220: Computer Systems & Programming. Write Output Using printf. Use Backslash to Include Special ASCII Characters University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Review: Basic I/O in C Allowing Input from the Keyboard, Output to the Monitor

More information

9/3/2016. ECE 120: Introduction to Computing. Few Programmers Write Instructions (Assembly Code) Spend a Week Learning the C Programming Language

9/3/2016. ECE 120: Introduction to Computing. Few Programmers Write Instructions (Assembly Code) Spend a Week Learning the C Programming Language University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Introduction to the C Programming Language Few Programmers Write Instructions

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

10/5/2016. Review of General Bit-Slice Model. ECE 120: Introduction to Computing. Initialization of a Serial Comparator

10/5/2016. Review of General Bit-Slice Model. ECE 120: Introduction to Computing. Initialization of a Serial Comparator University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Example of Serialization Review of General Bit-Slice Model General model parameters

More information

10/24/2016. Let s Name Some Groups of Bits. ECE 120: Introduction to Computing. We Just Need a Few More. You Want to Use What as Names?!

10/24/2016. Let s Name Some Groups of Bits. ECE 120: Introduction to Computing. We Just Need a Few More. You Want to Use What as Names?! University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Memory Let s Name Some Groups of Bits I need your help. The computer we re going

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

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

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

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

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

9/10/2016. The Dual Form Swaps 0/1 and AND/OR. ECE 120: Introduction to Computing. Every Boolean Expression Has a Dual Form

9/10/2016. The Dual Form Swaps 0/1 and AND/OR. ECE 120: Introduction to Computing. Every Boolean Expression Has a Dual Form University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Boolean Properties and Optimization The Dual Form Swaps 0/1 and AND/OR Boolean

More information

2/6/2018. ECE 220: Computer Systems & Programming. Function Signature Needed to Call Function. Signature Include Name and Types for Inputs and Outputs

2/6/2018. ECE 220: Computer Systems & Programming. Function Signature Needed to Call Function. Signature Include Name and Types for Inputs and Outputs University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming C Functions and Examples Signature Include Name and Types for Inputs and

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. Part 3: von Neumann Architecture von Neumann Architecture Our goal: understand the basics of von Neumann architecture, including memory, control unit

More information

Design of Decode, Control and Associated Datapath Units

Design of Decode, Control and Associated Datapath Units 1 Design of Decode, Control and Associated Datapath Units ECE/CS 3710 - Computer Design Lab Lab 3 - Due Date: Thu Oct 18 I. OVERVIEW In the previous lab, you have designed the ALU and hooked it up with

More information

COMARCH. COMPUTER ARCHITECTURE TERM 3 SY COMPUTER ENGINEERING DE LA SALLE UNIVERSITY Quiz 1

COMARCH. COMPUTER ARCHITECTURE TERM 3 SY COMPUTER ENGINEERING DE LA SALLE UNIVERSITY Quiz 1 COMARCH. COMPUTER ARCHITECTURE TERM 3 SY 2015 2016 COMPUTER ENGINEERING DE LA SALLE UNIVERSITY Quiz 1 1. Draw the logic symbol of the component whose operations are specified by the following microoperations:

More information

Digital System Design Using Verilog. - Processing Unit Design

Digital System Design Using Verilog. - Processing Unit Design Digital System Design Using Verilog - Processing Unit Design 1.1 CPU BASICS A typical CPU has three major components: (1) Register set, (2) Arithmetic logic unit (ALU), and (3) Control unit (CU) The register

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

2/12/2018. Recall Why ISAs Define Calling Conventions. ECE 220: Computer Systems & Programming. Recall the Structure of the LC-3 Stack Frame

2/12/2018. Recall Why ISAs Define Calling Conventions. ECE 220: Computer Systems & Programming. Recall the Structure of the LC-3 Stack Frame University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Stack Frames Revisited Recall Why ISAs Define Calling Conventions A compiler

More information

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE Department of Computer and Mathematical Sciences CS 3401 Assembly Language 4 Lab 4: Introduction to MARIE Objectives: The main objective of this lab is to get you familiarized with MARIE a simple computer

More information

10/21/2016. ECE 120: Introduction to Computing. Let s Extend Our Keyless Entry FSM. FSM Designs Also Allow Use of Abstraction

10/21/2016. ECE 120: Introduction to Computing. Let s Extend Our Keyless Entry FSM. FSM Designs Also Allow Use of Abstraction University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Extending Keyless Entry Combinational Logic Design Allows Use of Abstraction Recall

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

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

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

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

Computer Organization II CMSC 3833 Lecture 33

Computer Organization II CMSC 3833 Lecture 33 Term MARIE Definition Machine Architecture that is Really Intuitive and Easy 4.8.1 The Architecture Figure s Architecture Characteristics: Binary, two s complement Stored program, fixed word length Word

More information

October 24. Five Execution Steps

October 24. Five Execution Steps October 24 Programming problems? Read Section 6.1 for November 5 How instructions execute Test Preview Ask Questions! 10/24/2001 Comp 120 Fall 2001 1 Five Execution Steps Instruction Fetch Instruction

More information

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit Lecture1: introduction Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit 1 1. History overview Computer systems have conventionally

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

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

12/2/2016. Error Detection May Not Be Enough. ECE 120: Introduction to Computing. Can We Use Redundancy to Correct Errors?

12/2/2016. Error Detection May Not Be Enough. ECE 120: Introduction to Computing. Can We Use Redundancy to Correct Errors? University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Error Correction, Hamming Codes, and SEC-DED Codes Error Detection May Not Be

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

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register CPU Organisation Central Processing Unit (CPU) Memory General R0 Registers R1 R2 ALU R3 Output Register Input Register 1 Input Register 2 Internal Bus Address Bus Data Bus Addr. $ 000 001 002 Program Counter

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

LC3DataPath ECE2893. Lecture 9a. ECE2893 LC3DataPath Spring / 14

LC3DataPath ECE2893. Lecture 9a. ECE2893 LC3DataPath Spring / 14 LC3DataPath ECE2893 Lecture 9a ECE2893 LC3DataPath Spring 2011 1 / 14 LC3 Data Path [4:0] FINITE MACHINE STATE MEMORY IR ADDR2MUX ADDR1MUX + GateMARMUX LDPC MARMUX ZEXT SEXT SEXT SEXT RESET GateALU +1

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

C Functions and Pointers. C Pointers. CS270 - Fall Colorado State University. CS270 - Fall Colorado State University

C Functions and Pointers. C Pointers. CS270 - Fall Colorado State University. CS270 - Fall Colorado State University 1 C Pointers C unctions and Pointers 3 2 4 5 6 7 8 our-bit Adder Logical Completeness (Example)! Can implement ANY truth table with combo of AN, OR, NOT gates. Implementing a inite tate Machine (equential

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

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

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

Where Does The Cpu Store The Address Of The

Where Does The Cpu Store The Address Of The Where Does The Cpu Store The Address Of The Next Instruction To Be Fetched The three most important buses are the address, the data, and the control buses. The CPU always knows where to find the next instruction

More information

Fundamentals of Computer Architecture. 8. Bringing It All Together The Hardware Engineer s Perspective

Fundamentals of Computer Architecture. 8. Bringing It All Together The Hardware Engineer s Perspective Fundamentals of Computer Architecture 8. Bringing It All Together The Hardware Engineer s Perspective 1 CHAPTER OVERVIEW This chapter includes: Assigning tasks to individual processor components; Micro-instructions;

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

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

ECE 411, Exam 1. Good luck!

ECE 411, Exam 1. Good luck! This exam has 6 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

session 7. Datapath Design

session 7. Datapath Design General Objective: Determine the hardware requirement of a digital computer based on its instruction set. Specific Objectives: Describe the general concepts in designing the data path of a digital computer

More information

General purpose registers These are memory units within the CPU designed to hold temporary data.

General purpose registers These are memory units within the CPU designed to hold temporary data. Von Neumann Architecture Single processor is used Each instruction in a program follows a linear sequence of fetch decode execute cycle Program and data are held in same main memory Stored program Concept

More information

7/25/2016. Example: Addition of Unsigned Bit Patterns. ECE 120: Introduction to Computing. Adding Two Non-Negative Patterns Can Overflow

7/25/2016. Example: Addition of Unsigned Bit Patterns. ECE 120: Introduction to Computing. Adding Two Non-Negative Patterns Can Overflow University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing 2 s Complement Overflow and Boolean Logic Example: ddition of Unsigned Bit Patterns

More information

CENG3420 Lab 2-1: LC-3b Simulator

CENG3420 Lab 2-1: LC-3b Simulator CENG3420 Lab 2-1: LC-3b Simulator Bei Yu Department of Computer Science and Engineering The Chinese University of Hong Kong byu@cse.cuhk.edu.hk Spring 2018 1 / 29 Overview LC-3b Basis LC-3b Assembly Examples

More information

Implementing Another ISA, Basic Pipelining

Implementing Another ISA, Basic Pipelining EE360N: Computer Architecture Lecture #4 Department of Electical and Computer Engineering The University of Texas at Austin September 24, 2008 Disclaimer: The contents of this document are scribe notes

More information

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction Control and Control Components Introduction Software application similar to familiar nested Russian dolls As we ve observed earlier Application written in some high level programming language C, C++, C#,

More information

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit Single cycle MIPS data path without Forwarding, Control, or Hazard Unit Figure 1: an Overview of a MIPS datapath without Control and Forwarding (Patterson & Hennessy, 2014, p. 287) A MIPS 1 single cycle

More information

CS 270 Fall 2013 Mock Final

CS 270 Fall 2013 Mock Final CS 270 Fall 2013 Mock Final Name(s) of student(s) Please read these instructions completely before proceeding, and sign below. Your exam will not be graded without your signature. This is the mock nal

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

Design of the MIPS Processor (contd)

Design of the MIPS Processor (contd) Design of the MIPS Processor (contd) First, revisit the datapath for add, sub, lw, sw. We will augment it to accommodate the beq and j instructions. Execution of branch instructions beq $at, $zero, L add

More information

Computer Architecture. Lecture 5: Multi-Cycle and Microprogrammed Microarchitectures

Computer Architecture. Lecture 5: Multi-Cycle and Microprogrammed Microarchitectures Computer Architecture Lecture 5: Multi-Cycle and Microprogrammed Microarchitectures Dr. Ahmed Sallam Based on original slides by Prof. Onur Mutlu Agenda for Today & Next Few Lectures Single-cycle Microarchitectures

More information

STRUCTURE OF DESKTOP COMPUTERS

STRUCTURE OF DESKTOP COMPUTERS Page no: 1 UNIT 1 STRUCTURE OF DESKTOP COMPUTERS The desktop computers are the computers which are usually found on a home or office desk. They consist of processing unit, storage unit, visual display

More information

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics Chapter 4 Objectives Learn the components common to every modern computer system. Chapter 4 MARIE: An Introduction to a Simple Computer Be able to explain how each component contributes to program execution.

More information

Chapter 02: Computer Organization. Lesson 02: Functional units and components in a computer organization- Part 1: Processor

Chapter 02: Computer Organization. Lesson 02: Functional units and components in a computer organization- Part 1: Processor Chapter 02: Computer Organization Lesson 02: Functional units and components in a computer organization- Part 1: Processor Objective Understand functional units in Processor Understand execution unit,

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

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

University of Illinois at Urbana-Champaign First Midterm Exam, ECE 220 Honors Section

University of Illinois at Urbana-Champaign First Midterm Exam, ECE 220 Honors Section University of Illinois at Urbana-Champaign First Midterm Exam, ECE 220 Honors Section Name: SOLUTION IS IN RED Thursday 15 February 2018 Net ID: Be sure that your exam booklet has ELEVEN pages. Write your

More information

3/7/2018. Sometimes, Knowing Which Thing is Enough. ECE 220: Computer Systems & Programming. Often Want to Group Data Together Conceptually

3/7/2018. Sometimes, Knowing Which Thing is Enough. ECE 220: Computer Systems & Programming. Often Want to Group Data Together Conceptually University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Structured Data in C Sometimes, Knowing Which Thing is Enough In MP6, we

More information

10/21/2016. A Finite State Machine (FSM) Models a System. ECE 120: Introduction to Computing. An FSM Consists of Five Parts

10/21/2016. A Finite State Machine (FSM) Models a System. ECE 120: Introduction to Computing. An FSM Consists of Five Parts University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Finite State Machines (FSMs) A Finite State Machine (FSM) Models a System A model

More information