A Level Computing. Contents. For the Exam:

Similar documents
COMP Overview of Tutorial #2


FLOATING POINT NUMBERS

Introduction to Computer Science-103. Midterm

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Numerical Representations On The Computer: Negative And Rational Numbers

Numerical Representations On The Computer: Negative And Rational Numbers

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

MACHINE LEVEL REPRESENTATION OF DATA

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

3.1 DATA REPRESENTATION (PART C)

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

Introduction to Computers and Programming. Numeric Values

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

COMP2611: Computer Organization. Data Representation

Chapter 3: Arithmetic for Computers

Module 2: Computer Arithmetic

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Chapter 2 Data Representations

Number System. Introduction. Decimal Numbers

Digital Fundamentals

Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers

Number Systems. Both numbers are positive

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Inf2C - Computer Systems Lecture 2 Data Representation

Data Representation and Architecture Modeling Year 1 Exam preparation

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS & IT Conversions. Magnitude 10,000 1,

CS101 Lecture 04: Binary Arithmetic

Digital Fundamentals

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

BINARY SYSTEM. Binary system is used in digital systems because it is:

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Chapter 1 Review of Number Systems

Chapter 4. Operations on Data

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Data Representations & Arithmetic Operations

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Computational Methods CMSC/AMSC/MAPL 460. Representing numbers in floating point and associated issues. Ramani Duraiswami, Dept. of Computer Science

CHAPTER 5: Representing Numerical Data

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Representing numbers on the computer. Computer memory/processors consist of items that exist in one of two possible states (binary states).

Number representations

LAB WORK NO. 2 THE INTERNAL DATA REPRESENTATION

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

unused unused unused unused unused unused

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

Divide: Paper & Pencil

Chapter 2. Data Representation in Computer Systems

CS 101: Computer Programming and Utilization

Signed umbers. Sign/Magnitude otation

Chapter 1. Digital Systems and Binary Numbers

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

CHW 261: Logic Design

UNIT 7A Data Representation: Numbers and Text. Digital Data

Numeral system Numerals

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

Signed Multiplication Multiply the positives Negate result if signs of operand are different

Data Representation in Computer Memory

OCR H446 A-Level Computer Science

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Computer (Literacy) Skills. Number representations and memory. Lubomír Bulej KDSS MFF UK

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Binary Codes. Dr. Mudathir A. Fagiri

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Computer Systems C S Cynthia Lee

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Chapter Three. Arithmetic

MATH 353 Engineering mathematics III

CHAPTER 2 (b) : AND CODES

CHAPTER 2 Data Representation in Computer Systems

Floating Point Numbers. Lecture 9 CAP

Time: 8:30-10:00 pm (Arrive at 8:15 pm) Location What to bring:

Number Systems Base r

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

that system. weighted value associated with it. numbers. a number. the absence of a signal. MECH 1500 Quiz 2 Review Name: Class: Date:

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Organisasi Sistem Komputer

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

Signed Binary Numbers

World Inside a Computer is Binary

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Adding Binary Integers. Part 5. Adding Base 10 Numbers. Adding 2's Complement. Adding Binary Example = 10. Arithmetic Logic Unit

Final Labs and Tutors

CS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader

Floating Point Arithmetic

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Introduction to Scientific Computing Lecture 1

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

What we need to know about error: Class Outline. Computational Methods CMSC/AMSC/MAPL 460. Errors in data and computation

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CHAPTER 2 Data Representation in Computer Systems

Transcription:

A Level Computing Contents For the Exam:... 1 Revision of Binary... 2 Computing Mathematics Revision... 2 Binary Addition/Subtraction revision... 3 BCD... 3 Sign and Magnitude... 4 2 s Compliment... 4 Floating Point Representation... 5 For the Exam: Demonstrate an understanding of floating point representation and of a real binary number Terms should include a mantissa and exponent, Binary numbers may be in sign and magnitude or two s compliment notation Normalise a real or binary number o Include the reason for normalisation o Be able to normalise positive or negative numbers Discuss the trade-off between accuracy and range when representing numbers o Relate to mantissa and exponent

Revision of Binary How do you convert from Denary to binary, describe the steps Convert the following numbers into their proper number bases. Hexadecimal Binary Octal Denary A 1010 2F 101111 4C 1001100 11011 27 10001100 140 99 3F 077 AB 470 312 Computing Mathematics Revision What are the outcomes of adding the following numbers together in Binary Numbers Outcome 1+0 0+1 1+1 0+0 What are the steps to successfully add two numbers together in Binary?

Binary Addition/Subtraction revision Show the results of adding and subtracting the following numbers, Show your working Numbers Addition Subtraction 24 12 45 9 78 54 43 16 BCD What does BCD stand for? How is it used? Work out the BCD Representations for the following numbers: 1010 101111 1001100 11011 10001100 27 140 99

Sign and Magnitude Sign and Magnitude How is it used? What are the disadvantages of sign and magnitude? Work out the sign and magnitude for the following numbers -27 140-99 46 2 s Compliment What is 2 s Compliment? How is it used? Work out the 2 s Compliment for the following numbers -27 140-99 46

Fixed Point Binary So at the moment we ve only dealt with whole numbers, now, this can become pretty easy after a while, so what about fixed point? Fixed point in binary is still has the point as in decimal, but now we have 1 s and 0 s to deal with: 1010.1010 The stuff before the decimal point is easy, it s 10, but what about the numbering system after the decimal point? Note down below the numbering system after the decimal point 1 0 1 0 Examples Work out the following in fixed point representations: Number Representation 1101.1101 3.0625 9.6875 1110.0111 Floating Point Representation Before this point we have dealt with whole numbers, Positive and negative, yes, but floating point, no. This can be a problem as if we are ever doing a computer program which handles money, at some point you are going to have to write some code that deals with the dreaded 99p! Conversion of Floating Point Numbers Floating point representation needs to use the 2 s compliment notation, meaning that the furthermost digit represents positive/negative numbers, How is data represented in Floating Point 10010 0010 Mantissa Exponent

What is the mantissa? What is the exponent? Explain the steps in order to convert the above number into a denary number Exercises: A number is represented as an 8 bit floating point number. 5 Bits are used as the mantissa, 3 bits are used as the exponent. Both the mantissa and the exponent are in twos compliment notation. 0.1100010 1.0010010 Floating point range Depending on the computer depends on the limitations of floating point. A 32 Bit computer can represent how many bytes in Floating point? As with all computing it is a line of best fit. You can t make every number in the known floating point universe, why? What would happen if I had a 64 bit computer? Overflow and Underflow What is Overflow? What is Underflow? What can we do about the overflow and underflow? Normalisation of Binary Numbers Floating Point Binary Normalisation The precision of a floating point number depends on the number of digits stored in the mantissa but also on how these digits are used: 0.0035 x 10 8 = 350,000 0.3457 x 10 6 = 345,700 is more precise

In binary: 0 000110101 000110 becomes 0 110101000 000011 +.000110101 exp=6 becomes +.110101000 exp=3 Normalisation is the process of moving the binary point so that the first digit after the point is a significant digit. This maximises precision in a given number of bits. To maximise the precision of a positive number you should have a mantissa with no leading zeros. To maximise the precision of a negative number you should have a mantissa with no leading ones. This means that the first two digits will always be different in a normalised floating point binary number. You try: 1. Normalise the following positive numbers (10-bit mantissa and a 6-bit exponent) : (a) 0 000000110 000111 (b) 0 000010111 000110 2. Normalise the following negative numbers (10-bit mantissa and a 6-bit exponent) : (a) 1 111110111 000000 (b) 1 111111010 000011 Floating Point Binary Practice questions Typical exam question: 1. What is the decimal value for the following binary patterns if the first 8 bits is the mantissa and the last 4 bits are the exponent: 1000 1100 0100 How to do these questions! 1000 1100 0100 Separate out the exponent from the mantissa mantissa exponent Originally this number is given in two s complement Normalised Form (most accurate representation possible for a given size of mantissa)

1000 1100 0100 +4 Work out the exponent and write it down (you may get a mark for this part!). NB: first bit of exponent (like mantissa) is the sign bit. In normalise form the binary point always goes after the first significant digit of the mantissa. This number represents 1.00011 x 2 4 1000 1100 0100 0111 0011 (complement) 1+ (add 1) 0111 0100 If the mantissa is negative then work out the complement (swap 1 s and 0 s) and add 1 0.1110100 becomes 01110.100 +4 Move the binary point to its new position. Right for positive exponent, left for negative exponent. Normalised form always starts with 2 bits that are different e.g. 01 or 10. 1110.1 = -14.5 Work out the number in decimal. Remember add the minus sign back in at the end! Now you try! 1. 0101 1001 0110 4. 0100 0000 1111 2. 1000 1100 0100 5. 1011 0110 0101 3. 0110 1110 0100 6. 0110 1101 0101