Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP 2610 1.

Slides:



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

COMP2130 Winter 2015 Storing signed numbers in memory.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
CENG536 Computer Engineering department Çankaya University.
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Floating Point Numbers
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
COE 308: Computer Architecture (T032) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (cont.) (Appendix A, Computer Architecture: A Quantitative.
Floating Point Numbers
1 Lecture 4: Arithmetic for Computers (Part 5) CS 447 Jason Bakos.
Floating Point Numbers
Quiz 1.1 Convert the following unsigned binary numbers to their decimal equivalent: Number2 Number
Computer Science 210 Computer Organization Floating Point Representation.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
Data Representation – Binary Numbers
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Lecture 9: Floating Point
CSC 221 Computer Organization and Assembly Language
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
Fractions in Binary.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Floating Point in Binary 1.Place Value Chart:
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
PHY 201 (Blum)1 Shift registers and Floating Point Numbers Chapter 11 in Tokheim.
Chapter 8 - Exponents Scientific Notation. Mental Math Multiplying: Move the decimal to the right 47 x x x x
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
R EPRESENTATION OF REAL NUMBER Presented by: Pawan yadav Puneet vinayak.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Learning Objectives 3.3.1f - Describe the nature and uses of floating point form 3.3.1h - Convert a real number to floating point form Learn how to normalise.
Floating Point. Binary Fractions.
Floating Points & IEEE 754.
Floating Point Numbers
Floating Point Representations
Dr.Faisal Alzyoud 2/20/2018 Binary Arithmetic.
Computer Science 210 Computer Organization
Introduction To Computer Science
Computer Architecture & Operations I
Floating Point Representations
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
Binary Numbers Material on Data Representation can be found in Chapter 2 of Computer Architecture (Nicholas Carter) CSC 370 (Blum)
Integers in 2’s compliment Floating point
CSCI206 - Computer Organization & Programming
Number Representations
EEL 3705 / 3705L Digital Logic Design
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
CS 105 “Tour of the Black Holes of Computing!”
COMS 161 Introduction to Computing
Floating Point Numbers
Numbers with fractions Could be done in pure binary
Number Representations
Lecture 9: Shift, Mult, Div Fixed & Floating Point
CS 105 “Tour of the Black Holes of Computing!”
Presentation transcript:

Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP

Bit Vectors There are many occasions when you want to store independently whether a particular part of a system is busy or available For example, consider tracking whether a particular taxicab at a company is in use

Bit Vectors To do this, assume we have n units to keep track We can use a single bit for each unit, thus requiring n bits This is called a bit vector We arbitrarily assume what 0 and 1 represent

Bit Vectors Suppose we have 8 machines to monitor with respect to their availability with a 8 bit BUSYNESS bit vector Here, 1=unit is free, 0=unit is busy Bits are labeled right to left, 0 to 7

Bit Vectors Suppose BUSYNESS is What does this mean? What work is assigned to unit 7 What is the new bit vector? How do we use a logical operation to do this?( AND )

Bit Vectors Suppose unit 5 finishes it’s task We need to update the BUSYNESS vector so that unit 5 is free How do we do this with a logical operation?

Precision We’ve used 16 bit values to represent our range of integers With 16 bits, we can represent 0 to or to in signed values That is, the range of values is …

Precision For this case, we say the precision of the data type is 15 bits and the range is 2 15 In general, for n bits our signed range is -2 n-1 …2 n-1 -1 This corresponds to a precision of n-1 bits and a range of 2 n-1

Floating Point Data Type So far, we have only learned how to store integers on the computer What if we want to store the number 2.73? We have to use the floating point data type We do not use the entire 16 bits to store the precision of the value But we do not have enough of a range!

Floating Point Data Type Most ISAs have a data type called float, which is 32 bits arranged as follows – 1 bit for sign – 8 bits for range of exponent – 23 bits for the precision or fraction This is called the IEEE Standard for Floating Point Arithmetic

Floating Point Data Type

Note the exponent is not allowed to be either 0 or 255 These are special cases for the numbers This is similar to scientific notation Recall normalized scientific numbers are in the form A x 10 p where 1<=A<10

Floating Point Data Type Consider the number 3.75 First convert the number to binary form – We have (3) 10 = (11) 2 Now, how about 0.75 part? We can convert this by multiplying by 2(instead of dividing) This moves the decimal one space to the right

Floating Point Data Type 0.75x2 = 1.50 Truncate the whole part and repeat: 0.50x2 = x2 = 0.00 … So our bits are ( …) 2

Floating Point Data Type Now we move the decimal to the left, to get it in the correct form 1.xxxx: = x 2 1 So we have S=0, exponent = 127+1=128 = ( ) 2, fraction=( ) 2 FP Value =

Floating Point Data Type What does the floating point data type represent? S=0, positive Exponent = ( ) 2 = 123 So, the power is =2 -4

Floating Point Data Type Fraction = Thus, our number is – 1 x 2 -4 – Or 1/16