Lecture 3 Number Representation 2 This week – Recap Addition – Addition circuitry – Subtraction of integers in binary – Representing numbers with fractional.

Slides:



Advertisements
Similar presentations
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Advertisements

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
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
Assembly Language and Computer Architecture Using C++ and Java
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.
Floating Point Numbers
Floating Point Numbers
Data Representation 3 This week – Recap on Floating point number – ASCII – unicode.
Number Representation Rizwan Rehman, CCS, DU. Convert a number from decimal to binary notation and vice versa. Understand the different representations.
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 Numbers 1.Binary and Denary RecapBinary.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Chapter 5 Data representation.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
Simple Data Type Representation and conversion of numbers
Binary Representation. Binary Representation for Numbers Assume 4-bit numbers 5 as an integer  as an integer  How? 5.0 as a real number  How?
Data Representation – Binary Numbers
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic Nizamettin AYDIN
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.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
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.
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
9.4 FLOATING-POINT REPRESENTATION
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.
CSC 221 Computer Organization and Assembly Language
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Fractions in Binary.
Number Systems & Operations
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:
Binary Arithmetic.
Floating Point Binary A2 Computing OCR Module 2509.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Number Representation 1 Lecture 2. Outcomes By the end of the session you should: – Understand what bits/bytes/words are. – Understanding conversion between.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Software Design and Development Storing Data Computing Science.
Starter Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard Using two’s.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Floating Point Numbers Dr. Mohsen NASRI College of Computer and Information Sciences, Majmaah University, Al Majmaah
Floating Point Numbers
CS2100 Computer Organisation
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Data Representation Covering… Binary addition / subtraction
Introduction To Computer Science
Data Representation Binary Numbers Binary Addition
ECE 103 Engineering Programming Chapter 3 Numbers
CS1010 Programming Methodology
Data Structures Mohammed Thajeel To the second year students
Unit 18: Computational Thinking
Number Representation
OBJECTIVES After reading this chapter, the reader should be able to :
Presentation transcript:

Lecture 3 Number Representation 2 This week – Recap Addition – Addition circuitry – Subtraction of integers in binary – Representing numbers with fractional parts

For example _____ = ^ Carry __|

Using these rules pairs of numbers plus a carry bit are added together starting for the right. When there is no carry from the previous addition operation the carry bit plays no part in the calculation it is as if the calculation was just bits A and B. When carry bit is set (a carry from the previous operation) the calculation is A+B+Carry. The carry bit after the final addition operation is ignored.

Binary subtraction Binary subtraction is performed by converting the second number into it’s two’s complement and adding. So there is not a need for a subtracting circuit. As an example: 14-6

Subtraction Example Number A= Number B= Reverse bits in Number B B 2’s Complement = C ’s Complement of add

How do we represent numbers with fractional parts? One way would to say that so many bits will represent whole numbers, and the remainder will represent fractional number such as 0.5, 0.25 or An example of this could be the three most significant bits are used to represent whole numbers, the remaining bits represent 1/powers of 2 (e.g. 1/2, 1/4, 1/8, 1/6). The binary point (equivalent to a decimal point in decimal numbers) is between 1 and 1/2.

421½¼1/81/

Therefore, from table 1 this number represents the decimal number = So the number can be split into two parts the whole number part (in this case 101 (which is 5 in decimal)) and a fractional part 101.

Floating-point numbers Often we want to represent very small, very large numbers or numbers with fractional parts. For example, or the binary format we have already met is not capable, so we need another form. One way of doing this is scientific notation where these numbers are split into two parts a number with a decimal point within it (called the mantissa) and a power of 10 (called the exponent).

Fixed NotationScientific Notation MantissaExponent x x

So for example, the decimal number could be represented as If we use this mantissa and exponent idea, it could also be written as x2 3 (Normalised) where the exponent shows the true position of the binary point (no longer a decimal point, as we are not using the decimal system) relative to the current position. Because the binary point can be altered depending on the magnitude of the exponent, it often refereed to as a floating-point representation.

IEEE standard (single precision) SignExponentMantissa Bit 31Bits 23-30Bits ve

Features with floating point representation Gives a wide range of numbers It is not precise Precision and Range can be improved using more bits (64 bits in Double precision) – Bit 63 for sign, – bits for exponent – Bits 0 to 51 for mantissa

Summary There is no subtraction circuit, but there is addition circuitry. Subtract of binary integers can be converting a positive number into 2’s complement. Floating point number: ((sign)x(1+stored mantissa))x2 (stored exponent-127)

IEEE standard (single precision) SignExponentMantissa Bit 31Bits 23-30Bits ve

Sources for further reading Dick D(2003) pages Chalk et al (2004) pages Burrel (2004) Chapter 2 - pages Tannebaum (2005) pages