Starter Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard Using two’s Complement form convert the following from Binary to Denary. Answer on mini whiteboard What is the decimal value of the following fractions. Answer on mini whiteboard. 1. ½ 2. ¼ 3. 1/8 4. 1/16
Starter - Answers Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard Using two’s Complement form convert the following from Binary to Denary. Answer on mini whiteboard ½ = 0.5, ¼ = /8 = /16 =
Representing Real Numbers (Numbers with decimal points) in Binary (Textbook Page )
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)
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.
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 Sign Decimal Point
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. Sign = 6.75
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 Denary ’s complement What is the largest denary number that can be represented?
Fixed Point Method Exercises Answers using the rule convert the 2’s complement back to positive = Then convert to denary and don’t forget the MINUS sign = =
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.
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.
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 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.
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
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
Convert Positive Denary to Floating Point Binary Convert to floating point using a 16 bit mantissa and 4 bit exponent. Step 1 – Convert the whole number part to binary = 23 = Step 2 – Convert the decimal number part to binary = 0.75 = 0.11
Floating Point Binary Method Convert Denary to Floating Point Binary Step 3 – Put the two parts together = Step 4 – Add a sign bit = Step 5 – Add x number of zeros to the end to fill up the mantissa (16 bits) = Step 6 – Move the decimal point to the LEFT after the MSB =
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 =
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:
Floating Point Method Answers = = = exponent = 6 = 0110 = = = = exponent = 4 = = = = exponent = 5 = = = = exponent = 3 = = = = exponent = 5 =
Convert Negative Denary to Floating Point Binary Convert 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 = Step 2 – Convert the decimal number part to binary = 0.75 = 0.11
Floating Point Binary Method Convert Denary to Floating Point Binary Step 3 – Put the two parts together = Step 4 – Uses twos complement to convert mantissa = Step 5 – Add a sign bit = Step 6 – Add x number of zeros to the end to fill up the mantissa (16 bits) =
Floating Point Binary Method Convert Denary to Floating Point Binary Step 7 – Move the decimal point to the LEFT after the MSB = 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 =
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:
Floating Point Method Answers = = = exponent = 6 = 0110 = = = = = exponent = 4 = = = = = exponent = 5 =
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
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 (16 bit mantissa and 4 bit exponent) Exponent = 1110 – 2’s complement 0010 = -2 move decimal point left 2 places = 0.125
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) ) (Exponent is negative which way does the decimal point move now?) 3)
Stretch & Challenge Answers 1) = exp = 4 = = 9.0 2) = exp = -4 = = ) = exp = 3 = = = = -2.0
Plenary