ECE 445 – Computer Organization

Slides:



Advertisements
Similar presentations
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Advertisements

Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 11 - Processor.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Levels in Processor Design
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Five The Processor: Datapath and Control.
Shift Instructions (1/4)
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
Designing a Simple Datapath Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Revised 9/12/2013.
Fall EE 333 Lillevik 333f06-l7 University of Portland School of Engineering Computer Organization Lecture 7 ALU design MIPS data path.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Chapter 4 CSF 2009 The processor: Building the datapath.
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University Revised from original.
Lecture 8: Processors, Introduction EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
Lecture 14: Processors CS 2011 Fall 2014, Dr. Rozier.
Processor: Datapath and Control
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
CDA 3101 Fall 2013 Introduction to Computer Organization
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
1. Building A CPU  We’ve built a small ALU l Add, Subtract, SLT, And, Or l Could figure out Multiply and Divide  What about the rest l How do.
D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
C OMPUTER O RGANIZATION AND D ESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
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.
MIPS Processor.
Morgan Kaufmann Publishers The Processor
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
Introduction CPU performance factors
/ Computer Architecture and Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Processor (I).
Single-Cycle DataPath
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Morgan Kaufmann Publishers The Processor
CSCI206 - Computer Organization & Programming
Single-Cycle CPU DataPath.
MIPS Processor.
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.2: Building a Datapath with Control
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Topic 5: Processor Architecture
Datapath: Instruction Store/Fetch & PC Increment
Systems Architecture I
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
The Processor: Datapath & Control.
COMS 361 Computer Organization
Presentation transcript:

ECE 445 – Computer Organization The Single-Cycle Datapath and Control Unit (Lecture #10) The slides included herein were taken from the materials accompanying Computer Organization and Design, 4th Edition, by Patterson and Hennessey, and were used with permission from Morgan Kaufmann Publishers.

Chapter 4: Sections 1 – 4 Appendix D: Sections 1 – 3, 5 Material to be covered ... Chapter 4: Sections 1 – 4 Appendix D: Sections 1 – 3, 5 Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Introduction §4.1 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified version - single-cycle A more realistic version - pipelined Simple subset, shows most aspects Memory reference: lw, sw Arithmetic/logical: add, sub, and, or, slt Control transfer: beq, j Fall 2010 ECE 445 - Computer Organization

Instruction Execution PC  instruction memory, fetch instruction ALL instructions must be fetched Register numbers  register file, read registers ALL instructions must be decoded Depending on instruction class Use ALU to calculate Arithmetic result Memory address for load/store Branch target address Access data memory for load/store PC  target address or PC + 4 Fall 2010 ECE 445 - Computer Organization

CPU Overview (Datapath) Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Multiplexers Can’t just join wires together Use multiplexers Fall 2010 ECE 445 - Computer Organization

CPU Overview (Control) Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Logic Design Basics Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses Combinational element Operate on data Output is a function of input State (sequential) elements Store information §4.2 Logic Design Conventions Fall 2010 ECE 445 - Computer Organization

Combinational Elements Y I0 I1 M u x S Multiplexer Y = S ? I1 : I0 + ALU F Adder Y = A + B Arithmetic/Logic Unit Y = F(A, B) AND-gate Y = A & B Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Sequential Elements Register: stores data in a circuit Uses a clock signal to determine when to update the stored value Edge-triggered: update when Clk changes from 0 to 1 D Clk Q What if the D Flip-Flop must retain its current value (rather than store a new one)? Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Sequential Elements Register with write control Only updates on clock edge when write control input is 1 Used when stored value is required later D Clk Q Write How is the Write (enable) signal implemented? Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Clocking Methodology Combinational logic transforms data during clock cycles Between clock edges Input from state elements, output to state element Longest delay determines clock period Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Building a Datapath Datapath Elements that process data and addresses in the CPU Registers, ALUs, mux’s, memories, … Control Unit Controls the behavior of the elements that comprise the datapath We will build a MIPS datapath incrementally Refining the overview design §4.3 Building a Datapath Fall 2010 ECE 445 - Computer Organization

Instruction Fetch Stored Program Computer 32-bit register Increment by 4 for next instruction Stored Program Computer Program Counter (aka. Instruction Address Register) Fall 2010 ECE 445 - Computer Organization

R-Format Instructions Some examples: add $s0, $t1, $t0 sub $s3, $s1, $t1 and $t2, $t3, $s1 or $t5, $s6, $s7 sll $t1, $t0, 3 Fall 2010 ECE 445 - Computer Organization

R-Format Instructions Read two register operands (rs and rt) Perform arithmetic/logical operation Write register result (rd) Fall 2010 ECE 445 - Computer Organization

Load/Store Instructions These are I-Format instructions Some examples: lw $s0, 32 ($t1) sw $s1, 40 ($t2) Fall 2010 ECE 445 - Computer Organization

Load/Store Instructions Read register operands Calculate address using 16-bit offset Use ALU, but sign-extend offset Load: Read memory and update register Store: Write register value to memory Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Branch Instructions These are I-Format instructions Some examples: beq $s2, $t3, L1 bne $t3, $t4, Else Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Branch Instructions Read register operands Compare operands Use ALU Subtract and check Zero output Calculate target address Sign-extend displacement Shift left 2 bits (word displacement) Add to PC + 4 Already calculated by instruction fetch What does the Zero output indicate? Fall 2010 ECE 445 - Computer Organization

Branch Instructions Just re-routes wires Sign-bit wire replicated Fall 2010 ECE 445 - Computer Organization

Composing the Elements Simple datapath does an instruction in one clock cycle Each datapath element can only do one function at a time Hence, we need separate instruction and data memories Read instruction memory (every instruction must be fetched) Read or Write data memory (for lw and sw, respectively) Use multiplexers where alternate data sources are used for different instructions Fall 2010 ECE 445 - Computer Organization

R-Type/Load/Store Datapath Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization R-Type Instructions rs [25..21] rt [20..16] [31..0] rd [15..11] Control Unit [31..26] control signals Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Example: add $s0, $t0, $t1 add $t0 [$t0] $t1 [$t1] $s0 [$t0] + [$t1] [$t0] + [$t1] Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Example: sub $s3, $s2, $s1 sub $s2 [$s2] $s1 [$s1] $s2 [$s2] - [$s1] [$s2] - [$s1] Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Example: and $t0, $s1, $s2 and $s1 [$s1] $s2 [$s2] $t0 [$s1] & [$s2] [$s1] & [$s2] Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Example: or $s5, $t3, $s3 or $t3 [$t3] $s3 [$s3] $s5 [$t3] | [$s3] [$t3] | [$s3] Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Example: sll $s3, $t1, 2 sll $t1 $s3 Can the shift operations be implemented with this datapath? Fall 2010 ECE 445 - Computer Organization

R-Type/Load/Store Datapath Which datapath components are not required for R-type instructions? Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Questions? Fall 2010 ECE 445 - Computer Organization