Binary Conversions Number systems Binary to decimal Decimal to binary.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

The Binary Numbering Systems
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
CIS 020 Assembly Programming Chapter 02 - Numbering Systems & Data Representation © John Urrutia 2012, All Rights Reserved.5/27/20121.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Kavita Hatwal Fall The decimal system, also called the base 10 number system is based on ten numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. All the numbers.
Information Processing Session 5B Binary Arithmetic Slide
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Chapter 4.2 Binary numbers: Arithmetic
Data Representation in Computers
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
The Binary Number System
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Binary Numbers.
Chapter 1 1 Number Systems. 2 Objectives  Understand why computers use binary (Base-2) numbering.  Understand how to convert Base-2 numbers to Base-
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Binary and Hexadecimal Numbers
Data Representation Number Systems.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
NUMBER SYSTEMS.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Numbering systems.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
Numeral Systems Subjects: Numeral System Positional systems Decimal
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Computer System & Binary Review. Memory Model What memory is supposed to look like.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
BINARY 1. Number Systems Base 10 uses the numbers 0-9 Represents numbers as ones, tens, hundreds etc HundredsTensOnesSolution = =
Number systems, Operations, and Codes
The Hexadecimal Number System and Memory Addressing ISAT 121.
Binary Values and Number Systems
THE BINARY SYSTEM.
Data Representation, Number Systems and Base Conversions
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Computer Science Introduction to the Number Base Unit Adapted from Slides by John Owen Computer Science Instructor, Rockport-Fulton High School, Rockport,
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Unit 1 Review Order of Operations and Whole Numbers.
 Addition 6+4=10  Subtraction 36-10=26  Multiplication 5X6=30  Division 60÷10=6.
Computer Number System
Number Systems – Definitions page 214 The radix or base 밑 refers to the number b in an expression of the form b n. The number n is called the exponent.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Number Systems. ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:
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.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Chapter 1: Arithmetic & Prealgebra
Introduction To Number Systems
Binary 1 Basic conversions.
Discrete Mathematics Numbering System.
COMPUTING FUNDAMENTALS
Chapter 3 Data Representation
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Numbering System TODAY AND TOMORROW 11th Edition
Chapter Four Data Representation in Computers By Bezawit E.
Chapter 3 - Binary Numbering System
Presentation transcript:

Binary Conversions Number systems Binary to decimal Decimal to binary

Binary Humor There are 10 kinds of people in the world - those who understand binary and those who don't.

Numbering Systems Base 10 or decimal numbering system  Base-10 numbering systems dictate that the numbering scheme begins to repeat after the tenth digit (in our case, the number 9).  Zero is always the first number.  When we count, we usually count "00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12,...“

Numbering Systems Base 10 or decimal numbering system  Each digit to the left and right of the decimal point is given a name which identifies that digit's placeholder.  Each placeholder is a multiple of ten.  For now lets just consider positive numbers.

Numbering Systems - Base Ten Each placeholder is a base of ten. 10º = ones  Any number to the zero power is always equal to 1.  nº=1  10º=1 10¹ = tens  Any number to the first power is always equal itself.  n¹=n  10¹=10 10² = hundreds 10³ = thousands THOUSANDSTHOUSANDS HUNDREDSHUNDREDS TENSTENS ONESONES 7408

Numbering Systems – Base Ten Arithmetic expression of 8 in Work right to left of decimal point. The ones position in expanded notation calculating the exponent.  10º*8=8 is the same as 1*8=8

Numbering Systems – Base Ten Number7408 Position Name ThousandsHundredsTensOnes Exponential Expression 10³*710²*410¹*010º*8 Calculated Exponent 1000*7100*410*01*8 Sum of the powers of ten. 1000* *4 + 10*0 + 1*8 = 7408

Numbering Systems – Base two Binary system is based on multiples of two. In binary numbering the numbering scheme repeats after the second digit. Let's count to five in binary: “0000, 0001, 0010, 0011, 0100, 0101“ Binary numbering includes names for digit placeholders.

Numbering Systems – Base two Picture a odometer that is only capable of counting to two.

Numbering Systems – Base two Binary placeholders  Ones  Twos  Fours  Eights  Sixteen's  Thirty-twos  Sixty-fours Decimal placeholders  Ones  Tens  Hundreds  Thousands  Ten-thousands  Hundred-thousands  Millions

Numbering Systems – Base two If the binary system is based on powers of 2, why is there still a "ones" position? Remember: Anything to the zero power is always equal to 1. In binary, the "ones" position is represented by the exponential expression 2º.

Convert Binary to Decimal Sum of the powers of two. 8*1 + 4*1 + 2*0 + 1*1 = 13 Number1101 Position Name EightsFoursTwosOnes Exponential Expression 2³*12²*12¹*02º*1 Calculated Exponent 8*14*12*01*1

Convert Binary to Decimal Step 1 - Write the binary number in a row, separating the digits into columns. Number 1101

Convert Binary to Decimal Step 2 - I want to decide whether each digit placeholder is "ON" or "OFF.“ "1" is "ON" and a "0" is "OFF.“ We don't have to calculate any digit placeholders that are turned off. Number1101 ON/OFFOn OffON

Convert Binary to Decimal Step 3 - Write the exponential expressions ("powers of two") that represent each placeholder and multiply each expression by 1. We do this only for the placeholders that are turned ON. For the placeholders which are turned OFF, we simply bring down the zero from the number itself Number1101 ON/OFFOn OffON Exponential Expression 2³*12²*102º*1

Convert Binary to Decimal Step 4 - Calculate the exponents to get a simple multiplication expression for each placeholder. Number1101 ON/OFFOn OffON Exponential Expression 2³*12²*102º*1 Calculated Exponent 8*14*101*1

Convert Binary to Decimal Step 5 - Solve the multiplication expressions from step #4. Number1101 ON/OFFOn OffON Exponential Expression 2³*12²*102º*1 Calculated Exponent 8*14*101*1 Solved Multiplication 8401

Convert Binary to Decimal Step 6 - Add all the multiplication answers from step #5 together to get our decimal number Number1101 ON/OFFOn OffON Exponential Expression 2³*12²*102º*1 Calculated Exponent 8*14*101*1 Solved Multiplication 8401 Add to calculate Value =13

Convert Binary to Decimal Example Number ON/OFFOnOffOn OffOn Exponential Expression ³2³2²2²02º*1 Calculated Exponent 32*108*14*101*1 Solved Multiplication Add to calculate Value =45

Covert Decimal to Binary Step 1 - Take the decimal number and divide it by 2. Important: NEVER carry your divisions past the decimal point! Decimal Number=97 Division Expression QuotientRemainder 97/2481

Covert Decimal to Binary Step 2 - For each subsequent row, take the quotient from the previous row and divide it by two Decimal Number=97 Division ExpressionQuotientRemainder 97/ / / /260 6/230 3/211 1/201

Covert Decimal to Binary Step 3 – The remainder column only has ones or zeros. The last cell in the remainder column of the last row must be a "1". Read the 1s and 0s in the remainder column from the bottom to the top, we'll have our binary number!

Covert Decimal to Binary Decimal Number=97 Division Expression QuotientRemainderDirection 97/ / / /260 6/230 3/211 1/201 Binary Number= Read

Whiteboard Examples In Class Correction 37 DEQR 37/ /290 9/241 4/220 2/210 1/ *116*08*04*12*01* = 37 Read

The last cell in the remainder column of the last row must be a "1“ because we need to use whole numbers (nonnegative integers). 1 ÷ 2 = 0 because 1 can not be divided into, 1 is the remainder. 37 (Odd Number) DEQR 37/ /290 9/241 4/220 2/210 1/ (Even Number DEQR 36/ /290 9/241 4/220 2/210 1/201 Read

Hexadecimal Conversation and ASCII

Hexa + Decimal Base-16 number system It’s all Greek to me  “Sexa” = Latin = Six  “Decimal” = Latin = Ten  In 1963 IBM thought “Sexadecimal” was not politically correct  “Hexa” = Greek = Six  Since the western alphabet contains only ten digits, hexadecimal uses the letters A-F to represent the digits ten through fifteen.

Hexadecimal and Computing It is much easier to work with large numbers using hexadecimal values than decimal or binary.  One Hexadecimal digit = 4bits  Two hexadecimal digits = 8 bits  Eight bits=1 byte  This makes conversions between hexadecimal and binary very easy

Counting Hexadecimal Starting from zero, we count 00, 01, 02,03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F,10, 11, 12, 13, 14, 15, 16, 17 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, 24, 25,....

DecimalBinaryHexadecimal a b c d e f

Convert Hexadecimal to Decimal 11AA = *1256*116*108* = 4520

Convert Decimal to Hexadecimal 4520 DEQR 4520/16282(.5*16)=8 282/1617(.625*16)=10 10=A 17/161(.0625*16)=1 1/160(.0625*16)=1 11A8 Quotient must be a whole number. If decimal, multiply decimal portion by 16 for remainder. Remainder must be a whole number. Read

Convert Hexadecimal to Binary Convert each hexadecimal digit into its 4-bit binary equivalent. equivalent 1AB Hex1AB Bin

Convert Binary to Hexadecimal Converteach 4bit binary digit into its hexadecimal equivalent starting from the right. equivalent If there is an odd number of bits, add zeros to the left to make a complete 4bit digit Bin Hex1AB 1AB

Uses  Web pages  Networking MAC address  Programming C, C++, C#, Java, Assembly  Geeky T-shirts DEADB4C0FFEE

ASCII American Standard Code for Information Interchange Each character is 7bits + 1bit for parity = 1byte Represents English characters as numbers, with each letter assigned a number from 0 to 127 This makes it possible to transfer data from one computer to another. Used to store text files

Conversion Lab Section I: Converting from Decimal to Binary  1) 11  2) 27  3) 54  4) 113  5) 273 Section II: Converting from Binary to Decimal  6) 101  7) 1011  8)  9)  10)

Conversion Lab Section III: Convert Hexadecimal to Binary  11) 43B  12) DAB  13) 954  14) C0FFEE  15) B0A Section IV: Convert Binary to Hexadecimal  16)  17)  18)  19)  20)

Conversion Lab Section V: Convert Hexadecimal to Decimal  21) FF2  22) 45  23) 19D  24) 345  25) AA Section VI: Convert Decimal to Hexadecimal  26) 27  27) 85  28) 562  29) 4522  30) 5627