Binary Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm Harder.

Slides:



Advertisements
Similar presentations
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Advertisements

Scientific Notation.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Laplace Transform Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2008 by Douglas Wilhelm Harder.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
EMB1006 The Binary System There is no 2 Jonathan-Lee Jones.
Topics in Applied Mathematics Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Floating Point Numbers
Signed Numbers.
Chapter 1.5 The Binary System CSCI 3. Basic Concepts Behind the Binary System In the decimal system, things are organized into columns – H | T | O – 1.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Binary Representation and Computer Arithmetic
Binary and Hexadecimal Numbers
The Binary Number System
Data Representation Number Systems.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Positional Number Systems
§ 4.3 Scientific Notation. Angel, Elementary Algebra, 7ed 2 Scientific Notation A number written in scientific notation is written as a number greater.
Fixed-Point Iteration Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm.
Chapter 2.2 Scientific Notation. Expresses numbers in two parts: A number between 1 and 10 Ten raised to a power Examples: 2.32 x x
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
Welcome to ECE 204 Numerical Methods for Computer Engineers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo.
Scientific Notation Copyright Scott Storla Scientific Notation A number written in scientific notation has two factors. One factor is a real number.
Proof by Induction.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
1. Scientific Notation Every positive number X can be written as:
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
CSC 221 Computer Organization and Assembly Language
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Introduction to Numerical Analysis I MATH/CMPSC 455 Binary Numbers.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Problems with Floating-Point Representations Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright.
Decimal Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm Harder.
Significant Figure Rules RulesExamples The following are always significant Non zero digits Zeros between non zero digits Zero to the right of a non zero.
Double-Precision Floating-Point Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007.
Scientific Notation AP Chemistry August 11 th, 2015.
Scientific notation. What is scientific notation?  Numbers are written in the form M × 10 ^n, Where the factor M is a number greater than or equal to.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
1 The tree data structure Outline In this topic, we will cover: –Definition of a tree data structure and its components –Concepts of: Root, internal, and.
SCIENTIFIC NOTATION RULES. Rules for converting to Scientific Notation One non-zero number before the decimal One digit after the decimal If you are making.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Chapter P Prerequisites: Fundamental Concepts of Algebra Copyright © 2014, 2010, 2007 Pearson Education, Inc. 1 P.2 Exponents and Scientific Notation.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
1 Complete binary trees Outline Introducing complete binary trees –Background –Definitions –Examples –Logarithmic height –Array storage.
Binary Fractions.
Open Addressing: Quadratic Probing
Scientific Notation.
Outline Introducing perfect binary trees Definitions and examples
COMPUTING FUNDAMENTALS
Rational Numbers SWBAT define the set of rational numbers; identify subsets of rational numbers; write rational numbers in equivalent forms.
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Applying Exponent Rules: Scientific Notation
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.
Scientific Notation.
Converting from Base-n to Base-10
Presentation transcript:

Binary Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm Harder. All rights reserved. ECE 204 Numerical Methods for Computer Engineers

Binary Numbers This topic introduces binary numbers –standard notation –scientific notation –addition –multiplication

Binary Numbers Decimal numbers are convenient for humans because we have 10 fingers (also called “digits”) Otherwise, they are exceptionally useless as 10 has only two divisors: 2 and 5 Even our day is more conveniently broken up into base 12 which has four divisors: 2, 3, 4, and 6

Binary Numbers Representing ten digits is exceptionally inconvenient for computers It is easiest to represent just two digits with closed and open circuits ( 5 V and 0 V ) We use 0 and 1 to represent these two binary digits, or bits

Binary Numbers We represent a binary integer as a sequence of bits b n b n – 1 · · · b 1 b 0 which equals

Binary Numbers For example, represents 1· · · · · ·2 0 = = 42 As another example, represents 1· · · · · · ·2 0 = = 113

Binary Numbers In counting, we always increment the next digit whenever we increment a “1”:

Binary Numbers We use these numbers to represent the integers in the natural order:

Binary Numbers Binary numbers are very convenient for computers, but very inconvenient for humans –for example, how much smaller is than ? –these are 50 and 500, respectively

Binary Numbers Just like decimal real numbers, we can represent a real number as a sequence of bits: b n b n – 1 · · · b 1 b 0. b –1 b –2 b –3 · · · where b n  0 (i.e., b n = 1 ), and n is any integer This represents the number

Binary Numbers We cannot call the point in b n b n – 1 · · · b 1 b 0. b –1 b –2 b –3 · · · a “decimal point”, as this is not a decimal number The generic name for the point is the radix point

Binary Numbers As with decimal digits, we are only concerned with a finite number of bits: b n b n – 1 · · · b 0. b –1 · · · b m where b n = 1, n is any integer and m  n This represents the number

Binary Numbers For example,  represents 1· · · ·2 –1 + 0·2 –2 + 1·2 –3 = = As another example,  represents 1· ·2 –1 + 1·2 –2 + 1·2 –3 + 0·2 –4 + 1·2 –5 = =

Binary Numbers Notice that is differ only by shifting the radix point by two locations This is equivalent to multiply by 2 –2 or dividing by 4 We also see that 

Binary Numbers As with decimal numbers, we can represent binary numbers using scientific notation: Any real number can be written as 1.b -1 b -2 b -3 · · · b –m  2 n which often written as 1.b -1 b -2 b -3 ···b –m en

Binary Numbers To differentiate between binary numbers and decimal numbers it is common to add a subscript 2 or subscript 10: = = = = Note that 42/64 =

Binary Numbers To add two binary numbers: –line up the radix points, add the columns, carrying 1 to next column if the sum is greater than 1 : –for example, add =  2 3 and =  2 0 yielding  2 3 =

Binary Numbers Multiplication of numbers in scientific notation is similar, multiply the mantissa and add the exponents –for example, multiply =  2 5 and =  2 –1 yielding  2 4 =  2 5

Binary Numbers We can verify this by converting to decimal numbers: = = where 44  = and  2 5 = = = 35.75

Binary Numbers Thus, we have seen that the mechanics of binary numbers are identical to the mechanics of decimal numbers

Usage Notes These slides are made publicly available on the web for anyone to use If you choose to use them, or a part thereof, for a course at another institution, I ask only three things: –that you inform me that you are using the slides, –that you acknowledge my work, and –that you alert me of any mistakes which I made or changes which you make, and allow me the option of incorporating such changes (with an acknowledgment) in my set of slides Sincerely, Douglas Wilhelm Harder, MMath