OCTAL, BINARY, AND HEXADECIMAL NUMBERS

Similar documents
Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Section 1.4 Place Value Systems of Numeration in Other Bases

6 The Hindu-Arabic System (800 BC)

The Subnet Training Guide

NUMBER SYSTEMS. 1.1 Introduction

MEP Y9 Practice Book A

Binary Numbers. Binary Octal Hexadecimal

NUMBER SYSTEMS. William Stallings

Unsigned Conversions from Decimal or to Decimal and other Number Systems

Base Conversion written by Cathy Saxton

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

THE BINARY NUMBER SYSTEM

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

=

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

2011, The McGraw-Hill Companies, Inc. Chapter 3

Number Systems and Radix Conversion

The string of digits in the binary number system represents the quantity

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

Useful Number Systems

Lecture 2. Binary and Hexadecimal Numbers

Computer Science 281 Binary and Hexadecimal Review

CSI 333 Lecture 1 Number Systems

Number of bits needed to address hosts 8

Positional Numbering System

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

COMPSCI 210. Binary Fractions. Agenda & Reading

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Smart Meters Programme Schedule 2.6. (Insurance) (CSP North version)

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:

Primes. Name Period Number Theory

NETWORK ADMINISTRATION

CS321. Introduction to Numerical Methods

Chapter 2. Binary Values and Number Systems

NEXT. Tools of the Participant Portal: Scientific Reports & Deliverables

Decimals and other fractions

Grade 6 Math Circles. Binary and Beyond

January 20, 2009 GEORGE W. WRIGHT VICE PRESIDENT, INFORMATION TECHNOLOGY OPERATIONS

Accuplacer Arithmetic Study Guide

Concepts in IP Addressing...

Subnetting Study Guide

Subnetting Examples. There are three types of subnetting examples I will show in this document:

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

TCP/IP Cheat Sheet. A Free Study Guide by Boson Software, LLC

Decimal to Binary Conversion

Chapter 5. Binary, octal and hexadecimal numbers

Style Guide for the Applied Dissertation

Systems I: Computer Organization and Architecture

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Solution for Homework 2

Decimal Number (base 10) Binary Number (base 2)

Introduction to Computer & Information Systems

Roman Numerals. Symbol Decimal Value I One (1) V Five (5) X Ten (10) L Fifty (50) C Hundred (100) D Five Hundred (500) M Thousand (1000)

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

A Step towards an Easy Interconversion of Various Number Systems

Binary Adders: Half Adders and Full Adders

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

The pattern going to the right or the left from the decimal point is the same but there are two big differences:

4.3 TABLE 3 TABLE five

Lecture 11: Number Systems

Probability and Expected Value

Prerequisite knowledge Students should have a good understanding of how our decimal number system works as well as understand place value.

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Capital Investment in Health Report of the Department of Health. Overview and Priorities

Pre-Algebra Lecture 6

3. Convert a number from one number system to another

Chapter 19 Network Layer: Logical Addressing 19.1

The Hexadecimal Number System and Memory Addressing

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

COMBINATIONAL CIRCUITS

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Cyber Security Workshop Encryption Reference Manual

b) since the remainder is 0 I need to factor the numerator. Synthetic division tells me this is true

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Number and codes in digital systems

NCTM Content Standard/National Science Education Standard

Chapter 1. Binary, octal and hexadecimal numbers

We Are HERE! Subne\ng

5.4 Solving Percent Problems Using the Percent Equation

Club Accounts Question 6.

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

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

CPEN Digital Logic Design Binary Systems

VOL. 2, NO. 11, November 2012 ISSN ARPN Journal of Systems and Software AJSS Journal. All rights reserved

pi: in the examples below.

IT:101 Cisco Networking Academy I Subnetting

MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

Pre-lab Preparation: 1. Read thoroughly and prepare the experiment sheet. 2. You must bring a printed copy of this experiment with you to the lab.

IP Subnetting Colin Weaver, ITdojo

Review of Scientific Notation and Significant Figures

Unit 6 Number and Operations in Base Ten: Decimals

Deutsche Bank Paper Invoice Submission and Compliance Requirements Manual (PO and Non PO) India Region

LESSON PLANS FOR PERCENTAGES, FRACTIONS, DECIMALS, AND ORDERING Lesson Purpose: The students will be able to:

Data Submission Guide

Fractions to decimals

Chapter 1: Digital Systems and Binary Numbers

PAUL VOGEL MANAGING DIRECTOR, GLOBAL BUSINESS AND SENIOR VICE PRESIDENT

Advanced Topics: IP Subnetting A WHITE PAPER PREPARED FOR ASPE TECHNOLOGY. toll-free:

Transcription:

A: REVIEW - DECIMAL OR BASE 10 NUMBERS OCTAL, BINARY, AND HEXADECIMAL NUMBERS When we see a number like 2,578 we know the 2 counts for more than the 7, even though 7 is a larger number than 2. The reason the 2 counts for more than the 7 is because in our number system, the Hindu-Arabic numeral system, place value is more important than the size of the individual digit. When we talk about Decimal numbers, we are not just talking about numbers that have a decimal point, like 6.43. For now, any Base 10 number will be referred to as a Decimal number, and vice versa. In Base 10, there are 10 different digits that can occupy a place. They are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. If there are more than 9 items, we must represent that value using 2 or more digits. Back to the number 2,578. The 8 is in the ones column, and 1 can be written as 10 0. The 7 is in the tens column, and 10 can be written as 10 1. The 5 is in the hundreds column, and 100 can be written as 10 2. The 2 is in the thousands column, and 1000 can be written as 10 3. The value of each place can be written as a power of 10. B: OCTAL OR BASE 8 NUMBERS In Octal there are only 8 different digits that can occupy a single place. They are 0, 1, 2, 3, 4, 5, 6, and 7. In Base 10 there is no single digit to represent the number 10. In Base 8 there is no single digit to represent the number 8 or 9. If there are more than 7 items, we must represent that value using 2 or more digits. Given the number: 3, 462 8. The 2 is in the ones column, and 1 can be written as 8 0. The 6 is in the eights column, and 8 can be written as 8 1. The 4 is in the eight times eight, or 64s column, and 64 can be written as 8 2. The 3 is in the eight times eight times eight, or 512s column, and 512 is 8 3. Converting an Octal Number into a Decimal Number Suppose I have the number above: 3, 462 8 (Notice that there is a subscript after the number indicating that this is a Base 8 number. In most cases, if there is no subscript you can assume the given number is Base 10. Sometime a subscript of 10 is used to avoid confusion.) To convert the number 3, 462 8 we look at what each digit represents. The 3 is the number of 512s we have: 3 * 512 = 1,536 The 4 is the number of 64s we have: 4 * 64 = 256 The 6 is the number of 8s we have: 6 * 8 = 48 The 2 is the number of 1s we have: 2 * 1 = 2 Adding up the far right column, we get: 1,842 So, 3, 462 8 = 1, 842 10.

Converting a Decimal Number into an Octal Number Given the number 307, how can that Decimal Number be converted into an Octal number? The process is relatively straightforward. Look at the 4 digits from the previous Octal number, 3, 462 8. Going from left to right, the four columns represent the number of 512s, 64s, 8s, and 1s present. To begin the conversion of 307, we start by asking How many 512s are there in 307? Well, there aren t any, so we will write down the digit zero, just as a place-holder. -> 0xxx Next, we ask How many 64s are there in 307? There are 4. The 4 in the 64s column accounted for 256. Subtract 256 from 307, to get 51 remaining. Next, we ask How many 8s are there in 51? There are 6. The 6 in the 8s column accounted for 48. Subtract from 48 from 51, to get 3 remaining. -> 04xx -> 046x There are three 1s left, so our final answer is: -> 0463 So, 307 10 = 463 8. C: BINARY OR BASE 2 NUMBERS Binary Numbers may look odd at first because they consist of zeroes and ones, and nothing else. Some typical Binary Numbers are: 10111 or 1011011110110 or 10 or 10101010101 Given the number 10111 2. Let s identify the value of each of the ones. Going from right to left (or least significant to most significant): There is a 1 in the 1s column, and 1 can be written as 2 0. There is a 1 in the 2s column, and 2 can be written as 2 1. There is a 1 in the two times two, or 4s column, and 4 can be written as 2 2. There is a 0 in the two times two times two, or 8s column, and 8 can be written as 2 3. There is a 1 in the two times two times two times two, or 16s column, and 16 is 2 4. Converting a Binary Number into a Decimal Number Suppose I have the number from above: 10111 2 To convert the number 10111 2 we look at what each binary digit represents and add up the total. There is a 1 in the 16s column: 1 * 16 = 16 There is a 0 in the 8s column: 0 * 8 = 0 There is a 1 in the 4s column: 1 * 4 = 4 There is a 1 in the 2s column: 1 * 2 = 2 There is a 1 in the 1s column: 1 * 1 = 1 Adding up the far right column, we get: 23 So, 10111 2 = 23 10.

Converting a Decimal Number into a Binary Number The process of converting a Decimal Number into a Binary Number uses the same steps we saw previously when going from Decimal to Octal, with different numbers. Let s begin by identifying what each column represents in a Binary Number. Going from right to left, or smallest to largest, the columns are the 1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s, 256s, 512s, and 1024s. To convert 487 into Binary, we start by asking How many 1024s are there in 487? (Note: 1024 is the 11 th column.) There aren t any, so write down a zero as a place-holder. Next, we ask How many 512s are there in 487? There are 0. How many 256s are there in 487? There is 1. -> 0xxxxxxxxxx -> 00xxxxxxxxx -> 001xxxxxxxx Subtract 256 from 487 to get 231 remaining. How many 128s are there in 231? There is 1. -> 0011xxxxxxx Subtract 128 from 231 to get 103 remaining. How many 64s are there in 103? There is 1. -> 00111xxxxxx Subtract 64 from 103 to get 39 remaining. How many 32s are there in 39? There is 1. -> 001111xxxxx Subtract 32 from 39 to get 7 remaining. How many 16s are there in 7? None. How many 8s are there in 7? None. How many 4s are there in 7? There is 1. -> 0011110xxxx -> 00111100xxx -> 001111001xx Subtract 4 from 7 to get 3 remaining. How many 2s are there in 3? There is 1. -> 0011110011x Subtract 2 from 3 to get 1 remaining. Finally, there is 1 one left. -> 00111100111 So, 487 10 = 111100111 2

D: HEXADECIMAL OR BASE 16 NUMBERS Saving the strangest for last, Hexadecimal Numbers look very weird at first. With a little bit of work you will see that they behave just like Octal and Binary Numbers. In Decimal there are 10 different digits that can occupy a place. They are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. In Octal there are only 8 different digits that can occupy a place. They are 0, 1, 2, 3, 4, 5, 6, and 7. In Binary there are only 2 different digits that can occupy a place. They are 0 and 1. In Hexadecimal there are 16 different digits that can occupy a place. We start with the 10 digits most familiar to us - 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. But we need 6 more digits, so we will use letters, namely A, B, C, D, E, and F. Hold up one hand and count your fingers. In Base 10, you have 5. In Base 8, you also have 5. In Base 2, you have 101! And in our new Base 16, you still have 5. Now count the fingers on both of your hands. In Decimal you have 10 fingers. In Octal you have 12 fingers. In Binary you have 1010 fingers. In Base 16, you have A fingers. Basically, in Base 16 we must be able to represent 10, 11, 12, 13, 14, and 15 items using a single digit. So we let A 16 = 10, B 16 = 11, C 16 = 12, D 16 = 13, E 16 = 14, and F 16 = 15. A couple of interesting Hexadecimal numbers are DEAD 16 and BEEF 16 Given the number: 3AD 16. The D (or 13) is in the 1s column, and 1 can be written as 16 0. The A (or 10) is in the 16s column, and 16 can be written as 16 1. The 3 is in the sixteen times sixteen, or 256s column, and 256 is 16 2. Converting a Hexadecimal Number into a Decimal Number Suppose I have the number from above: 3AD 8 To convert the number 3AD 8 we look at what each digit represents. The 3 is the number of 256s we have: 3 * 256 = 768 The A is the number of 16s we have: 10 * 16 = 160 The D is the number of 1s we have: 13 * 1 = 13 Adding up the far right column, we get: 941 So, 3AD 168 = 941 10.

Converting a Decimal Number into a Hexadecimal Number Like before, we look at each column, see what value it represents, and then determine how many whole times the column value goes into the number we have left. Let s convert the Decimal Number 747 into a Hexadecimal number. The process is similar to what we did for Octal and Binary Numbers, except in each base the columns represent different values. In Base 16, the first four column values are: 16 0 = 1, 16 1 = 16, 16 2 = 256, and 16 3 = 4096. How many 4096s are there in 747? None. How many 256s are there in 747? There are 2. Subtract 2 times 256 from 747, to get 235 remaining. How many 16s are there in 235? There are 14. To represent 14 in one digit we use the number E. The E in the 16s column accounted for 224 = 14*16. Subtract from 224 from 235, to get 11 remaining. -> 0xxx -> 02xx -> 02Ex To represent 11 in one digit we use the number B. -> 02EB So, 747 10 = 2EB 16. Homework: 1. Convert the following Octal Numbers into Decimal Numbers: a. 27 8 b. 104 8 c. 572 8 d. 1,362 8 2. Convert the following Decimal Numbers into Octal Numbers: a. 29 b. 67 c. 130 d. 609 3. Convert the following Binary Numbers into Decimal Numbers: a. 101 2 b. 100011 2 c. 111001111 2 d. 101010101010101 2 4. Convert the following Decimal Numbers into Binary Numbers: a. 7 b. 33 c. 140 d. 299 5. Convert the following Hexadecimal Numbers into Decimal Numbers: a. 1B 16 b. B2 16 c. ABC 16 d. 101F 16 6. Convert the following Decimal Numbers into Hexadecimal Numbers: a. 17 b. 50 c. 239 d. 4108