More Intro MIPS Computer Organization I 1 September 2009 ©2006-09 McQuain, Feng & Ribbens Machine Language But, how is all of this driven? Machine.

Slides:



Advertisements
Similar presentations
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Advertisements

Chapter 2 Instructions: Language of the Computer
Chapter 2.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and 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.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
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.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Five The Processor: Datapath and Control.
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.
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
CSCI 211 Intro Computer Organization –Consists of gates for logic And Or Not –Processor –Memory –I/O interface.
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Intro MIPS Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann – Wrote a.
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.
ECE 445 – Computer Organization
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
CDA 3101 Fall 2013 Introduction to Computer Organization
Datapath Design Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Composing the Elements First-cut data path does an instruction.
Computer Organization & Programming Chapter 6 Single Datapath CPU Architecture.
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.
December 26, 2015©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Logic Design / Processor and Control Units Tony Diep.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
February 22, 2016©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
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.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Gary MarsdenSlide 1University of Cape Town Computer Architecture – Introduction Andrew Hutchinson & Gary Marsden (me) ( ) September 2003.
MIPS Processor.
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
The Stored Program Computer
Single-Cycle Datapath and Control
Introduction CPU performance factors
ELEN 468 Advanced Logic Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
Instruction Format MIPS Instruction Set.
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
CS/COE0447 Computer Organization & Assembly Language
MIPS Processor.
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Composing the Elements
Composing the Elements
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Topic 5: Processor Architecture
COMS 361 Computer Organization
Instruction Format MIPS Instruction Set.
MIPS Processor.
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

More Intro MIPS Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens Machine Language But, how is all of this driven? Machine language: -registers store collections of bits -all data and instructions must be encoded as collections of bits (binary) -bits are represented as electrical charges (more or less) -control logic and arithmetic operations are implemented as circuits, which are driven by the movement of electrical charges -so, the instructions directly manipulate the underlying hardware (cool, huh?) The collection of all valid binary instructions is known as the machine language. -what’s valid depends on the design of the hardware, especially the control circuitry -must be formally specified -machine language is not human-friendly

More Intro MIPS Computer Organization I 2 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens Simple instructions, all 32 bits wide Very structured, no unnecessary baggage Only three instruction formats: Overview of MIPS Machine Language Basic arithmetical-logical instructions are R-format. Load/store/conditional branch instructions are I-format. Jump/unconditional branch instructions are J-format. R functshamtrdrtrsop 16-bit immediatertrsop 26-bit immediateop I J

More Intro MIPS Computer Organization I 3 September 2009 © McQuain, Feng & Ribbens MIPS Machine Language: Arithmetic Machine language basic arithmetic/logic instruction format: functshamtrdrtrsop Can you guess what the field names stand for? opoperation code (opcode) rs1 st source register rt2 nd source register rddestination register shamtshift amount functopcode variant selector

More Intro MIPS Computer Organization I 4 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens What will be involved in executing a machine language instruction? Consider an I-type instruction, say a lw (load word) instruction: Anticipating Execution 16-bit immediatertrsop I The opcode bits must be analyzed to determine that the instruction is lw. The contents of $rs must be fetched to the ALU and added to the immediate field to compute the appropriate address. The contents at that address must be fetched from memory and written to register $rt.

More Intro MIPS Computer Organization I 5 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens Decoding the Opcode We will need some sort of control logic that takes the 6-bit opcode and determines what specific machine instruction it corresponds to, and then triggers the necessary operations of other hardware units. The control logic will be purely combinational. Each hardware component, like the ALU will take certain control inputs; it will be the job of the decoder unit to set those control lines. Note: for R-type instructions, this will be a little more involved.

More Intro MIPS Computer Organization I 6 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens The registers must be organized in some way that makes it possible to conduct a transaction of the form "give me the contents of register number K". Such a device is called a register file. A register file has an input port that accepts a register number (a 5-bit port in our case) from which data will be read. The register file processes that input and channels the contents of the corresponding register to an output port (a 32-bit port in our case). Fetching Register Operands

More Intro MIPS Computer Organization I 7 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens The value fetched from the register must be combined with the 16-bit immediate value from the instruction. This will require an adder circuit, but we will embed that in a more complex arithmetic- logic unit (ALU). The ALU will accept two 32-bit values (operands) and accept control input bits that specify which operation is to be applied to those operands. The ALU will supply the computed result to a 32-bit output port. Note: the ALU will be designed to take 32-bit operands. That means that the 16-bit value taken from the instruction must be widened to 32-bits, and that must be done in such a way that the sign of the immediate value is preserved. Computing the Address

More Intro MIPS Computer Organization I 8 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens There must be a memory unit that has an input port that will accept a 32-bit address. The memory unit must have a control input that specifies a value is to be read from that address (as opposed to being written to it). The memory unit must have a 32-bit output port to which the memory unit can channel the requested data value. Fetching the Data

More Intro MIPS Computer Organization I 9 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens The register file must have an input port that accepts a register number to which data will be written. It will also need a control input to trigger the write operation. Loading the Data to a Register

More Intro MIPS Computer Organization I 10 September 2009 © McQuain, Feng & Ribbens ©2009 McQuain & Ribbens A careful examination of the previous few slides will also reveal the need for a number of connections to channel data from one hardware component to another. For example, there must be a way to move data from the register file's output port to the ALU's input ports. In order to design a datapath for executing MIPS machine language instructions, we must identify all the hardware components we will need, and the necessary connections, and the necessary control logic and control lines… Connections

More Intro MIPS Computer Organization I 11 September 2009 © McQuain, Feng & Ribbens CPU Overview

More Intro MIPS Computer Organization I 12 September 2009 © McQuain, Feng & Ribbens MIPS Registers Registers bit general-purpose registers, referred to as $0, $1, …, $ bit floating-point registers, referred to as $f0, $f1, … $f bit floating-point registers, referred to as $f0, $f2, … $f30 -conventions govern the use of the general registers We will, for now, adopt the view that the underlying computer is a “black box” that understands MIPS machine language.

More Intro MIPS Computer Organization I 13 September 2009 © McQuain, Feng & Ribbens Registers vs. Memory Operands to arithmetic and logical instructions must be registers or immediates. Compiler associates variables with registers What about programs with lots of variables? ProcessorI/O Control Datapath Memory Input Output

More Intro MIPS Computer Organization I 14 September 2009 © McQuain, Feng & Ribbens Memory Organization Viewed as a large, single-dimension array, with an address. A memory address is an index into the array "Byte addressing" means that the index points to a byte of memory bits of data

More Intro MIPS Computer Organization I 15 September 2009 © McQuain, Feng & Ribbens MIPS Memory Organization Bytes are nice, but most data items use larger "words" For MIPS, a word is 32 bits or 4 bytes bits of data Registers hold 32 bits of data 2 32 bytes with byte addresses from 0 to words with byte addresses 0, 4, 8, Words are aligned, that is, each has an address that is a multiple of 4. MIPS can be either big-endian (that is, the address of each word is the address of the “left-most” byte of the word) or little-endian. This is important when viewing the contents of memory.

More Intro MIPS Computer Organization I 16 September 2009 © McQuain, Feng & Ribbens CPU Overview