CS222: Processor Design

Similar documents
CS222: Processor Design

CS101 Introduction to computing Floating Point Numbers

Computer Architecture and IC Design Lab. Chapter 3 Part 2 Arithmetic for Computers Floating Point

Floating Point Arithmetic

Written Homework 3. Floating-Point Example (1/2)

Floating Point Arithmetic

Floating Point COE 308. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals

Number Systems and Computer Arithmetic

Divide: Paper & Pencil

COMPUTER ORGANIZATION AND DESIGN

Floating Point Arithmetic

Lecture 10: Floating Point, Digital Design

5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner. Topic 3: Arithmetic

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

CSCI 402: Computer Architectures. Arithmetic for Computers (4) Fengguang Song Department of Computer & Information Science IUPUI.

Chapter 3 Arithmetic for Computers (Part 2)

Arithmetic for Computers. Hwansoo Han

Floating Point Arithmetic. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

MIPS Integer ALU Requirements

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

Computer Architecture. Chapter 3: Arithmetic for Computers

EE260: Logic Design, Spring n Integer multiplication. n Booth s algorithm. n Integer division. n Restoring, non-restoring

Floating Point Numbers

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

Chapter 3. Arithmetic Text: P&H rev

Review: MIPS Organization

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8

Floating Point : Introduction to Computer Systems 4 th Lecture, May 25, Instructor: Brian Railing. Carnegie Mellon

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers

CS 33. Data Representation (Part 3) CS33 Intro to Computer Systems VIII 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon

Floating Point. CSE 238/2038/2138: Systems Programming. Instructor: Fatma CORUT ERGİN. Slides adapted from Bryant & O Hallaron s slides

Lecture 10: Floating Point, Digital Design

CO212 Lecture 10: Arithmetic & Logical Unit

Foundations of Computer Systems

Floating Point (with contributions from Dr. Bin Ren, William & Mary Computer Science)

Thomas Polzer Institut für Technische Informatik

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Arithmetic (a) The four possible cases Carry (b) Truth table x y

EE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W4-W

Floating-point representations

Floating-point representations

CS222: Mid Semester Exam: Model

UNIT IV: DATA PATH DESIGN

Boolean Algebra. Chapter 3. Boolean Algebra. Chapter 3 Arithmetic for Computers 1. Fundamental Boolean Operations. Arithmetic for Computers

ECE232: Hardware Organization and Design

COMP2611: Computer Organization. Data Representation

Representing and Manipulating Floating Points

Computer Arithmetic Floating Point

9 Floating-Point. 9.1 Objectives. 9.2 Floating-Point Number Representation. Value = ± (1.F) 2 2 E Bias

3.5 Floating Point: Overview

Data Representation Floating Point

Chapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation

Today: Floating Point. Floating Point. Fractional Binary Numbers. Fractional binary numbers. bi bi 1 b2 b1 b0 b 1 b 2 b 3 b j

The Sign consists of a single bit. If this bit is '1', then the number is negative. If this bit is '0', then the number is positive.

Arithmetic. Chapter 3 Computer Organization and Design

Floating Point Numbers

Floating Point Numbers

Data Representation Floating Point

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

CPE300: Digital System Architecture and Design

Representing and Manipulating Floating Points

Chapter 4. The Processor

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

TDT4255 Computer Design. Lecture 4. Magnus Jahre

CO Computer Architecture and Programming Languages CAPL. Lecture 15

Computer Architecture Set Four. Arithmetic

Outline. What Digit? => Number System. Decimal (base 10) Significant Digits. Lect 03 Number System, Gates, Boolean Algebra. CS221: Digital Design

Floating-Point Arithmetic

Chapter 4. Operations on Data

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

CSCI 402: Computer Architectures. Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI.

Floating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.

Module 2: Computer Arithmetic

Inf2C - Computer Systems Lecture 2 Data Representation

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

COMP Overview of Tutorial #2

Chapter 3: Arithmetic for Computers

By, Ajinkya Karande Adarsh Yoga

Systems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties

Floating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.

CS429: Computer Organization and Architecture

Representing and Manipulating Floating Points. Jo, Heeseung

Review: MULTIPLY HARDWARE Version 1. ECE4680 Computer Organization & Architecture. Divide, Floating Point, Pentium Bug

Representing and Manipulating Floating Points

Floating Point January 24, 2008

Topics. 6.1 Number Systems and Radix Conversion 6.2 Fixed-Point Arithmetic 6.3 Seminumeric Aspects of ALU Design 6.4 Floating-Point Arithmetic

Computer Organization: A Programmer's Perspective

FLOATING POINT NUMBERS

Floating-Point Arithmetic

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

Transcription:

CS222: Processor Design Dr. A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1

Outline Previous Class: Floating points: Add, Sub, Mul,Div, Rounding Processor Design: Introduction building blocks A simple implementation: Single Cycle Data path and control Performance considerations Multi cycle design Data path and control Micro programmed control Exception handling 2

FP numbers with base = 2 ( 1) S x F x 2 E S = Sign F = Fraction (fixed point number) usually called Mantissa or Significand E = Exponent (positive or negative integer) How to divide a word into S, F and E? How to represent S, F and E?

Value Range for F Single precision numbers 1 F 2 2 23 or 1 F <2 Double precision numbers 1 F 2 2 52 or 1 F <2 These are normalized.

Value Range for E Single precision numbers 126 E 127 (all 0 s and all 1 s have special meanings) Double precision numbers 1022 E 1023 (ll0 (all 0 s and all 1 s have special meanings)

Overflow and underflow largest positive/negative number (SP) = ±(2 2 23 ) x 2 127 ±2 x 10 38 smallest positive/negative number (SP) = ± 1 x 2 126 ±2 x 10 38 Largest positive/negative number (DP) = ±(2 ( 2 52 ) x 2 1023 ± 2 x 10 308 Smallest positive/negative number (DP) = ± 1 x 2 1022 ± 2 x 10 308

Expressible Numbers

Distribution of Values 6 bit IEEE like format e = 3 exponent bits f = 2 fraction bits Bias is 3 Notice how the distribution gets denser toward zero. -15-10 -5 0 5 10 15 Denormalized Normalized Infinity

Distribution of Values 6 bit IEEE like format e = 3 exponent bits f = 2 fraction bits Bias is 3 (l (close up view) -1-0.5 0 0.5 1 Denormalized Normalized Infinity

Floating point operations: ADD Add/subtract A = A1 ± A2 [( 1) S1 x F1 x 2 E1 ] ± [( 1) S2 x F2 x 2 E2 ] suppose E1 > E2, then we can write it as [( 1) S1 x F1 x 2 E1 ] ± [( 1) S2 x F2 x 2 E1 ] where F2 = F2 / 2 E1 E2, The result is ( 1) S1 x (F1 ± F2 ) x 2 E1 It may need to be normalized

Floating point operations Multiply [( 1) S1 x F1 x 2 E1 ] x [( 1) S2 x F2 x 2 E2 ] = ( 1) S1 S2 x (F1xF2) x 2 E1+E2 Since 1 (F1xF2) < 4, the result may need to be normalized

Float Multiplication Sign Exponent Significand Sign Exponent Significand Small ALU Compare exponents Exponent difference 0 1 0 1 0 1 Control Shift right Shift smaller number right Big ALU Add 0 1 In c rem e nt o r decrem ent 0 1 S hift left o r rig ht N o rm a liz e Rounding hardware Round Sign Exponent Significand 12

Floating point operations Divide [( 1) S1 x F1 x 2 E1 ] [( 1) S2 x F2 x 2 E2 ] = ( 1) S1 S2 x (F1 F2) x 2 E1 E2 Since.5 < (F1 F2) < 2, the result may need to be normalized (assume F2 0)

Testing Associatively with FP X= 1.5x10 38, Y=1.5x10 38, z=1.0 X+(Y+Z) = 1.5x10 38 + (1.5x10 38 + 1.0) = 1.5x100 38 + 1.5x10 38 =0 (X+Y)+Z = ( 1.5x10 38 + 1.5x10 38 ) + 1.0 = 00+ 0.0 1.0 10 =1 14

Accuracy Precision is lost when some bits are shifted to right of the rightmost bit or are thrown Three extra bits are used internally G (guard), R (round) and S (sticky) G and R are simply the next two bits after LSB S = 1 iff any bit to right of R is non zero 1. 1101011010110001011011011 GRS

Rounding using G, R and S if G=1 & R=1, add 1 to LSB if G=0 & R=0 or 1, no change if G=1 & R=0, look at S if S=1, add 1 to LSB if S=0, round to the nearest even i.e., add 1 to LSB if LSB = 1

FP instructions in MIPS 32 floating point registers $f0.. $f31 Single precision ii arithmetic ih i add.s, sub.s, mul.s, div.s, abs.s, neg.s Double precision arithmetic (similar) Conditional branch bc1t, bc1f, c.lt.s, c.lt.d (lt le gt ge eq ne) Conversion cvt.d.s, cvt.d.w, cvt.s.d, cvt.s.w, cvt.w.d, cvt.w.s

Processor Design Introduction building blocks A simple implementation data path and control Performance considerations Multi cycle design data path and control Micro programmed control Exception handling

Simple Processor Design MIPS subset for implementation Design overview Division iii into data path and control Building blocks combinational and sequential Clock and timings Components required for MIPS subset

MIPS subset for implementation Arithmetic logic instructions add, sub, and, or, slt Memory reference instructions lw, sw Control lflow instructions ti beq, j Incremental changes in the design to include other instructions will be discussed later

Generic Implementation Use the program counter (PC) to supply instruction address Get the instruction from memory Read registers Use the instruction to decide exactly what to do

Design overview Instruction Memory Data PC Instruction Address Reg# Register Reg# FILE Reg# ALU Address Data Memory Data 22

Division into Data path and Control DATA PATH control signals CONTROLLER status signals

Building block types Two types of functional units: Elements that operate on data values (combinational) Output is function of current input No memory Elements that contain state (sequential) Output is function of current and previous inputs State = memory

Combinational circuit examples Gates: and, or, nand, nor, xor, inverter Multiplexer Decoder Adder, subtractor, comparator ALU Array multipliers

Sequential circuit examples Flip flops Counters Registers Register files Memories

27