Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recap Add these numbers together in binary

Similar presentations


Presentation on theme: "Recap Add these numbers together in binary"— Presentation transcript:

1 Recap Add these numbers together in binary 4+9 7+10 67+43
Add these negative numbers together in binary (remember the steps) 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

2 Real numbers

3 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

4 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 is? What is sign and magnitude? What is Two’s Compliment? What are the 2 steps for Two’s Compliment?

5 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.

6 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???

7 Fix the problem – Floating Point!
We need to store bigger numbers! Have you seen this before? 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

8 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

9 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 (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

10 Worked Examples Still using 10 bits for Mantissa and 6 for Exponent
Convert these into Decimal…

11 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?

12 Homework Watch the following video:
(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)


Download ppt "Recap Add these numbers together in binary"

Similar presentations


Ads by Google