1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.

Slides:



Advertisements
Similar presentations
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
Advertisements

Chapter Three.
Computer Organization CS224 Fall 2012 Lesson 19. Floating-Point Example  What number is represented by the single-precision float …00 
05/03/2009CA&O Lecture 8,9,10 By Engr. Umbreen sabir1 Computer Arithmetic Computer Engineering Department.
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
CSCE 212 Chapter 3: Arithmetic for Computers Instructor: Jason D. Bakos.
1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
Chapter 3 Arithmetic for Computers. Multiplication More complicated than addition accomplished via shifting and addition More time and more area Let's.
1 Ó1998 Morgan Kaufmann Publishers Chapter 4 計算機算數.
1 Lecture 11: Digital Design Today’s topics:  Evaluating a system  Intro to boolean functions.
1 Lecture 15: Recap Today’s topics:  Recap for mid-term Reminders:  no class Thursday  office hours on Monday (10am-4pm)  mid-term Tuesday (arrive.
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 11: Floating Point Partially adapted from Computer Organization and Design, 4 th edition,
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
1 Lecture 10: FP, Performance Metrics Today’s topics:  IEEE 754 representations  FP arithmetic  Evaluating a system Reminder: assignment 4 due in a.
Systems Architecture Lecture 14: Floating Point Arithmetic
Logic Gates Circuits to manipulate 0’s and 1’s. 0’s and 1’s used for numbers Also to make decisions within the computer. In that context, 1 corresponds.
Binary Codes Computers and other digital systems "work" with binary numbers. I/P & O/P is usually done using decimal numbers, alphabetics, special symbols.
Computer Arithmetic Nizamettin AYDIN
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
Ellen Spertus MCS 111 October 11, 2001 Floating Point Arithmetic.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 5 Unsigned integer and floating point.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Lecture 9: Floating Point
Floating Point Representation for non-integral numbers – Including very small and very large numbers Like scientific notation – –2.34 × –
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Floating-Point Representation We can store integers and characters easily in binary, but what about fractions? ¼ =.25 = 2.5 * *
The Karnaugh Map.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
CDA 3101 Fall 2013 Introduction to Computer Organization
Rounding Modes 3 Rounding: the process to obtain the best possible floating-point representation for a given real value. ANSI/IEEE standard:
CS/COE0447 Computer Organization & Assembly Language
Chapter 3 Arithmetic for Computers CprE 381 Computer Organization and Assembly Level Programming, Fall 2012 Revised from original slides provided by MKP.
Ellen Spertus MCS 111 October 16, 2001 Review. 2 What you will learn this semester Given devices that implement simple boolean functions… Understand how.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
C OMPUTER O RGANIZATION AND D ESIGN The Hardware/Software Interface 5 th Edition Chapter 3 Arithmetic for Computers.
CSE 340 Simulation Modeling | MUSHFIQUR ROUF CSE340:
1 Lecture 15: Recap Today’s topics:  Recap for mid-term.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
COMPUTER ORGANIZATION ARITHMETIC YASSER MOHAMMAD.
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 & Operations I
Morgan Kaufmann Publishers Arithmetic for Computers
Lecture 11: Hardware for Arithmetic
Computer Architecture & Operations I
Lecture 9: Floating Point
CS/COE0447 Computer Organization & Assembly Language
William Stallings Computer Organization and Architecture 7th Edition
Arithmetic for Computers
Lecture 10: Floating Point, Digital Design
Computer Arithmetic Multiplication, Floating Point
ECEG-3202 Computer Architecture and Organization
Lecture 11: Hardware for Arithmetic
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Digital Logic.
Digital System Design II 数字系统设计2
Digital Circuits and Logic
Presentation transcript:

1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions

2 Examples Final representation: (-1) S x (1 + Fraction) x 2 (Exponent – Bias) Represent ten in single and double-precision formats Single: ( ) Double: ( ) What decimal number is represented by the following single-precision number? …0000

3 Examples Final representation: (-1) S x (1 + Fraction) x 2 (Exponent – Bias) Represent ten in single and double-precision formats Single: ( ) …000 Double: ( ) …000 What decimal number is represented by the following single-precision number? …

4 FP Addition Consider the following decimal example (can maintain only 4 decimal digits and 2 exponent digits) x x Convert to the larger exponent: x x 10 1 Add x 10 1 Normalize x 10 2 Check for overflow/underflow Round x 10 2 Re-normalize

5 FP Addition Consider the following decimal example (can maintain only 4 decimal digits and 2 exponent digits) x x Convert to the larger exponent: x x 10 1 Add x 10 1 Normalize x 10 2 Check for overflow/underflow Round x 10 2 Re-normalize If we had more fraction bits, these errors would be minimized

6 FP Multiplication Similar steps:  Compute exponent (careful!)  Multiply significands (set the binary point correctly)  Normalize  Round (potentially re-normalize)  Assign sign

7 MIPS Instructions The usual add.s, add.d, sub, mul, div Comparison instructions: c.eq.s, c.neq.s, c.lt.s…. These comparisons set an internal bit in hardware that is then inspected by branch instructions: bc1t, bc1f Separate register file $f0 - $f31 : a double-precision value is stored in (say) $f4-$f5 and is referred to by $f4 Load/store instructions (lwc1, swc1) must still use integer registers for address computation

8 Code Example float f2c (float fahr) { return ((5.0/9.0) * (fahr – 32.0)); } (argument fahr is stored in $f12) lwc1 $f16, const5 lwc1 $f18, const9 div.s $f16, $f16, $f18 lwc1 $f18, const32 sub.s $f18, $f12, $f18 mul.s $f0, $f16, $f18 jr $ra

9 Fixed Point FP operations are much slower than integer ops Fixed point arithmetic uses integers, but assumes that every number is multiplied by the same factor Example: with a factor of 1/1000, the fixed-point representations for 1.46, , and 5624 are respectively 1460, 1720, and More programming effort and possibly lower precision for higher performance

10 Subword Parallelism ALUs are typically designed to perform 64-bit or 128-bit arithmetic Some data types are much smaller, e.g., bytes for pixel RGB values, half-words for audio samples Partitioning the carry-chains within the ALU can convert the 64-bit adder into 4 16-bit adders or 8 8-bit adders A single load can fetch multiple values, and a single add instruction can perform multiple parallel additions, referred to as subword parallelism

11 Digital Design Basics Two voltage levels – high and low (1 and 0, true and false) Hence, the use of binary arithmetic/logic in all computers A transistor is a 3-terminal device that acts as a switch V V 0 0 Conducting 0 V 0 V Non-conducting

12 Logic Blocks A logic block has a number of binary inputs and produces a number of binary outputs – the simplest logic block is composed of a few transistors A logic block is termed combinational if the output is only a function of the inputs A logic block is termed sequential if the block has some internal memory (state) that also influences the output A basic logic block is termed a gate (AND, OR, NOT, etc.) We will only deal with combinational circuits today

13 Truth Table A truth table defines the outputs of a logic block for each set of inputs Consider a block with 3 inputs A, B, C and an output E that is true only if exactly 2 inputs are true A B C E

14 Truth Table A truth table defines the outputs of a logic block for each set of inputs Consider a block with 3 inputs A, B, C and an output E that is true only if exactly 2 inputs are true A B C E Can be compressed by only representing cases that have an output of 1

15 Boolean Algebra Equations involving two values and three primary operators:  OR : symbol +, X = A + B  X is true if at least one of A or B is true  AND : symbol., X = A. B  X is true if both A and B are true  NOT : symbol, X = A  X is the inverted value of A

16 Boolean Algebra Rules Identity law : A + 0 = A ; A. 1 = A Zero and One laws : A + 1 = 1 ; A. 0 = 0 Inverse laws : A. A = 0 ; A + A = 1 Commutative laws : A + B = B + A ; A. B = B. A Associative laws : A + (B + C) = (A + B) + C A. (B. C) = (A. B). C Distributive laws : A. (B + C) = (A. B) + (A. C) A + (B. C) = (A + B). (A + C)

17 DeMorgan’s Laws A + B = A. B A. B = A + B Confirm that these are indeed true

18 Pictorial Representations AND OR NOT What logic function is this? Source: H&P textbook

19 Boolean Equation Consider the logic block that has an output E that is true only if exactly two of the three inputs A, B, C are true

20 Boolean Equation Consider the logic block that has an output E that is true only if exactly two of the three inputs A, B, C are true Multiple correct equations: Two must be true, but all three cannot be true: E = ((A. B) + (B. C) + (A. C)). (A. B. C) Identify the three cases where it is true: E = (A. B. C) + (A. C. B) + (C. B. A)

21 Sum of Products Can represent any logic block with the AND, OR, NOT operators  Draw the truth table  For each true output, represent the corresponding inputs as a product  The final equation is a sum of these products A B C E (A. B. C) + (A. C. B) + (C. B. A) Can also use “product of sums” Any equation can be implemented with an array of ANDs, followed by an array of ORs

22 Title Bullet