1 The Mathematics Driving License for Computer Science- CS10410 Approximating Numbers, Number Systems and 2 s Complement by Nitin Naik
2 Approximating Numbers There are two kinds of numbers: Exact Number and Approximate Number. Exact Numbers arise from counting. Approximate Numbers arise from measurement or calculation. We can never perform a completely accurate measurement with a ruler, tape measure or thermometer. There is always some inaccuracy involved.
3 Approximating Numbers.. Sometimes instead of giving exact numbers, it is preferable to give approximations. This is especially when if we want to be vague about the numbers we are reporting! Certain numbers simply cannot be written exactly in decimal form. Many fractions and all irrational numbers fall into this category. For example the fraction 1/3 is approximately but not exactly equal to and the irrational number 3 is approximately but not exactly equal to 1.73.
5 Significant Digits or Figures All the digits in the number are significant digits (also known as significant figures) except if the digit is a zero that is used just to locate the decimal point then it is not significant. This means a digit which is 0 is significant if it is not a place holder. In an approximate number the leftmost digit is said to be the Most Significant Digit and the rightmost digit is the Least Significant Digit. Significant digits give an indication of the accuracy of a number.
6 Significant Digits or Figures.. Example-1: The approximate number is It has 4 significant digits. The digit 5 is the Most Significant Digit (MSD). The digit 9 is the Least Significant Digit (LSD).
7 Significant Digits or Figures..
8 Accuracy and Precision Accuracy The accuracy of an approximate number is given by the number of significant digits in it. Precision The precision of an approximate number is given by the position of the rightmost significant digit (decimal position of the last significant digit).
9 Example Comparing the two numbers and Accuracy Here is more accurate because it has four significant digits, where only has two. Precision The two numbers have the same precision, as the last significant digit is in the thousandths position for both.
10 Rounding Numbers When rounding number to a certain place value then all digits to the right of that place are dropped.
11 Rounding Down If the first dropped digit in number is 0, 1, 2, 3, or 4 then the least significant digit kept is not changed. This is called rounding down.
12 Rounding Up If the first dropped digit in number is 5, 6, 7, 8 or 9 then the least significant digit kept is increased by 1. This is called rounding up.
13 Rounding Examples Example-1: The number rounded to four significant digits is The number rounded to three significant digits is 70.5 The number rounded to two significant digits is 71
14 Rounding Examples.. Example-2:Some examples of rounding to 2 decimal places (the dropped digits are shown in red):
15 Rounding Examples.. Example-3:Some examples of rounding to 3 significant figures (the dropped digits are shown in red):
16 Operations with Approximate Numbers When adding or subtracting approximate numbers, the result should have the precision of the least precise number. Example-1: When adding 2.3, and 12.67, our final answer should be correct to one decimal place = (the symbol for "is approximately equal to")
17 Operations with Approximate Numbers.. When multiplying or dividing approximate numbers, the result should have the accuracy of the least accurate number. Example-2: When multiplying and 2.37, our final answer should have three significant digits =
18 Operations with Approximate Numbers.. When finding the square root of a number, the result has the same accuracy as the number. Example-3: should be written correct to 4 significant digits: (same accuracy)
19 Number System It is the set of characters and mathematical rules that are used to represent a number.
20 Decimal Number System The Decimal number system consists of ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 and afterwards the numbers are formed by grouping these digits together and known as Base-10 system.
21 Decimal Number System..
22 Binary Number System The Binary number system is similar to the decimal system except binary system contains only two digits- 0 and 1 and called Base-2 system.
23 Octal Number System The Octal number system consists of eight digits 0, 1, 2, 3, 4, 5, 6, and 7 and called Base-8 system. Octal was used extensively in early mainframe computer systems, but has become less popular in favor of binary and hexadecimal today.
24 Hexadecimal Number System The Hexadecimal number system uses 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F and thus called Base-16 system. Hexadecimal numbers are easy to convert to the computer's internal binary code and are more compact than binary numbers.
25 Hexadecimal Number System.. Decimal Values of Hex Alphabets
26 Number System Conversions Actually we commonly understand only Decimal number system so the number written in other three number systems must be converted to know the actual decimal value of that number. Number system conversions are also required for many computer applications and operations. Here we will study the most important number system conversions.
31 Octal to Decimal Conversion For this conversion remember these values:
32 Octal to Decimal Conversion..
33 Hexadecimal to Decimal Conversion For this conversion remember these values:
34 Hexadecimal to Decimal Conversion..
35 Binary-to-Octal or Octal-to-Binary Three binary digits are equivalent to one octal digit, as shown in the table below:
36 Binary-to-Octal To convert from binary to octal, divide the binary number into groups of 3 digits starting on the right of the binary number. If the leftmost group has less than 3 bits, put in the necessary number of leading zeroes on the left. For each group of three bits, write the corresponding single octal digit.
39 Octal-to-Binary To convert from octal to binary, write the corresponding group of three binary digits for each octal digit.
41 Binary-to-Hexadecimal or Hexadecimal-to-Binary Four binary digits are equivalent to one hexadecimal digit, as shown in the given table.
42 Binary-to-Hexadecimal To convert from binary to hexadecimal, divide the binary number into groups of 4 digits starting on the right of the binary number. If the leftmost group has less than 4 bits, put in the necessary number of leading zeroes on the left. For each group of four bits, write the corresponding single hex digit.
45 Hexadecimal-to-Binary To convert from hexadecimal to binary, write the corresponding group of four binary digits for each hex digit.
47 Two's Complement Notation Property Two's complement number representation is used for signed numbers on most modern computers. Two's complement representation allows the use of binary arithmetic operations on signed integers, yielding the correct 2's complement results.
48 Two's Complement Notation.. Positive Numbers Positive 2's complement numbers are represented as the simple binary. Negative Numbers Negative 2's complement numbers are represented as the binary number that when added to a positive number of the same magnitude equals zero. Sign Bit The most significant bit is called the sign bit. Operations This notation allows a computer to add and subtract numbers using the same operations (thus we do not need to implement adders and subtractors).
49 One's Complement In one's complement, positive numbers are represented as usual in regular binary. However, negative numbers are represented differently. To negate a number, replace all zeros with ones, and ones with zeros - flip the bits. Example: 12 = and -12 = (1 s Complement) As in signed magnitude, the leftmost bit indicates the sign (1 is negative, 0 is positive). To compute the value of a negative number, flip the bits and translate as before.
50 Two's Complement Example: 12 = (1 s Complement) = (2 s Complement)
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
Lecture 11: Number Systems Numeric Data Fixed point Integers (12, 345, 20567 etc) Real fractions (23.45, 23., 0.145 etc.) Floating point such as 23. 45 e 12 Basically an exponent representation Any number
Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two
ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also
Binary Numbers Bob Brown Information Technology Department Southern Polytechnic State University Positional Number Systems The idea of number is a mathematical abstraction. To use numbers, we must represent
2 Number Systems 2.1 Foundations of Computer Science Cengage Learning 2.2 Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish between
Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data
Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems
Section.4 Place Value Systems of Numeration in Other Bases Other Bases The Hindu-Arabic system that is used in most of the world today is a positional value system with a base of ten. The simplest reason
Binary Numbers Binary Octal Hexadecimal Binary Numbers COUNTING SYSTEMS UNLIMITED... Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how
Signed Binary Arithmetic In the real world of mathematics, computers must represent both positive and negative binary numbers. For example, even when dealing with positive arguments, mathematical operations
CSI 333 Lecture 1 Number Systems 1 1 / 23 Basics of Number Systems Ref: Appendix C of Deitel & Deitel. Weighted Positional Notation: 192 = 2 10 0 + 9 10 1 + 1 10 2 General: Digit sequence : d n 1 d n 2...
2 Number Systems 2.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish
Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must tbe able to handle more than just values for real world problems
LSN 2 Number Systems Department of Engineering Technology LSN 2 Decimal Number System Decimal number system has 10 digits (0-9) Base 10 weighting system... 10 5 10 4 10 3 10 2 10 1 10 0. 10-1 10-2 10-3
Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order
NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html
Number Systems I CIS008-2 Logic and Foundations of Mathematics David Goodwin email@example.com 11:00, Tuesday 18 th October 2011 Outline 1 Number systems Numbers Natural numbers Integers Rational
CPEN 4 - Digital Logic Design Binary Systems C. Gerousis Digital Design 3 rd Ed., Mano Prentice Hall Digital vs. Analog An analog system has continuous range of values A mercury thermometer Vinyl records
CS101 Lecture 11: Number Systems and Binary Numbers Aaron Stevens 14 February 2011 1 2 1 3!!! MATH WARNING!!! TODAY S LECTURE CONTAINS TRACE AMOUNTS OF ARITHMETIC AND ALGEBRA PLEASE BE ADVISED THAT CALCULTORS
Chapter 1: Digital Systems and Binary Numbers Digital age and information age Digital computers general purposes many scientific, industrial and commercial applications Digital systems telephone switching
Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations
EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook
CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering
NUMBER SYSTEMS 1.1 Introduction There are several number systems which we normally use, such as decimal, binary, octal, hexadecimal, etc. Amongst them we are most familiar with the decimal number system.
Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through
REVIEW OF NUMBER SYSTEMS Notes Unit 2 BINARY NUMBER SYSTEM In the decimal system, a decimal digit can take values from to 9. For the binary system, the counterpart of the decimal digit is the binary digit,
Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Digital Logic II May, I before starting the today s lecture
CHAPTER 3 Numbers and Numeral Systems Numbers play an important role in almost all areas of mathematics, not least in calculus. Virtually all calculus books contain a thorough description of the natural,
Binary math This worksheet and all related files are licensed under the Creative Commons Attribution License, version 1.0. To view a copy of this license, visit http://creativecommons.org/licenses/by/1.0/,
Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data
Page 1 of 5 Unsigned Conversions from Decimal or to Decimal and other Number Systems In all digital design, analysis, troubleshooting, and repair you will be working with binary numbers (or base 2). It
Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents
G InThisAppendix... Introduction Binary Numbering System Hexadecimal Numbering System Octal Numbering System Binary Coded Decimal (BCD) Numbering System Real (Floating Point) Numbering System BCD/Binary/Decimal/Hex/Octal
Divide: Paper & Pencil Computer Architecture ALU Design : Division and Floating Point 1001 Quotient Divisor 1000 1001010 Dividend 1000 10 101 1010 1000 10 (or Modulo result) See how big a number can be
A Short Guide to Significant Figures Quick Reference Section Here are the basic rules for significant figures - read the full text of this guide to gain a complete understanding of what these rules really
1.2 Rational Numbers Now that we have a handle on the integers, we will turn our attention to other types of numbers. We start with the following definitions. Definition: Rational Number- any number that
, Storage, and Retrieval ULM/HHIM Summer Program Project 3, Day 3, Part 3 Digital computers convert the data they process into a digital value. Text Audio Images/Graphics Video Digitizing 00000000... 6/8/20
4 Operations On Data 4.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, students should be able to: List the three categories of operations performed on
Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal)
SIGNIFICANT FIGURES, EXPONENTS, AND SCIENTIFIC NOTATION 2004, 1990 by David A. Katz. All rights reserved. Permission for classroom use as long as the original copyright is included. 1. SIGNIFICANT FIGURES
CS3 Introduction to Numerical Methods Lecture Number Representations and Errors Professor Jun Zhang Department of Computer Science University of Kentucky Lexington, KY 40506-0633 August 7, 05 Number in
Binary Numbers The Computer Number System Number systems are simply ways to count things. Ours is the base-0 or radix-0 system. Note that there is no symbol for 0 or for the base of any system. We count,2,3,4,5,6,7,8,9,
23CH_PHCalter_TMSETE_949118 23/2/2007 1:37 PM Page 1 Binary, Hexadecimal, Octal, and BCD Numbers OBJECTIVES When you have completed this chapter, you should be able to: Convert between binary and decimal
198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book 1 Computer Architecture What do computers do? Manipulate stored
Subnetting Examples There are three types of subnetting examples I will show in this document: 1) Subnetting when given a required number of networks 2) Subnetting when given a required number of clients
CS201: Architecture and Assembly Language Lecture Three Brendan Burns CS201: Lecture Three p.1/27 Arithmetic for computers Previously we saw how we could represent unsigned numbers in binary and how binary
Worksheet.4 Fractions and Decimals Section Fractions to decimals The most common method of converting fractions to decimals is to use a calculator. A fraction represents a division so is another way of
APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated
ECE 0142 Computer Organization Lecture 3 Floating Point Representations 1 Floating-point arithmetic We often incur floating-point programming. Floating point greatly simplifies working with large (e.g.,
Lecture 2: Number Representation CSE 30: Computer Organization and Systems Programming Summer Session II 2011 Dr. Ali Irturk Dept. of Computer Science and Engineering University of California, San Diego
Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about
Exercises 1 - number representations Questions 1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal: (a) 3012 (b) - 435 2. For each of
2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal
CHAPTER 5 Round-off errors In the two previous chapters we have seen how numbers can be represented in the binary numeral system and how this is the basis for representing numbers in computers. Since any
3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how
Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger
Decimal to Binary Conversion A tool that makes the conversion of decimal values to binary values simple is the following table. The first row is created by counting right to left from one to eight, for
MATHEMATCS Subject Area: Component V: MATHEMATCS WHOLE NUMBER SENSE ndiana Academic Standard 1: Number Sense and Computation Understanding the number system is the basis of mathematics. Students develop
Chapter The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base-0 system. When you
Math Section 5. Dividing Decimals 5. Dividing Decimals Review from Section.: Quotients, Dividends, and Divisors. In the expression,, the number is called the dividend, is called the divisor, and is called
Chapter 3 Data Storage Objectives After studying this chapter, students should be able to: List five different data types used in a computer. Describe how integers are stored in a computer. Describe how
1.3 Order of Operations As it turns out, there are more than just 4 basic operations. There are five. The fifth basic operation is that of repeated multiplication. We call these exponents. There is a bit
Introduction Borland C++ Compiler: Operators An operator is a symbol that specifies which operation to perform in a statement or expression. An operand is one of the inputs of an operator. For example,
Introduction to Fractions Fractions represent parts of a whole. The top part of a fraction is called the numerator, while the bottom part of a fraction is called the denominator. The denominator states
.3 IPv4 Address Subnetting Part Objective Upon completion of this activity, you will be able to determine subnet information for a given IP address and subnetwork mask. When given an IP address, network
Chapter 6 Digital Arithmetic: Operations & Circuits Chapter 6 Objectives Selected areas covered in this chapter: Binary addition, subtraction, multiplication, division. Differences between binary addition
T92 Mathematics Success Grade 8 [OBJECTIVE] The student will create rational approximations of irrational numbers in order to compare and order them on a number line. [PREREQUISITE SKILLS] rational numbers,
TI-83 Plus Graphing Calculator Keystroke Guide In your textbook you will notice that on some pages a key-shaped icon appears next to a brief description of a feature on your graphing calculator. In this
Chapter 1. Binary, octal and hexadecimal numbers This material is covered in the books: Nelson Magor Cooke et al, Basic mathematics for electronics (7th edition), Glencoe, Lake Forest, Ill., 1992. [Hamilton
CHAPTER TWO Numbering Systems Chapter one discussed how computers remember numbers using transistors, tiny devices that act like switches with only two positions, on or off. A single transistor, therefore,
This Unit: Floating Point Arithmetic CIS 371 Computer Organization and Design Unit 7: Floating Point App App App System software Mem CPU I/O Formats Precision and range IEEE 754 standard Operations Addition
A towards an Easy Interconversion of Various Number Systems Shahid Latif, Rahat Ullah, Hamid Jan Department of Computer Science and Information Technology Sarhad University of Science and Information Technology
NUMBER SYSTEMS TUTORIAL Courtesy of: thevbprogrammer.com Number Systems Concepts The study of number systems is useful to the student of computing due to the fact that number systems other than the familiar