Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)

Slides:



Advertisements
Similar presentations
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Advertisements

DATA REPRESENTATION CONVERSION.
Decimal Addition What is going on? (carry) (subtract the base)
Number System Conversions Lecture L2.2 Section 2.3.
Decimals.
Computer Systems 1 Fundamentals of Computing
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic.
Chapter 16 Binary and Hexadecimal Numbers. §16.2 thru 16.3 – Addition and Subtraction of Binary Numbers Binary = Base 2 Addition and subtraction are similar.
Number Systems.
Numbering Systems CS208.
Add, Subtract, Multiply, and Divide Decimals
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
Chapter 2- Decimals.
Supplemental Chapter Number Bases
The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there.
1 Week 2: Binary, Octal and Hexadecimal Numbers READING: Chapter 2.
Number systems, Operations, and Codes
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Number Base Conversions
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Number Systems 0, 1 0, 1, 2,
Hexadecimal. Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15.
Octal to Decimal Hexadecimal DecimalOctal Binary.
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Chapter 2 Number Systems Consists of a set of symbols called digits and a set of relations such as +, -, x, /.
CS 160 Lecture 4 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
ECE 362 Microprocessor Systems and Interfacing ©5-1 Lecture 1 Hexadecimal Computation Outline n Decimal n Binary n Octal n Hexadecimal.
Division by 2 Any number that ends is 0, 2, 4, 6, or 8 is evenly divisible by 2.
Multiplying Decimals 6.NS.3 Fluently add, subtract, multiply and divide multi digit decimals using algorithms for each operation.
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.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
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.
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Scientific Notation. What is Scientific Notation? Scientific notation is a way of writing extremely large or small measurements. The number is written.
Chapter 01 Numbers. Chapter 02 Base 10 example Decimal Number Place Place (place - 1) ===============================
Conversions 1)Binary to Denary Method 1 Work out the position values of the binary bits and add those values together So above would be
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
Appendix F Number Systems binary 0, 1 0, 1, 2, 3, 4, 5, 6, 7
Introduction To Number Systems
Computer Maintenance Numbering Systems Trade & Industrial Education
Octal to Decimal Decimal Octal Binary Hexadecimal.
Hexadecimal Conversion
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Binary Positional Notation
Convert Decimal to Binary
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
CSE 102 Introduction to Computer Engineering
Convert Binary Number to Octal
Location in course textbook
Tools of Web Development 1: Module A: Numbering Systems
Data Storage Introduction to computer, 2nd semester, 2010/2011
Binary Quiz UIN: ____________________
Number Systems Base 2, 10, 16.
Digital Electronics and Microprocessors
Chapter 2 Number Systems.
Multiplying and Dividing in Scientific Notation
Chapter 2 Number Systems.
Hexadecimal.
Chapter 2 Number Systems.
COMS 161 Introduction to Computing
Binary, Hexadecimal, and Base 10.
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Adding and Subtracting Decimals
Chapter 2 Number Systems.
Presentation transcript:

Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)

Small numbers are easy to convert But it helps to have a system for converting larger numbers to avoid errors. 1210 = C16 510 -> 1012 11002 = 1210

Converting from base 10 (decimal) to base 2 (binary) DEMONSTRATE Converting from base 10 (decimal) to base 2 (binary) example number = 42 Write the powers of 2 in a row starting on the RIGHT side with a 1 Keep doubling (*2) until you get to something greater than your number (42) 64 32 16 8 4 2 1 This is too big 1 1 1 3. Write a 1 underneath if that place value is used, 0 if not. subtract to find out what is left. 42 -32 ---- 10 10 - 8 ---- 2 2 -2 ---- Watch Read your answer from left to right The number in binary is 101010

Converting from base 10 (decimal) to base 2 (binary) DO TOGETHER Converting from base 10 (decimal) to base 2 (binary) example number = 7053 write the powers of 2 in a row until you get to something > the number 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Too big 1 1 1 1 1 1 1 1 7053 -4096 ------- 2957 2957 -2048 ------- 909 909 - 512 ------- 397 397 -256 ------ 141 141 -128 ------- 13 13 - 8 ----- 5 5 -4 --- 1 1 -1 --- Do this together the number in binary is 1101110001101

STUDENT’S TURN Do this one 15010  binary 1 2 4 8 16 32 64 128 256 1 Too big 1 1 1 Click to see each digit that is needed. The answer is: 10010110

To convert binary to decimal the number in binary is 10111001101 Write the powers of 2 below each digit and only add the values with a 1 above them. 0 1 1 1 0 0 1 1 0 1 1024 512 256 128 64 32 16 8 4 2 1 Start at the right and double each number 1024 + 256+128+64 + 8 + 4 + 1 = 1,485 Watch

Your turn. Convert 1000100112 to decimal 1 0 0 0 1 0 0 1 1 256 128 64 32 16 8 4 2 1 256 + 16 + 2+1 = 275 …. And now, for more about number systems.

Part 2 Number Systems

Quick review What’s 41 in binary? 32 16 8 4 2 1 1 0 1 0 0 1 32 16 8 4 2 1 1 0 1 0 0 1 The answer is: 101001

Quick Review: binary to decimal 64 + 8 + 4 + 1 =77

An Introduction to Hexadecimal 16 digits Use letters when you run out of single digits 0 1 2 3 4 5 6 7 8 9 A B C D E F SO… 1110 = ?16 B16 1510 = ? F16 1610 = ? 1016

from base 10 to base 16 (decimal to hexadecimal) example number = 7053 write the powers of 16 in a row until you get to one > the number divide the number by each power of 16 and write the answer and save the remainder 65,536 4,096 256 16 1 Too high 7053/4096 = 1 R 2957 2957/256 = 11 R 141 141/16 = 8 R 13 13 ones the numbers in hex are: 1 2 3 4 5 6 7 8 9 A B C D E F (A=10…. F=15) So your number is 1 11 8 13 = 1B8D16 Watch

Do this one 96210  hexadecimal 3C216 This is 3*256 + C(10)*16 + 2

from hexadecimal (base 16) back to decimal Watch 1B8D16 Write the number across a row. Write the powers of 16 below it. Multiply. Then add the products. 1 B 8 D =(1X4096)+ (11*256)+ (8*16)+(13*1) = 4096 + 2816 + 128 + 13 = 7053 4096 256 16 1

Do this one A10E16  decimal 41230

Octal Base 8 Uses 8 different digits 0 1 2 3 4 5 6 7

from base 10 to base 8 (decimal to octal) example number = 7053 write the powers of 8 in a row until you get to one > the number divide the number by each power of 8 write the answer and save the remainder 32768 4096 512 64 8 1 too high 7053/4096 = 1 R 2957 2957/512 = 5 R 397 397/64 = 6 R 13 13/8 = 1 R 5 = 5 ones so your number in octal is 156158 Watch

Do this one: 94610  octal 16628

from octal (base 8) back to decimal 156158 write the number write the powers of 8 below it and multiply. then add the products. 1 5 6 1 5 4096 512 64 8 1 1 *4096 = 4096 5 * 512 = 2560 6 * 64 = 384 1* 8 = 8 5 * 1 = 5 added together = 7053 Watch

Do this one 20458 106110

1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 Binary  hex  octal If you can count from 1 to 15 in binary you have it made

Binary to hexadecimal and hex to binary Watch 4 binary digits correspond to 1 hexadecimal digit Start grouping digits on the RIGHT side 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F To convert binary 1101011110 to hex Binary  Hexadecimal 11 0101 1110 3 5 E 35E16 Write this down the side of your paper. Hex  Binary 28D1 10 1000110100012

Practice Hex  Binary  Hex Convert E5816 to Binary 111001011000 Convert 110010110 to Hexadecimal 196

binary to octal and octal to binary 3 binary digits correspond to 1 octal digit 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 Binary to octal 10110011 10 110 011 263 Octal to binary 451 100 101 001 101001 Watch

Practice Octal  Binary  Octal Convert 3078 to Binary 11000111 Convert 110010110 to Octal 646

octal to hex and hex to octal. Convert to binary, regroup and convert to other base. Octal to binary to hex 4518 100 101 001 100101001 1 0010 1001 12916 Watch

Practice Octal  Hex Convert 3078 to Hex 11 000 111 first in binary 11000111 1100 0111 divide into groups of 4 12 7 C716

Practice Hex  Octal Convert 2B1D16 to Octal 10 1011 0001 1101 first in binary 10101100011101 10 101 100 011 101 divide into groups of 3 2 5 4 3 5 254358

The End