Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.

Slides:



Advertisements
Similar presentations
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Advertisements

Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Integers. Integer Storage Since Binary consists only of 0s and 1s, we can’t use a negative sign ( - ) for integers. Instead, the Most Significant Bit.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Chapter 1.7 Storing Fractions. Excess Notation, continued… In this notation, "m" indicates the total number of bits. For us (working with 8 bits), it.
Floating Point Numbers
Representing Information as Bit Patterns
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.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Signed Numbers.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Floating Point Numbers
Number Representation Rizwan Rehman, CCS, DU. Convert a number from decimal to binary notation and vice versa. Understand the different representations.
Lecture 8 Floating point format
Operations on data CHAPTER 4.
Binary Number Systems.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
Data Representation Number Systems.
Simple Data Type Representation and conversion of numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Computer Science 111 Fundamentals of Programming I Number Systems.
Computer Architecture
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
9.4 FLOATING-POINT REPRESENTATION
Binary Fractions. Fractions A radix separates the integer part from the fraction part of a number Columns to the right of the radix have negative.
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Chapter 3 Number Representation. Convert a number from decimal to binary notation and vice versa. Understand the different representations of an integer.
Negative Numbers An alternative way to find the 2's complement Starting at the right 1. Copy bits until you reach the first Flip all the remaining.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
©Brooks/Cole, 2003 Chapter 4 Operations on Bits. ©Brooks/Cole, 2003 Apply arithmetic operations on bits when the integer is represented in two’s complement.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Floating Point Arithmetic
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Floating Point in Binary 1.Place Value Chart:
Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems
Floating Point Binary A2 Computing OCR Module 2509.
IT1004: Data Representation and Organization Negative number representation.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
Representation of Data (Part II) Computer Studies Notes: chapter 19 Ma King Man.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Lecture 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Floating Point Representations
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Backgrounder: Binary Math
Introduction To Computer Science
Number Representation
Storing Integers and Fractions
Representation of real numbers
COMS 161 Introduction to Computing
Chapter3 Fixed Point Representation
OBJECTIVES After reading this chapter, the reader should be able to :
1.6) Storing Integer: 1.7) storing fraction:
Presentation transcript:

Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park

Outline  Bits and their storage(prev. file)  Main memory(prev. file)  Mass storage(prev. file)  Representing information as bit patterns(prev. file)  Binary system(prev. file)  Storing integers  Storing fractions

Representing Integers  Unsigned integers can be represented in base ___  ______ integers = numbers that can be positive or negative  Sign and magnitude notation  Two’s complement notation  Excess notation

Sign and Magnitude Notation  Left hand bit is used to determine the ___ of the number  Left hand bit 0 = positive number0010 = +2  Left hand bit 1 = negative number1010 = -2  Using 4 bits with sign and magnitude, largest positive number represented is __ (-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7)  ___ values overall can be represented  +2 added to -2 using regular binary addition does ___ _____ to 0

Two’s Complement Notation (1/2)  For a positive number, the two’s complement representation is _____  For a negative number, ___________ positive value and then ____ 1  3 in two’s complement is 011  -3 in two’s complement is = 101

Two’s Complement Notation (2/2)  What is the decimal value of 1010 in two’s complement?  It is a negative number since left hand bit is 1  Complement it and add 1: = 0110 (+6)  Therefore the decimal value is -6

Two’s Complement Addition

Overflow Problem  Try adding in 4-bit two’s complement notation  Result is negative value (-7)  Such an error is called ________  When using two’s complement notation, this might occur when adding two ________ values or when adding two ________ values  Normally integers are represented in 32-bit patterns, allowing for positive values as large as 2,147,483,647

Excess Notation (1/3)  Excess four notation  All positive numbers begin with 1  All negative numbers begin with 0  0 is represented as ___  Smallest negative number is ___  Largest positive number is ___  Why 4? (2 #of bits –1 ) = = 4

Excess Notation (2/3)

Excess Notation (3/3)  What is the decimal value of 101 in excess four notation?  101 if interpreted unsigned is 5  101 in excess four notation is (5-4) = 1  What is the excess four notation for decimal value 3?  Add four: 3+4 = 7  Represent it in 3-bit binary pattern = 111

Excess Eight Notation

Storing Fractions (1/6)  Need to represent ______ and ______ of radix point  Use ___________ notation 1 bit:Sign bit (0 positive, 1 negative) 3 bits:Exponent (encodes position of radix point in excess four ) 4 bits:Mantissa (encodes number)

Storing Fractions (2/6)  What is the decimal value of in floating-point notation?  First bit is 0, then positive  Exponent is 110 and mantissa is 1011  Extract mantissa and place a radix point on its left side  Extract exponent and interpret as excess four notation  110 in excess four is +2 (make sure?)  +2 exponent means move radix point to the right by two bits (a negative exponent means move radix to left)  becomes 10.11

Storing Fractions (3/6)  What is the decimal value of in floating-point notation?  First bit is 1, then negative  Exponent is 011and mantissa is 1100  Extract mantissa and place a radix point on its left side  Extract exponent and interpret as excess four notation  011 in excess four is -1 (make sure?)  -1 exponent means move radix point to the left by 1 bit  becomes

Storing Fractions (4/6)  What is the floating point notation of the number ?  Express the number in binary to obtain (make sure?)  Copy bit pattern into mantissa field from left to right starting with the leftmost 1 in binary representation  Mantissa is 1001  Compute exponent to get from.1001 (imagine mantissa with radix point at its left)  Need to move radix point to right one bit  Exponent is +1  Express exponent in excess four notation: 1+4 = 5 (101)  Therefore,

Storing Fractions (5/6)  What is the floating point notation of the number ?  Express number in binary to obtain 0.01  Copy bit pattern into mantissa field from left to right starting with the leftmost 1 in binary representation  Mantissa is 1000 (you append zeros to fill the 4-bit mantissa)  Compute exponent to get 0.01 from  Need to move radix point to left one bit  Exponent is -1  Express exponent in excess four notation: -1+4 = 3 (011)  Therefore,

Storing Fractions (6/6)  What is the floating point notation of the number ?  We end up with the bit pattern , which represents 2 1 /2 instead of 2 5 /8  What has occurred is called a truncation error or round-off error