Conversion Between Number Bases

Similar documents
Octal & Hexadecimal Number Systems. Digital Electronics

Number Systems. TA: Mamun. References: Lecture notes of Introduction to Information Technologies (ITEC 1011) by Dr Scott MacKenzie

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

Lecture 1: Digital Systems and Number Systems

CHAPTER 2 Number Systems

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

CS & IT Conversions. Magnitude 10,000 1,

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Bits. Binary Digits. 0 or 1

Decimal/Binary Conversion on the Soroban

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Chapter 3 DATA REPRESENTATION

Beyond Base 10: Non-decimal Based Number Systems

Information Science 1

Switching Circuits and Logic Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Common Number Systems

CHAPTER 2 (b) : AND CODES

The. Binary. Number System

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

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

Beyond Base 10: Non-decimal Based Number Systems

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

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

MATH 104B OCTAL, BINARY, AND HEXADECIMALS NUMBERS

MATH LEVEL 2 LESSON PLAN 5 DECIMAL FRACTIONS Copyright Vinay Agarwala, Checked: 1/22/18

Mastering Binary Math

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

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

Number Bases LESSON TWO. Computer Science. By John Owen

Chapter 2 Binary Values and Number Systems

Binary, Hexadecimal and Octal number system

1.1 Review of Place Value

Learning Log Title: CHAPTER 3: ARITHMETIC PROPERTIES. Date: Lesson: Chapter 3: Arithmetic Properties

ITEC 1011 Introduction to Information Technologies

Adding and Subtracting with Decimals

Decimal/Hexadecimal Conversion

Chapter 2 Exercises and Answers

Level ISA3: Information Representation

Example 2: Simplify each of the following. Round your answer to the nearest hundredth. a

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

Number representations

TOPIC: NUMBER SYSTEMS

Numbers!!...is that right? CSCI 255

Common Core State Standards Mathematics (Subset K-5 Counting and Cardinality, Operations and Algebraic Thinking, Number and Operations in Base 10)

Introduction to Computer Science (I1100) With 1 coin 2 possibilities: Head / Tail or 0/1

College of Computer and Information Sciences Department of Computer Science. CSC 220: Computer Organization. Unit1 Number Systems

Computer Number Systems Supplement

Numbering systems. Dr Abu Arqoub

Objective 1.02 Understand Numbering Systems

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

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

Python Numbers. Learning Outcomes 9/19/2012. CMSC 201 Fall 2012 Instructor: John Park Lecture Section 01 Discussion Sections 02-08, 16, 17

What Is It? Instruction Register Address Register Data Register

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

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

CSE 20. Lecture 4: Number System and Boolean Function. CSE 20: Lecture2

4 + 4 = = 1 5 x 2 = 10

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University

When using computers, it should have a minimum number of easily identifiable states.

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Chapter 1 Preliminaries

Objectives. Connecting with Computer Science 2

Step Octal Number Binary Number Step Step

Lecture (01) Introduction Number Systems and Conversion (1)

3. [Decimal, ]

But I know what most of you will do: use a calculator to convert; that's fine, IF you understand the theory.

Fractions Decimals Percents

Review of Number Systems

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

COUNTING AND CONVERTING

MA 1128: Lecture 02 1/22/2018

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Digital Systems and Binary Numbers

Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems

WJEC MATHEMATICS INTERMEDIATE NUMBER STANDARD FORM

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

Machine Architecture and Number Systems CMSC104. Von Neumann Machine. Major Computer Components. Schematic Diagram of a Computer. First Computer?

Chapter 2 Number Systems and Codes Dr. Xu

Digital Logic Lecture 2 Number Systems

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

D I G I T A L C I R C U I T S E E

Chapter 1 Emad Felemban

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Subtraction Understand Subtraction on a Number Line Using a number line let s demonstrate the subtraction process using the problem 7 5.

Accuplacer Arithmetic Study Guide

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

CHW 261: Logic Design

Section 1.1 Patterns in Division

Calculations with Sig Figs

Numbers and Representations

CMPE223/CMSE222 Digital Logic Design. Positional representation

Number Systems Base r

Math 6 Notes Unit 03 Notes: Decimals

Converting between Percents, Decimals, and Fractions

Computer Arithmetic. In this article we look at the way in which numbers are represented in binary form and manipulated in a computer.

Name: Date: Review Packet: Unit 1 The Number System

Appendix. Numbering Systems. In This Appendix...

Secure understanding of multiplication of whole numbers by 10, 100 or 1000.

Korea University of Technology and Education

Transcription:

Conversion Between Number Bases MATH 100 Survey of Mathematical Ideas J. Robert Buchanan Department of Mathematics Summer 2018

General Number Bases Bases other than 10 are sometimes used in numeration systems. Base 2, 8, and 16 (respectively binary, octal, and hexadecimal ) are used around computers. When we refer to a number expressed in a base other than 10, we will subscript the number with the base. 243 five = 243 5 In base-b we may only use the digits {0, 1, 2,..., b 1}.

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 2 3 4 5 6 7 8 9

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 2 3 4 5 6 7 8 9 10

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 6 16 26... 7 17 27... 8 18 28... 9 19 29... 10 20 30...

Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 6 16 26... 7 17 27... 8 18 28... 9 19 29... 10 20 30... In base-6 the digits are {0, 1, 2,..., 5} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 10 20 30...

Expanded Form Example 243 5 = (2 5 2 ) + (4 5 1 ) + (3 5 0 ) = 50 + 20 + 3 = 73

Expanded Form Example 243 5 = (2 5 2 ) + (4 5 1 ) + (3 5 0 ) = 50 + 20 + 3 = 73 Example 7654 8 = (7 8 3 ) + (6 8 2 ) + (5 8 1 ) + (4 8 0 ) = 3584 + 150 + 40 + 4 = 3778

Converting Between Bases To convert from base b to base 10: 1. Start with the first digit on the left and multiply by the base b. 2. Add the next digit and multiply again by the base b, and so on. 3. Add the last digit on the right (but do not multiply by the base).

Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345).

Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30

Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34

Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34 34 10 = 340

Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34 34 10 = 340 340 + 5 = 345

Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form.

Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24

Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28

Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28 28 8 = 224

Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28 28 8 = 224 224 + 5 = 229

Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7

Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8

Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8 3. 6185 9

Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8 3. 6185 9 4. 101101110 2

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division.

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6.

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3 6 0 3

Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3 6 0 3 Thus 3353 6 = 789. Note that we read the remainders from bottom to top.

Another Conversion Convert 789 to base 4.

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0 4 0 3

Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0 4 0 3 Thus 30111 4 = 789. Remember to read the remainders from bottom to top.

Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.

Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.

Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. 7. Convert 70893 to base 7. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.

Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. 7. Convert 70893 to base 7. 8. Convert 11028 to base 4. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.

Hexadecimal (Base 16) Numbers The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}.

Hexadecimal (Base 16) Numbers The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Digit Name Base-10 Value Digit Name Base-10 Value 0 zero 0 8 eight 8 1 one 1 9 nine 9 2 two 2 A alpha 10 3 three 3 B bravo 11 4 four 4 C charlie 12 5 five 5 D dog 13 6 six 6 E echo 14 7 seven 7 F fox 15

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}.

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal.

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F 16 0 3

Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Thus 3FE3 16 = 16355. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F 16 0 3

Conversion Between Base 2 and Base 8 Base-10 Base-8 Base-2 0 0 8 000 2 1 1 8 001 2 2 2 8 010 2 3 3 8 011 2 4 4 8 100 2 5 5 8 101 2 6 6 8 110 2 7 7 8 111 2

Conversion Between Base 2 and Base 16 Base-10 Base-16 Base-2 0 0 16 0000 2 1 1 16 0001 2 2 2 16 0010 2 3 3 16 0011 2 4 4 16 0100 2 5 5 16 0101 2 6 6 16 0110 2 7 7 16 0111 2 8 8 16 1000 2 9 9 16 1001 2 10 A 16 1010 2 11 B 16 1011 2 12 C 16 1100 2 13 D 16 1101 2 14 E 16 1110 2 15 F 16 1111 2

Example (1 of 4) Convert 216 8 to binary (base-2).

Example (1 of 4) Convert 216 8 to binary (base-2). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 216 8 = 010001110 2

Example (1 of 4) Convert 216 8 to binary (base-2). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 2. Group all the binary digits. 216 8 = 010001110 2 216 8 = 010001110 2 = 10001110 2

Example (2 of 4) Convert 11010111101 2 to octal (base-8).

Example (2 of 4) Convert 11010111101 2 to octal (base-8). 1. Starting on the right, make groups of three binary digits. 11010111101 2 = 11010111101 2 = 011010111101 2

Example (2 of 4) Convert 11010111101 2 to octal (base-8). 1. Starting on the right, make groups of three binary digits. 11010111101 2 = 11010111101 2 = 011010111101 2 2. Convert each group of three binary digits into a single octal digit. 011010111101 2 = 3275 8 = 3275 8

Example (3 of 4) Convert F4 16 to binary (base-2).

Example (3 of 4) Convert F4 16 to binary (base-2). 1. Write each hexadecimal (base-16) digit as a four-digit binary (base-2) number. F4 16 = 11110100 2

Example (3 of 4) Convert F4 16 to binary (base-2). 1. Write each hexadecimal (base-16) digit as a four-digit binary (base-2) number. 2. Group all the binary digits. F4 16 = 11110100 2 F4 16 = 11110100 2

Example (4 of 4) Convert 37 8 to hexadecimal (base-16).

Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2

Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2 2. Group all the binary digits into groups of four digits. 011111 2 = 011111 2 = 00011111 2

Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2 2. Group all the binary digits into groups of four digits. 011111 2 = 011111 2 = 00011111 2 3. Convert each group of four binary digits to a hexadecimal digit. 00011111 2 = 1F 16