Storing Integers and Fractions

Slides:



Advertisements
Similar presentations
Sample Test 1 Question. A pattern of binary digits can be interpreted in several different ways. Show how the pattern translates using each of.
Advertisements

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. 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.
Floating Point Numbers
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Lecture 8 Floating point format
Binary Number Systems.
The Binary Number System
Simple Data Type Representation and conversion of numbers
Chapter 3 Number Representation. Convert a number from decimal 、 hexadecimal,octal to binary notation and vice versa. Understand the different representations.
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.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Data Representation and Computer Arithmetic
Representation of data types. Introduction We are going to look at representing cardinal numbers, integers and real numbers in decimal, binary, octal.
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.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
The Teacher CP4 Binary and all that… CP4 Revision.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
The Teacher CP4 Binary and all that… CP4 Revision.
Introduction to Number System
Chapter 2 Data Representation.
Chapter 1  Number Systems Decimal System Binary System Octal System Hexadecimal System  Binary weighted cods Signed number binary order  1’s and 2’s.
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
Floating Point in Binary 1.Place Value Chart:
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
CS 160 Lecture 4 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
CSCI206 - Computer Organization & Programming
Floating Point Numbers
Nat 4/5 Computing Science Lesson 1: Binary
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Data Representation Covering… Binary addition / subtraction
Binary Fractions.
A brief comparison of integer and double representation
Octal to Decimal Decimal Octal Binary Hexadecimal.
Introduction To Computer Science
Number Systems and Binary Arithmetic
Number Systems.
CSE 102 Introduction to Computer Engineering
ECE 103 Engineering Programming Chapter 3 Numbers
Overview Introduction Data representation Fixed Point Representation
CSCI206 - Computer Organization & Programming
Number Representations
Data Representation Data Types Complements Fixed Point Representation
Digital Logic Design (CSNB163)
Number Representation
Numbers representations
The Binary System.
Representation of real numbers
COMS 161 Introduction to Computing
Number Representations
1.6) Storing Integer: 1.7) storing fraction:
Presentation transcript:

Storing Integers and Fractions

1 Storing Integers Two’s complement notation The most popular means of representing integer values

Figure 1.21 Two’s complement notation systems

Figure 1.23 Addition problems converted to two’s complement notation

2 Storing Fractions Floating-point notation In contrast to the storage of integers, the storage of a value with a fractional part requires that we store not only the pattern of 0s and 1s representing its binary representation but also the position of the radix point. A popular way of doing this is based on scientific notation and is called floating-point notation.

2 Storing Fractions Scientific notation: Floating-point notation consists two fields: the exponent field (阶码)and the mantissa field (尾数) Single precision floating point: 32bits, a precision of 7 decimal digits; Double precision floating point: 64bits, a precision of 15 decimal digits

Figure: The storage of Single precision floating point exponent field (1byte) mantissa field (3bytes) sign of exponent (阶符) exponent (阶码) sign of mantissa (数符) mantissa (尾数) 1bit 7bit 23bit 0000101 11010100000000000000000 26.5=11010.1=+0.110101×2+5 N=数符×尾数×2 阶符×阶码

3 Hexadecimal Notation Hexadecimal notation A shorthand notation for long bit patterns Divides a pattern into groups of four bits each Represents each group by a single symbol Example: (10100011)B becomes (A3)H Example: (0.1101011)B becomes (0.D6)H

Figure 1.6 The hexadecimal coding system

4 Octal Notation Octal notation Example: (10100011)B becomes (243)O Divides a pattern into groups of three bits each Represents each group by a single symbol Example: (10100011)B becomes (243)O Example: (0.1101011)B becomes (0.654)O

Figure: Relationship among four kinds of coding system decimal binary octal hexadecimal 0 0000 000 0 1 0001 001 1 2 0010 002 2 3 0011 003 3 4 0100 004 4 5 0101 005 5 6 0110 006 6 7 0111 007 7 8 1000 010 8 9 1001 011 9 10 1010 012 A 11 1011 013 B 12 1100 014 C 13 1101 015 D 14 1110 016 E 15 1111 017 F 16 10000 020 10

4 Octal Notation Summary Two’s complement notation Floating-point notation Hexadecimal notation Octal notation