Recap Add these numbers together in binary

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION Y. Colette Lemard February
Advertisements

Floating Point Numbers
Booth’s Algorithm.
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.
Signed Numbers.
Floating Point Numbers
מבנה מחשב תרגול 2 ייצוג מספרים רציונליים. תמר שרוט, נועם חזון Fixed Point vs. Floating Point We’ve already seen two ways to represent a positive integer.
Quiz 1.1 Convert the following unsigned binary numbers to their decimal equivalent: Number2 Number
Mathematics with Binary. Question  Below is a binary string  Which is the least significant bit (LSB)?  Which is the most significant bit (MSB)? 0.
Binary numbers. 1 Humans count using decimal numbers (base 10) We use 10 units: 0, 1, 2, 3, 4, 5, 6, 7, 8 and (5.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Binary Number Systems.
The Binary Number System
Data Representation Number Systems.
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?
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Factional Values What is 0.75 in binary?. How could we represent fractions? In decimal: – As fractions : 1/5.
IT253: Computer Organization
The Teacher CP4 Binary and all that… CP4 Revision.
The Teacher CP4 Binary and all that… CP4 Revision.
Introduction to Number System
Fractions in Binary.
Extending Binary In today’s lesson we will look at: representing different types of numbers possible errors binary coded decimal (BCD) comparing BCD with.
Computers and Numbers. Types of Numbers Computers store two different types of numbers: Whole Numbers AKA Integers (mathematics) AKA Fixed Point Numbers.
Binary & Normalization What is Normalization? We discussed this the other day (special review session slides, near the end) Can someone tell us.
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.
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.
973cs111_add_posneg.ppt Integers Whole numbers Do NOT contain decimal points (as in money) 43,689 is an integer 43, is NOT an integer (it is floating.
FLOATING-POINT NUMBER REPRESENTATION
Lesson Objectives Aims You should know about: Binary numbers ‘n’ that.
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
Topic: Binary Encoding – Part 2
Objectives Today: P4 Data Types – Floating Points P4 Variable Quiz P3 Iteration and Selection Practical Are you logged on? Then come around the table Unit.
Backgrounder: Binary Math
Binary -ve and +ve numbers!.
A brief comparison of integer and double representation
Negative numbers: Week 10 Lesson 1
Introduction To Computer Science
Binary numbers: Week 7 Lesson 1
Computer Science 210 Computer Organization
Numbers in a Computer Unsigned integers Signed magnitude
Lesson objectives Understand how computers represent and manipulate numbers [unsigned integers, signed integers (sign and magnitude, Two’s complement)
Binary Arithmetic.
Computer Science 210 Computer Organization
Topic 3: Data Signed Binary.
Fundamentals of Data Representation
Number Representation
Storing Negative Integers
Binary “There are 10 types of people in the world: Those who understand binary, and those who don't.”
How are negative and rational numbers represented on the computer?
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Starter Using the fingers on only one hand, what is the highest number you can count to? Rules: You must start at 1 You must count sequentially (i.e.
Representation of real numbers
23/04/2019 Data Representation Conversion.
Floating Point Numbers
Data Binary Arithmetic.
Chapter3 Fixed Point Representation
Floating Point Binary Part 1
Computer Systems Nat 4/5 Computing Science Data Representation
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
OBJECTIVES After reading this chapter, the reader should be able to :
Two’s Complement & Binary Arithmetic
Section 6 Primitive Data Types
Presentation transcript:

Recap Add these numbers together in binary 4+9 7+10 67+43 4+9 7+10 67+43 Add these negative numbers together in binary (remember the steps) 7+-4 10+-3 15+-7 Times these numbers together using binary 5x4 2x7 8x3 Find the positive Flip the bits Add one Add them together Remove the most significant bit 2x4 0010 0100 0000 00000 001000 0000000 0001000

Real numbers

Learning Objectives 3.1.2 Understand how computers represent and manipulate numbers [unsigned integers, signed integers (sign and magnitude, Two’s complement) real numbers] 3.1.3 Be able to convert between binary and denary whole numbers (0-255) and vice versa

Re-cap! What is an integer? What is a real number? How do you convert denary 16 into binary? How do you know what the decimal value of 0000 1111 is? What is sign and magnitude? What is Two’s Compliment? What are the 2 steps for Two’s Compliment?

Real Numbers So far we have only been able to represent whole numbers. …but there are an infinite number of fractions… We don’t have infinite space (bits) to store them. This causes a problem.

Let’s stick with what we know. 100 10 1 . 1/10 1/100 3 6 7 5 Look at the denary example above. We have 1 hundred, 3 tens, 6 units, 7 tenths and 5 hundredths. 128 64 32 16 8 4 2 1 . 1/2 1/4 1/8 1/16 Here we have the same number stored – using FIXED POINT There is a problem though… the first bit after the point is worth ½ in decimal it is worth 1/10 – so this way is less accurate! So we need to decide… do we use more of the bits after the point to increase the accuracy… but decrease the range…. Or vice versa???

Fix the problem – Floating Point! We need to store bigger numbers! Have you seen this before? 0.12 x 1013 What does it mean? 1,200,000,000,000 What we have is the Mantissa and Exponent 0.12 x 1013 0.12 x 1013

Standard Form This is called standard form The Mantissa holds the digits The Exponent defines where to put the decimal point. In this example it moved 13 places to the right. 0.12 x 1013

Now in binary… Mantissa Exponent 0 110100000 000011 = 0.1101 x 23 0.1101 011 Here we have used 16 bits – (2 bytes) – using 10 bits for the mantissa and 6 for the exponent. The sign bit shows positive 0 The mantissa shows 0.1101 (because the point starts after the sign bit) The exponent says move 3 places to the right. We end up with 110.1 What is that in Denary? - 6.5

Worked Examples Still using 10 bits for Mantissa and 6 for Exponent Convert these into Decimal… 0 101010000 000010 0 110110000 000100

Plenary What numbers are real numbers? What elements make up a floating point number? What are the benefits of using floating point over fixed point?

Homework Watch the following video: https://www.youtube.com/watch?v=PZRI1IfStY0 (link on RLP) Google “floating point” In your own words, explain what floating point is, explain why we use it and give a worked example like we have done in class. Submission on RLP, 2 lessons time (Monday)