Mastering Binary Math

Similar documents
NUMERIC SYSTEMS USED IN NETWORKING

First the Basics Binary Arithmetic

Binary, Hexadecimal and Octal number system

Lecture 1: Digital Systems and Number Systems

Number Bases LESSON TWO. Computer Science. By John Owen

Chapter 8 Patterns. Examples: a, b, c,, x, y, z

Objective 1.02 Understand Numbering Systems

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.

Conversion Between Number Bases

MathWorks MATLAB download & installation instructions

4 + 4 = = 1 5 x 2 = 10

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

How & Why We Subnet Lab Workbook

Computer Number Systems Supplement

Memory Addressing, Binary, and Hexadecimal Review

MATH 104B OCTAL, BINARY, AND HEXADECIMALS NUMBERS

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Section 1.1 Patterns in Division

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

12 Advanced IP Addressing

Binary the Digital Language

Step 1 The number name given in the question is five and sixty-eight-hundredths. We know that

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Chapter 8: Subnetting IP Networks

Formatting for TLM - Part I

Converting between Percents, Decimals, and Fractions

Primary Source Verification. How to Apply

Appendix 2 Number Representations

Primary Source Verification. How to Apply

COUNTING AND CONVERTING

Note: This case study utilizes Packet Tracer. Please see the Chapter 4 Packet Tracer file located in Supplemental Materials.

17. [Exploring Numbers]

Net Masks and IP Addresses

UoK MIS USER MANUAL: STUDENTS

Math 6 Notes Unit 03 Notes: Decimals

Lab Using the Windows Calculator with Network Addresses

REPRESENTING INFORMATION:

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Hexadecimal Numbers. Journal: If you were to extend our numbering system to more digits, what digits would you use? Why those?

Chapter 2: Configuring Network Protocols

Basic Arithmetic Operations

The. Binary. Number System

1.1 Information representation

In this lesson, we will use the order of operations to evaluate and simplify expressions that contain numbers and variables.

1.1 Review of Place Value

Game100 Networking Lab 4. Part 1 (5.1.4) Using the Windows Calculator with Network Addresses

What Is It? Instruction Register Address Register Data Register

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

IP Addressing and Subnetting. 2002, Cisco Systems, Inc. All rights reserved.

CS & IT Conversions. Magnitude 10,000 1,

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

The exam. The exam. The exam 10. Sitting a City & Guilds online examination 11. Frequently asked questions 18. Exam content 20

Digital Fundamentals

Learning the Binary System

Address Class (Exercise) B A

MTK smartphone Multiple downloading tool operating instructions

Chapter 2 Bits, Data Types, and Operations

We have looked at how and why one router dials another using ISDN. Just as important is knowing what keeps the link up once it is dialed.

Course Directive Degree Audit Exception

Installing Your Multifunction to Your Network for the First Time

Appendix. Numbering Systems. In This Appendix...

Primary Source Verification Oman Medical Specialty Board (OMSB) - Oman Health practitioners with more than two years of most recent experience in Oman

Ratios can be written in several different ways. Using a colon. Using the word to. Or as a fraction.

Extra Practice Problems 2

Numbers and Representations

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Pre-Algebra Notes Unit One: Rational Numbers and Decimal Expansions

CHAPTER 2 Number Systems

Number systems and binary

Appendix. Numbering Systems. In this Appendix

Rev Name Date. . Round-off error is the answer to the question How wrong is the rounded answer?

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

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

THE LOGIC OF COMPOUND STATEMENTS

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Beyond Base 10: Non-decimal Based Number Systems

Thanks, Peanut! Polygons are simple, closed figures having three or more straight sides. Or are they?

Informatics 1 - Computation & Logic: Tutorial 3

Parent s Guide to GO Math! Technology Correlation

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

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

9 R1 Get another piece of paper. We re going to have fun keeping track of (inaudible). Um How much time do you have? Are you getting tired?

Variables and Data Representation

Math 7 Notes Unit Three: Applying Rational Numbers

Hello! My name is PC and I am learning how to use a computer. Let s learn together! Unit1

Programming Concepts and Skills. ASCII and other codes

TCP/IP Addressing. IP Addressing. IP Addressing. IP Addressing. 32 Bits. Dotted Decimal Maximum. 32 Bits. 32 Bits. Dotted Decimal Maximum

CS 100 Spring Lecture Notes 3/8/05 Review for Exam 2

Topic Notes: Bits and Bytes and Numbers

How to convert a numeric value into English words in Excel

Rational Number is a number that can be written as a quotient of two integers. DECIMALS are special fractions whose denominators are powers of 10.

QUIZ: Generations of computer technology. Hardware:

Number Systems. The Computer Works in Binary, or how I learned to think like a computer. The computer s natural number system is binary not decimal.

CS 31: Intro to Systems Binary Representation. Kevin Webb Swarthmore College September 6, 2018

Beyond Base 10: Non-decimal Based Number Systems

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Pre-Algebra Notes Unit Five: Rational Numbers and Equations

Pre-Algebra Notes Unit Five: Rational Numbers and Equations

Transcription:

Cisco certification candidates, from the CCNA to the CCIE, must master binary math. This includes basic conversions, such as binary-to-decimal and decimal-to-binary, as well as more advanced scenarios involving subnetting and VLSM. There s another conversion that might rear its ugly head on your Cisco exam, though, and that involves hexadecimal numbering. Newcomers to hexadecimal numbering are often confused as to how a letter of the alphabet can possibly represent a number. Worse, they may be intimidated after all, there must be some incredibly complicated formula involved with representing the decimal 11 with the letter b, right? Wrong. The numbering system we use every day, decimal, concerns itself with units of ten. Although we rarely stop to think of it this way, if you read a decimal number from right to left, the number indicates how many units of one, ten, and one hundred we have. That is, the number 15 is five units of one and one unit of ten. The number 289 is nine units of one, eight units of ten, and two units of one hundred. Simple enough! Units Of 100 Units Of 10 Units Of 1 The decimal 15 0 1 5 The decimal 289 2 8 9 Hex numbers are read much the same way, except the units here are units of 16. The number 15 in hex is read as having five units of one and one unit of sixteen. The number 289 in hex is nine units of one, eight units of sixteen, and two units of 256 (16 x 16). Units Of 256 Units Of 16 Units Of 1 The hex numeral 15 0 1 5 The hex numeral 289 2 8 9 Since hex uses units of sixteen, how can we possibly represent a value of 10, 11, 12, 13, 14, or 15? We do so with letters. The decimal 10 is represented in hex with the letter a ; the decimal 11 with b ; the decimal 12 with c, 13 with d, 14 with e, and finally, 15 with f. (Remember that a MAC address of ffff.ffff.ffff is a Layer 2 broadcast.) Practice Your Conversions for Exam Success Now that you know where the letters fall into place in the hexadecimal numbering world, you ll have little trouble converting hex to decimal and decimal to hex if you practice. How would you convert the decimal 27 to hex? You can see that there is one unit of 16 in this decimal; that leaves 11 units of one. This is represented in hex with 1b one unit of sixteen, 11 units of one. Work From Left To Right To Perform Decimal Hexadecimal Conversions. Units of 256 Units of 16 Units of 1 Hexadecimal Value Decimal Number 27 0 1 B (11) 1b Chris Bryant, CCIE #12933 Page 1

Converting the decimal 322 to hex is no problem. There is one unit of 256; that leaves 66. There are four units of 16 in 66; that leaves 2, or two units of one. The hex equivalent of the decimal 322 is the hex figure 142 one unit of 256, four units of 32, and 2 units of 2. Units of 256 Units of 16 Units of 1 Hexadecimal Value Decimal Number 322 1 4 2 142 Hex-to-decimal conversions are even simpler. Given the hex number 144, what is the decimal equivalent? We have one unit of 256, four units of 16, and four units of 4. This gives us the decimal figure 324. Units of 256 Units of 16 Units of 1 Decimal Value Hexadecimal Number 144 1 4 4 256 + 64 + 4 = 324 What about the hex figure c2? We now know that the letter c represents the decimal number 12. This means we have 12 units of 16, and two units of 2. This gives us the decimal figure 194. Units of 256 Units of 16 Units of 1 Decimal Value Hexadecimal Number c2 0 12 2 192 + 2 = 194 Tips for Exam Day Practice your binary and hexadecimal conversions over and over again before you take your CCNA exams. Binary math questions come in many different forms; make sure you have practiced all of them before exam day. The number one reason CCNA candidates fail their exam is that they re not prepared for the different types of binary math questions they re going to be asked, and that they aren t ready for hexadecimal questions at all. As you can see, hexadecimal conversions are actually simple. You have to practice them, though! You don t have time to learn how to do in on exam day. You ve got to be ready before you go into the exam room, and the only way to be ready is a lot of practice. Finally, make sure you read the question carefully. You ve got hex, decimal, and binary numbers to concern yourself with on your CCNA and CCNP exams. Make sure you give Cisco the answer in the format they re looking for. I have written 20 practice questions that will help you practice your hexadecimal conversion skills. Once you practice with these questions, and know exactly how each answer was arrived at, you ll have no problem with hexadecimal conversions on your Cisco exams. Best of luck! To your success, Chris Bryant, CCIE #12933 Chris Bryant, CCIE #12933 Page 2

1. Convert the following hexadecimal number to decimal: 1c 2. Convert the following hexadecimal number to decimal: f1 3. Convert the following hexadecimal number to decimal: 2a9 4. Convert the following hexadecimal number to decimal: 14b 5. Convert the following hexadecimal number to decimal: 3e4 6. Convert the following decimal number to hexadecimal: 13 7. Convert the following decimal number to hexadecimal: 784 8. Convert the following decimal number to hexadecimal: 419 9. Convert the following decimal number to hexadecimal: 1903 10. Convert the following decimal number to hexadecimal: 345 11. Convert the following hex number to binary: 42 12. Convert the following hex number to binary: 12 13. Convert the following hex number to binary: a9 14. Convert the following hex number to binary: 3c 15. Convert the following hex number to binary: 74 16. Convert the following binary string to hex: 00110011 17. Convert the following binary string to hex: 11001111 18. Convert the following binary string to hex: 01011101 19. Convert the following binary string to hex: 10011101 20. 20.Convert the following binary string to hex: 11010101 Answers begin on the next page. No peeking! Chris Bryant, CCIE #12933 Page 3

Before we go through the answers and how they were achieved, let's review the meaning of letters in hexadecimal numbering: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. (And remember that ffff.ffff.ffff is a Layer 2 broadcast!) Conversions involving hexadecimal numbers will use this chart: 1. Convert the following hexadecimal number to decimal: 1c 1 c There is one unit of 16 and twelve units of 1. 16 + 12 = 28. 2. Convert the following hexadecimal number to decimal: f1 There are fifteen units of 16 and 1 unit of 1. 240 + 1 = 241 f 1 3. Convert the following hexadecimal number to decimal: 2a9 2 a 9 There are two units of 256, ten units of 16, and nine units of 1. 512 + 160 + 9 = 681 Chris Bryant, CCIE #12933 Page 4

4. Convert the following hexadecimal number to decimal: 14b 1 4 b There is one unit of 256, four units of 16, and 11 units of 1. 256 + 64 + 11 = 331 5. Convert the following hexadecimal number to decimal: 3e4 3 e 4 There are three units of 256, fourteen units of 16, and four units of 1. 768 + 224 + 4 = 996 6. Convert the following decimal to hexadecimal: 13 When converting decimal to hex, work with the same chart from left to right. Are there any units of 256 in the decimal 13? No. 0 Are there any units of 16 in the decimal 13? No. 0 0 Are there any units of 1 in the decimal 13? Sure. Thirteen of them. Remember how we express the number "13" with a single hex character? 0 0 d The answer is "d". It's not necessary to have any leading zeroes when expressing hex value. 7. Convert the following decimal to hexadecimal: 784 Are there any units of 256 in the decimal 784? Yes, three of them, for a total of 768. Place a "3" in the 256 slot, and subtract 768 from 784. 3 Chris Bryant, CCIE #12933 Page 5

784-768 = 16 Obviously, there's one unit of 16 in 16. Since there is no remainder, we can place a "0" in the remaining slots. 3 1 0 The final result is the hex number "310". 8. Convert the following decimal to hexadecimal: 419 Are there any units of 256 in the decimal 419? Yes, one, with a remainder of 163. 1 Are there any units of 16 in the decimal 163? Yes, ten of them, with a remainder of three. 1 a Three units of one take care of the remainder, and the hex number "1a3" is the answer. 1 a 3 9. Convert the following decimal to hexadecimal: 1903 Are there any units of 256 in the decimal 1903? Yes, seven of them, totaling 1792. This leaves a remainder of 111. 7 Are there any units of 16 in the decimal 111? Yes, six of them, with a remainder of 15. 7 6 By using the letter "f" to represent 15 units of 1, the final answer "76f" is achieved. 7 6 f Chris Bryant, CCIE #12933 Page 6

10. Convert the following decimal to hexadecimal: 345 Are there any units of 256 in 345? Sure, one, with a remainder of 89. 1 Are there any units of 16 in 89? Yes, five of them, with a remainder of 9. 1 5 Nine units of nine give us the hex number "159". 1 5 9 11. Convert the following hex number to binary: 42 First, convert the hex number to decimal. We know "42" in hex means we have four units of 16 and two units of 1. Since 64 + 2 = 66, we have our decimal. Now we've got to convert that decimal into binary. Here's our chart showing how to convert the decimal 66 into binary: 128 64 32 16 8 4 2 1 66 0 1 0 0 0 0 1 0 The correct answer: 01000010 12. Convert the following hex number to binary: 12 First, convert the hex number to decimal. The hex number "12" indicates one unit of sixteen and two units of one; in decimal, this is 18. Now to convert that decimal into binary. Use the same chart we used in Question 11: 128 64 32 16 8 4 2 1 18 0 0 0 1 0 0 1 0 The correct answer: 00010010 Chris Bryant, CCIE #12933 Page 7

13. Convert the following hex number to binary: a9 First, convert the hex number to decimal. Since "a" equals 10 in hex, we have 10 units of 16 and nine units of 1. 160 + 9 = 169 Now convert the decimal 169 to binary: 128 64 32 16 8 4 2 1 169 1 0 1 0 1 0 0 1 The correct answer: 10101001 14. Convert the following hex number to binary: 3c First, convert the hex number to decimal. We have three units of 16 and 12 units of 1 (c = 12), giving us a total of 60 (48 + 12). Convert the decimal 60 into binary: 128 64 32 16 8 4 2 1 60 0 0 1 1 1 1 0 0 The correct answer: 00111100 15. Convert the following hex number to binary: 74 First, convert the hex number to decimal. We have seven units of 16 and four units of 1, resulting in the decimal 116 (112 + 4). Convert the decimal 116 into binary: 128 64 32 16 8 4 2 1 116 0 1 1 1 0 1 0 0 The correct answer: 01110100 The next five questions dealt with converting binary to hex. We're going to use much the same method in solving these questions, but this point bears repeating: Make sure to answer the question in the format that Cisco is asking for on your exams. Chris Bryant, CCIE #12933 Page 8

16. Convert the following binary string to hex: 00110011 First, we'll convert the binary string to decimal: 128 64 32 16 8 4 2 1 Decimal 0 0 1 1 0 0 1 1 51 To finish answering the question, convert the decimal 51 to hex. Are there any units of 256 in the decimal 51? No. Are there any units of 16 in the decimal 51? Yes, three, for a total of 48 and a remainder of three. Three units of one give us the hex number "33". 0 3 3 17. Convert the following binary string to hex: 11001111 First, we'll convert the binary string to decimal: 128 64 32 16 8 4 2 1 Decimal 1 1 0 0 1 1 1 1 207 Now convert the decimal 207 to hex. Are there any units of 256 in the decimal 207? No. Are there any units of 16 in the decimal 207? Yes, twelve of them, for a total of 192 and a remainder of 15. Twelve is represented in hex with the letter "c". Fifteen units of one are expressed with the letter "f", giving us a hex number of "cf". 0 c f 18. Convert the following binary string to hex: 01011101 First, convert the binary string to decimal: 128 64 32 16 8 4 2 1 Decimal 0 1 0 1 1 1 0 1 93 Now convert the decimal 93 to hex. There are no units of 256, obviously. How many units of 16 are there? Five, for a total of 80 and a remainder of 13. We express the number 13 in hex with the letter "d". The final result is the hex number "5d". 0 5 d 19. Convert the following binary string to hex: 10011101 Chris Bryant, CCIE #12933 Page 9

As always, convert the binary string to decimal first: 128 64 32 16 8 4 2 1 Decimal 1 0 0 1 1 1 0 1 157 Now convert the decimal 157 to hex. There are no units of 256. How many units of 16 are there in the decimal 157? Nine, for a total of 144 and a remainder of 13. You know to express the number 13 in hex with the letter "d", resulting in a hex number of 9d". 0 9 d 20. Convert the following binary string to hex: 11010101 First, convert the binary string to decimal: 128 64 32 16 8 4 2 1 Decimal 1 1 0 1 0 1 0 1 213 Now convert the decimal 213 to hex. No units of 256, but how many of 16? Thirteen of them, with a total of 208 and a remainder of 5. Again, the number 13 in hex is represented with the letter "d", and the five units of one give us the hex number "d5". 0 d 5 Chris Bryant, CCIE #12933 Page 10