Download presentation
Presentation is loading. Please wait.
Published byLoren Marshall Modified over 8 years ago
1
Starter Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard. 1.-102. -363. -23 Using two’s Complement form convert the following from Binary to Denary. Answer on mini whiteboard. 1.110000002. 111111003. 00010000 What is the decimal value of the following fractions. Answer on mini whiteboard. 1. ½ 2. ¼ 3. 1/8 4. 1/16
2
Starter - Answers Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard. 1.11110110 2. 11011100 3. 11101001 Using two’s Complement form convert the following from Binary to Denary. Answer on mini whiteboard. 1.-642. -43.16 ½ = 0.5, ¼ = 0.25 1/8 = 0.1251/16 = 0.0625
3
Representing Real Numbers (Numbers with decimal points) in Binary (Textbook Page 195-198)
4
HOMEWORK / INDEPENDENT LEARNING 1)Revise for a test next week. Test will cover all work covered since September including this week. (Monday beginning of lesson)
5
Objective 1.Understand that Real numbers maybe represented as Fixed Point Binary numbers. 2.Understand that Real numbers maybe represented as Floating Point Binary numbers.
6
Fixed Point Method In this method of representing real numbers a decimal point is fixed and all numbers to the right of that point are its decimal part. In an 8-bit binary number with 4 bits for the integer part (using a sign bit) and four bits for the fraction part the number heading would look like this Sign410.50.250.1250.06252 Decimal Point
7
Fixed Point Method Example: Represent the number 6.75 using the fixed point method with 4 bits for the integer (using a sign bit) and four bits for the fraction part. Sign410.50.250.1250.06252 01011001 = 6.75
8
Fixed Point Method Exercises Complete the following exercises using the fixed point method with 4 bits for the integer (using a sign bit) and four bits for the fraction part. 1.Binary number 010111002. Denary 2.125 3. 2’s complement 11001011 4. What is the largest denary number that can be represented?
9
Fixed Point Method Exercises Answers 1.5.75 2. 00100010 3. 11001011 using the rule convert the 2’s complement back to positive = 0011.0101. Then convert to denary and don’t forget the MINUS sign = -3.3125 4. 01111111 = 7.9375
10
Fixed Point Binary Number Exercises Complete Q1, Q2 & Q3 from the book Page 196 in pairs. Take it in turns to complete each question and talk it through with each other.
11
Floating Point Binary Using the fixed point binary method limits the range of numbers that can be used. This method makes inefficient use of the computers memory to hold numbers. The floating point binary number method overcomes the inefficiencies of the fixed point method.
12
Floating Point Binary Method The floating point binary number method is very similar to the coefficient method we use in maths. In this method large numbers like 1,200,000 can be written as 0.12 x 10 7. Here the 0.12 is known as the mantissa (or coefficient) and the 7 is called the exponent. The same technique can be used for binary numbers.
13
Advantages & Disadvantages of Floating Point Binary 1.Greater range of numbers can be represented Disadvantages 1.More storage space is needed 2.Slower processing times 3.Lack of precision – some real numbers can only be represented approximately
14
Floating Point Binary Method In this example two bytes (16 bits) might be divided into 10 bits for the mantissa(including a sign bit) and 6 for the exponent. +- Mantissa Exponent 0 110100000 000011
15
Convert Positive Denary to Floating Point Binary Convert 23.75 to floating point using a 16 bit mantissa and 4 bit exponent. Step 1 – Convert the whole number part to binary = 23 = 10111 Step 2 – Convert the decimal number part to binary = 0.75 = 0.11
16
Floating Point Binary Method Convert Denary to Floating Point Binary Step 3 – Put the two parts together = 10111.11 Step 4 – Add a sign bit = 0 10111.11 Step 5 – Add x number of zeros to the end to fill up the mantissa (16 bits) = 0 10111.1100000000 Step 6 – Move the decimal point to the LEFT after the MSB = 0.101111100000000
17
Floating Point Binary Method Convert Denary to Floating Point Binary Step 7 – The exponent equals how many bits the decimal point has moved = 5 Step 8 – Convert the exponent to binary = 0101 Step 9 – Put the mantissa & exponent together for the final answer = 0 101111100000000 0101
18
Floating Point Method Exercises Complete the following exercises using the floating point method with 16 bits for the mantissa and 4 bits for the exponent. Work in pairs, convert: 1.37.25 2.15.75 3.21.125 4.6.875 5.20.5
19
Floating Point Method Answers 1.37.25 = 100101.01 = 0.100101010000000 = 0 100101010000000 exponent = 6 = 0110 = 0 100101010000000 0110 2.15.75 = 1111.11 = 0 1111.11000000000 = exponent = 4 = 0100 0 111111000000000 0100 3. 21.125 = 10101.001 = 0 10101.0010000000 = exponent = 5 = 0101 0 101010010000000 0101 4. 6.875 = 110.111 = 0 110.111000000000 = exponent = 3 = 0011 0 110111000000000 0011 5. 20.5 = 10100.1 = 0 10100.1000000000 = exponent = 5 = 0101 0 101001000000000 0101
20
Convert Negative Denary to Floating Point Binary Convert -23.75 to floating point using a 16 bit twos complement mantissa and 4 bit twos complement exponent. Step 1 – Convert the whole positive number part to binary = 23 = 10111 Step 2 – Convert the decimal number part to binary = 0.75 = 0.11
21
Floating Point Binary Method Convert Denary to Floating Point Binary Step 3 – Put the two parts together = 10111.11 Step 4 – Uses twos complement to convert mantissa = 01000.01 Step 5 – Add a sign bit = 1 01000.01 Step 6 – Add x number of zeros to the end to fill up the mantissa (16 bits) = 1 01000.0100000000
22
Floating Point Binary Method Convert Denary to Floating Point Binary Step 7 – Move the decimal point to the LEFT after the MSB = 1.010000100000000 Step 8 – The exponent equals how many bits the decimal point has moved = 5 Step 9 – Convert the exponent to binary = 0101 Step 10 – Put the mantissa & exponent together for the final answer = 1.010000100000000 0101
23
Floating Point Method Exercises Complete the following exercises using the floating point method with 16 bits twos complement for the mantissa and 4 bits twos complement for the exponent. Work in pairs, convert: 1.-37.25 2.-15.75 3.-21.125
24
Floating Point Method Answers 1.- 37.25 = 100101.01 = 011010.11 = 1 011010110000000 exponent = 6 = 0110 = 1 011010110000000 0110 2.- 15.75 = 1111.11 = 0000.01 = 1 000001000000000 = exponent = 4 = 0100 1 000001000000000 0100 3.- 21.125 = 10101.001 = 01010.111 = 1 010101110000000= exponent = 5 = 0101 1 010101110000000 0101
25
Converting from Floating Point Binary to Decimal/Denary Convert the following floating point binary number to its equivalent decimal/denary number. There are 16 bits for the Mantissa and 4 bits for the exponent. 0 000100000000000 0011
26
What happens if the Exponent is negative? If the exponent is negative then when converting the mantissa to denary / decimal the binary point will move left. E.g. convert 0 100000000000000 1110 (16 bit mantissa and 4 bit exponent) Exponent = 1110 – 2’s complement 0010 = -2 move decimal point left 2 places. 0.001000000000000 = 0.125
27
Stretch & Challenge Convert the following floating point binary numbers to denary / decimal numbers using a 16- bit mantissa in twos complement form and a 4 bit exponent in twos complement form. 1)0 100100000000000 0100 2)0 110000000000000 1100 (Exponent is negative which way does the decimal point move now?) 3)1 110000000000000 0011
28
Stretch & Challenge Answers 1)0 100100000000000 0100 = exp = 4 = 0 1001.00000000000 = 9.0 2) 0 110000000000000 1100 = exp = -4 = 0.0000 11000000000 = 0.046875 3) 1 110000000000000 0011 = exp = 3 = 1 110000000000000 = 0 010000000000000 = 0 010.000000000000 = -2.0
29
Plenary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.