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.

Slides:



Advertisements
Similar presentations
Boolean Algebra. Starter Task State 5 basic data types together with one operation that can be performed on each. We have looked at 4 in the past few.
Advertisements

DATA REPRESENTATION Y. Colette Lemard February
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer?
Chapter 1.7 Storing Fractions. Excess Notation, continued… In this notation, "m" indicates the total number of bits. For us (working with 8 bits), it.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
Lecture 3 Number Representation 2 This week – Recap Addition – Addition circuitry – Subtraction of integers in binary – Representing numbers with fractional.
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
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…
Binary Number Systems.
Binary Representation and Computer Arithmetic
The Binary Number System
Fixed point binary numbers. Objectives  Draw a distinction between integers and numbers with a fractional part in a computer context.  Describe how.
Scientific Notation.
Data Representation – Binary Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity,
The Teacher CP4 Binary and all that… CP4 Revision.
PYTHON PROGRAMING Week 15 – Tuesday.
CSC 221 Computer Organization and Assembly Language
Algebra Standard 1.0 Recognize and Use Scientific Notation.
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
The Teacher CP4 Binary and all that… CP4 Revision.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
Number Systems Revision of conversations What is a register Addition Complementation.
Fractions in Binary.
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
Data Representation The storage of Text Numbers Graphics.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Extending Binary In today’s lesson we will look at: representing different types of numbers possible errors binary coded decimal (BCD) comparing BCD with.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Computers and Numbers. Types of Numbers Computers store two different types of numbers: Whole Numbers AKA Integers (mathematics) AKA Fixed Point Numbers.
Scientific Notation. Pages of notebook Essential question: How do I write small and large numbers using scientific notation? Objective: I can write.
Floating Point Binary A2 Computing OCR Module 2509.
IT11004: Data Representation and Organization Floating Point Representation.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
1  For recitations  Amr Mahmoud  Office Hours: Monday Benedum Hall.
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.
Two’s Complement The language of machines, part II.
Starter Using the mini whiteboards record your answers: 1) Name 2 different Character Sets 2) Convert the Hex number 9E into denary 3) Convert the binary.
Software Design and Development Storing Data Computing Science.
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
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
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
Introduction To Number Systems
Introduction To Computer Science
Recap Add these numbers together in binary
Binary numbers: Week 7 Lesson 1
Storing Negative Integers
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.
Numbers representations
Binary  Name: Class: .
Representation of real numbers
IT11004: Data Representation and Organization
Presentation transcript:

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