Prof. Sirer CS 316 Cornell University

Slides:



Advertisements
Similar presentations
Goal: Write Programs in Assembly
Advertisements

331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University A Processor See: P&H Chapter ,
The Processor: Datapath & Control
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
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.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
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.
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.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
ECE 445 – Computer Organization
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Datapath and Control Unit Design
Computer Organization Rabie A. Ramadan Lecture 3.
Our programmer needs to do this !
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
MIPS Instruction Set Architecture Prof. Sirer CS 316 Cornell University.
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.
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
Electrical and Computer Engineering University of Cyprus
CS 230: Computer Organization and Assembly Language
MIPS Instruction Set Advantages
IT 251 Computer Organization and Architecture
Introduction CPU performance factors
ELEN 468 Advanced Logic Design
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
Prof. Sirer CS 316 Cornell University
Instruction Format MIPS Instruction Set.
Processor (I).
CSCI206 - Computer Organization & Programming
Han Wang CS3410, Spring 2012 Computer Science Cornell University
Single-Cycle CPU DataPath.
CSCI206 - Computer Organization & Programming
The University of Adelaide, School of Computer Science
Levels in Processor Design
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Computer Organization
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
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
COMS 361 Computer Organization
Lecture 14: Single Cycle MIPS Processor
Access the Instruction from Memory
Instruction Format MIPS Instruction Set.
MIPS Instruction Set Architecture
Levels in Processor Design
Hakim Weatherspoon CS 3410 Computer Science Cornell University
The Processor: Datapath & Control.
The RISC-V Processor Hakim Weatherspoon CS 3410 Computer Science
COMS 361 Computer Organization
CS 3410, Spring 2014 Computer Science Cornell University
What You Will Learn In Next Few Sets of Lectures
Processor: Datapath and Control
Presentation transcript:

Prof. Sirer CS 316 Cornell University A Simple Processor Prof. Sirer CS 316 Cornell University

printf(“go koç compe”); Instructions for(i = 0; I < 10; ++i) printf(“go koç compe”); Programs are written in a high- level language C, Java, Python, Miranda, … Loops, control flow, variables Need translation to a lower-level computer understandable format Processors operate on machine language Assembler is human-readable machine language li r2, 10 li r1, 0 slt r3, r1, r2 bne … 01001001000001010 01001000100000000 10001001100010010

Basic Computer System A processor executes instructions Processor has some internal state in storage elements (registers) A memory holds instructions and data Harvard architecture: separate insts and data von Neumann architecture: combined inst and data A bus connects the two 01010000 10010100 … bus regs addr, data, r/w processor memory

Instruction Usage Instructions are stored in memory, encoded in binary 01001001000001010 01001000100000000 10001001100010010 Instructions are stored in memory, encoded in binary A basic processor fetches decodes executes one instruction at a time addr data cur inst pc adder decode execute regs

Instruction Types Arithmetic Control flow Memory add, subtract, shift left, shift right, multiply, divide compare Control flow unconditional jumps conditional jumps (branches) subroutine call and return Memory load value from memory to a register store value to memory from a register Many other instructions are possible vector add/sub/mul/div, string operations, store internal state of processor, restore internal state of processor, manipulate coprocessor

Instruction Set Architecture The types of operations permissable in machine language define the ISA MIPS: load/store, arithmetic, control flow, … VAX: load/store, arithmetic, control flow, strings, … Cray: vector operations, … Two classes of ISAs Reduced Instruction Set Computers (RISC) Complex Instruction Set Computers (CISC) We’ll study the MIPS ISA in this course

Register file The MIPS register file W A r1 r2 … r31 B clk WE RW RA RB 32 32-bit registers register 0 is permanently wired to 0 Write-Enable and RW determine which reg to modify Two output ports A and B RA and RB choose values read on outputs A and B Reads are combinatorial Writes occur on falling edge if WE is high W A r1 r2 … r31 32 32 B 32 clk 5 5 5 WE RW RA RB

Memory 32-bit address 32-bit data 2-bit memory control input word = 32 bits 2-bit memory control input data in data out memory 32 2 addr mc 00: read 01: write byte 10: write halfword 11: write word

Instruction Fetch Read instruction from memory Calculate address of next instruction Fetch next instruction inst memory 32 2 00 pc new pc calculation

Arithmetic Instructions op rs rt rd shamt func 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits if op == 0 && func == 0x21 R[rd] = R[rs] + R[rt] if op == 0 && func == 0x23 R[rd] = R[rs] - R[rt] if op == 0 && func == 0x25 R[rd] = R[rs] | R[rt]

Arithmetic Ops 00 inst alu memory register file pc new pc calculation 32 2 00 5 5 5 pc new pc calculation control

Arithmetic Logic Unit A B + Implements add, sub, or, and, shift-left, … Operates on operands in parallel Control mux selects desired output cin B

Arithmetic Ops 00 inst alu memory register file pc new pc calculation 32 2 00 5 5 5 pc new pc calculation control

Summary With an ALU and fetch-decode unit, we have the equivalent of Babbage’s computation engine Much faster, more reliable, no mechanical parts Next time: control flow and memory operations