Test 1 Review Lectures 1-5.

Slides:



Advertisements
Similar presentations
Lecture 5: MIPS Instruction Set
Advertisements

CPS3340 COMPUTER ARCHITECTURE Fall Semester, /15/2013 Lecture 11: MIPS-Conditional Instructions Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
ELEN 468 Advanced Logic Design
Chapter 2 Instructions: Language of the Computer
©UCB CS 161Computer Architecture Chapter 5 Lecture 9 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
1 Lecture 2: MIPS Instruction Set Today’s topic:  MIPS instructions Reminder: sign up for the mailing list cs3810 Reminder: set up your CADE accounts.
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
The Datapath Andreas Klappenecker CPSC321 Computer Architecture.
Datapath and Control Andreas Klappenecker CPSC321 Computer Architecture.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
CS2100 Computer Organisation
Computer Organization & Programming Chapter 6 Single Datapath CPU Architecture.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
MS108 Computer System I Lecture 3 ISA Prof. Xiaoyao Liang 2015/3/13 1.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Lecture 9. MIPS Processor Design – Single-Cycle Processor Design Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
Lecture 5. MIPS Processor Design
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
ECE/CS 552: Single Cycle Control Path
EE204 Computer Architecture
MIPS Microarchitecture Single-Cycle Processor Control
Single Cycle CPU - Control
Computer Architecture & Operations I
CS 230: Computer Organization and Assembly Language
Single-Cycle Datapath and Control
Computer Architecture
COMPUTER ARCHITECTURE & OPERATIONS I
IT 251 Computer Organization and Architecture
Instruction Set Architecture
Lecture 15: Basic CPU Design
ELEN 468 Advanced Logic Design
Computer Architecture & Operations I
ECS 154B Computer Architecture II Spring 2009
CS/COE0447 Computer Organization & Assembly Language
Designing MIPS Processor (Single-Cycle) Presentation G
The University of Adelaide, School of Computer Science
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CSCE 212 Chapter 5 The Processor: Datapath and Control
Single-cycle datapath, slightly rearranged
Single-Cycle CPU DataPath.
Lecture 4: MIPS Instruction Set
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Lecturer: Alan Christopher
CS/COE0447 Computer Organization & Assembly Language
Computer Architecture
Systems Architecture II
Datapath & Control MIPS
Composing the Elements
Composing the Elements
Datapath: Instruction Store/Fetch & PC Increment
Systems Architecture I
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Simple Implementation
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Basic MIPS Implementation
CS/COE0447 Computer Organization & Assembly Language
2-2 Logic Part 2 Truth Tables.
MIPS Processor.
Presentation transcript:

Test 1 Review Lectures 1-5

Review This slide set is intended to give you some practice with problems that are similar to those that will appear on the test. Try to work out all of the problems before looking at the solutions, which are on the slide right after the problem statement.

Datapath Create a datapath for the sub instruction. sub $rd, $rs, $rt

Datapath Create a datapath for the sub instruction. 4 Create a datapath for the sub instruction. Now, add in the bit width values.

Datapath Create a datapath for the sub instruction. 4 Create a datapath for the sub instruction. Now, add in the bit width values. Which of the following control lines need to be set: RegWrite, MemWrite, MemRead? 32 32 32 5 32 5 5 32 32

Datapath Create a datapath for the sub instruction. 4 Create a datapath for the sub instruction. Now, add in the bit width values. Which of the following control lines need to be set? RegWrite – Set! MemWrite and MemRead are not set. 32 32 32 5 32 5 5 32 32

Datapath Create a datapath for the lw instruction. lw $rt, immed($rs)

Datapath Create a datapath for the lw instruction. 4 Create a datapath for the lw instruction. Now add in the bit width values.

Datapath Create a datapath for the lw instruction. 4 Create a datapath for the lw instruction. Now add in the bit width values. Which of the following control lines need to be set: RegWrite, MemWrite, MemRead? 32 32 32 5 32 32 5 16 32 32

Datapath Create a datapath for the lw instruction. 4 Create a datapath for the lw instruction. Now add in the bit width values. Which of the following control lines need to be set? RegWrite – Set! MemWrite – Unset! MemRead – Set! 32 32 32 5 32 32 5 16 32 32

Logic Consider the following monstrous logic equation: 𝐷= ( 𝐴 ∙ 𝐵 ∙ 𝐶 ) ∙ 𝐴∙𝐵∙𝐶 ∙ 𝐴∙𝐵∙ 𝐶 + 𝐴 ∙𝐵∙𝐶 + 𝐴∙ 𝐵 ∙𝐶 Fill in the truth table for this equation.

Logic Consider the following monstrous logic equation: 𝐷= ( 𝐴 ∙ 𝐵 ∙ 𝐶 ) ∙ 𝐴∙𝐵∙𝐶 ∙ 𝐴∙𝐵∙ 𝐶 + 𝐴 ∙𝐵∙𝐶 + 𝐴∙ 𝐵 ∙𝐶 A B C D 1 Express this equation in the canonical sum-of-products form.

Logic Consider the following monstrous logic equation: 𝐷= ( 𝐴 ∙ 𝐵 ∙ 𝐶 ) ∙ 𝐴∙𝐵∙𝐶 ∙ 𝐴∙𝐵∙ 𝐶 + 𝐴 ∙𝐵∙𝐶 + 𝐴∙ 𝐵 ∙𝐶 A B C D 1 Express this equation in the canonical sum-of-products form. 𝐷= 𝐴 ∙ 𝐵 ∙𝐶 + 𝐴 ∙𝐵∙ 𝐶 +(𝐴∙ 𝐵 ∙ 𝐶 ) Now, try to draw the hardware for this logic equation.

Logic 𝐷= 𝐴 ∙ 𝐵 ∙𝐶 + 𝐴 ∙𝐵∙ 𝐶 +(𝐴∙ 𝐵 ∙ 𝐶 ) Consider the following logic equation: 𝐷= 𝐴 ∙ 𝐵 ∙𝐶 + 𝐴 ∙𝐵∙ 𝐶 +(𝐴∙ 𝐵 ∙ 𝐶 ) A B C D 1

MIPS if(a < b){ for(i = 0; i < a; i++){ A[i] = B[i] } } Translate the following C code fragment into MIPS. Let a and b be associated with $t0 and $t1, respectively. Let the base addresses of A and B be associated with $s0 and $s1, respectively. if(a < b){ for(i = 0; i < a; i++){ A[i] = B[i] } }

MIPS if(a < b){ for(i = 0; i < a; i++){ A[i] = B[i] } } Translate the following C code fragment into MIPS. Let a and b be associated with $t0 and $t1, respectively. Let the base addresses of A and B be associated with $s0 and $s1, respectively. Let i be associated with $t7. slt $t2, $t0, $t1 beq $t2, $zero, L1 addi $t7, $zero, 0 LP: slt $t2, $t7, $t0 beq $t2, $zero, L1 sll $t3, $t7, 2 add $t4, $s1, $t3 lw $t4, 0($t4) add $t5, $s0, $t3 sw $t4, 0($t5) addi $t7, $t7, 1 j LP L1: if(a < b){ for(i = 0; i < a; i++){ A[i] = B[i] } }

Classic CPU performance equation The Classic CPU Performance Equation is: 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒=#𝐼𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠×𝐶𝑃𝐼×𝐶𝑙𝑜𝑐𝑘 𝑃𝑒𝑟𝑖𝑜𝑑 Alternatively, 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒= #𝐼𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠 × 𝐶𝑃𝐼 𝐶𝑙𝑜𝑐𝑘 𝑅𝑎𝑡𝑒 A program on a machine has a clock rate of 3 GHz, each instruction takes 2 clock cycles on average, and the execution time is 4 seconds. How many instructions were executed in this program?

Classic CPU performance equation The Classic CPU Performance Equation is: 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒=#𝐼𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠×𝐶𝑃𝐼×𝐶𝑙𝑜𝑐𝑘 𝑃𝑒𝑟𝑖𝑜𝑑 Alternatively, 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒= #𝐼𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠 × 𝐶𝑃𝐼 𝐶𝑙𝑜𝑐𝑘 𝑅𝑎𝑡𝑒 A program on a machine has a clock rate of 3 GHz, each instruction takes 2 clock cycles on average, and the execution time is 4 seconds. How many instructions were executed in this program? Answer: 6× 10 9 instructions

Final thoughts Knowing how to approach each of these problems (or related problems) will get you pretty far on the exam, but you still need to be comfortable with everything on the topics list. Especially: The details of how the MIPS instruction set works. Do you know what each of the fields is for and how the field is constructed? Great Architecture Ideas and ISA Design Principles. Trends in implementation technology, the power wall, and the effect of these on today’s computers. How is high-level source code converted into a running process? Etc…