Decimal to Binary Conversion



Similar documents
Base Conversion written by Cathy Saxton

Positional Numbering System

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

Computer Science 281 Binary and Hexadecimal Review

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

Useful Number Systems

Cyber Security Workshop Encryption Reference Manual

3. Convert a number from one number system to another

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

Lab#2: IP Addressing and Subnetting

Section 1.4 Place Value Systems of Numeration in Other Bases

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

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

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

Lecture 11: Number Systems

Binary Numbers. Binary Octal Hexadecimal

=

Unsigned Conversions from Decimal or to Decimal and other Number Systems

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

Number Systems. Introduction / Number Systems

Number of bits needed to address hosts 8

Binary, Hexadecimal, Octal, and BCD Numbers

1. How many unique network IDs are there in class A addresses? # of unique hosts?

THE BINARY NUMBER SYSTEM

Chapter 2. Binary Values and Number Systems

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

Counting in base 10, 2 and 16

CSI 333 Lecture 1 Number Systems

Solution Guide Chapter 14 Mixing Fractions, Decimals, and Percents Together

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.

Binary Representation

The Hexadecimal Number System and Memory Addressing

COMPSCI 210. Binary Fractions. Agenda & Reading

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Numbering Systems. InThisAppendix...

Lecture 2. Binary and Hexadecimal Numbers

Chapter 4. IP Addresses: Classful Addressing

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

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

Data Representation. What is a number? Decimal Representation. Interpreting bits to give them meaning. Part 1: Numbers. six seis

IBM Emulation Mode Printer Commands

Activity 6.7.4: IPv4 Address Subnetting Part 2

2.3 IPv4 Address Subnetting Part 2

The Answer to the 14 Most Frequently Asked Modbus Questions

Subnetting Study Guide

Systems I: Computer Organization and Architecture

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

Intel Hexadecimal Object File Format Specification Revision A, 1/6/88

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt

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

Chapter 19 Network Layer: Logical Addressing 19.1

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Classless Subnetting Explained

CPEN Digital Logic Design Binary Systems

CE363 Data Communications & Networking. Chapter 6 Network Layer: Logical Addressing

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

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

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

Chapter 4 IP Addresses: Classful Addressing

One of the most important topics in any discussion of TCP/IP is IP. IP Addressing

Advanced Encryption Standard by Example. 1.0 Preface. 2.0 Terminology. Written By: Adam Berent V.1.7

IPv6 Addressing. How is an IPv6 address represented. Classifications of IPv6 addresses Reserved Multicast addresses. represented in Hexadecimal

Hexadecimal Object File Format Specification

Advanced Encryption Standard by Example. 1.0 Preface. 2.0 Terminology. Written By: Adam Berent V.1.5

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

NUMBER SYSTEMS. 1.1 Introduction

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

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

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

Fuld Skolerapport for Søhusskolen, i Odense kommune, for skoleår 2013/2014 for klassetrin(ene) 9. med reference Tilsvarende klassetrin i kommunen

Fuld Skolerapport for Hunderupskolen, i Odense kommune, for skoleår 2013/2014 for klassetrin(ene) 7. med reference Tilsvarende klassetrin i kommunen

Solution for Homework 2

Memory is implemented as an array of electronic switches

Lesson Plan. Course Title: Computer Maintenance Session Title: Numbering Systems

Lab 17: Building a 4-Digit 7-Segment LED Decoder

NUMBER SYSTEMS. William Stallings

Japanese Character Printers EPL2 Programming Manual Addendum

Computer Networks. Introduc)on to Naming, Addressing, and Rou)ng. Week 09. College of Information Science and Engineering Ritsumeikan University

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Expert Reference Series of White Papers. Simple Tricks To Ace the Subnetting Portion of Any Certification Exam COURSES.

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

6 The Hindu-Arabic System (800 BC)

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Number and codes in digital systems

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

How to Create Subnets To create subnetworks, you take bits from the host portion of the IP address and reserve them to define the subnet address.

Fractions to decimals


Are You Ready to Teach IPv6?

Basic Use of the TI-84 Plus

IP Subnetting and Related Topics A Tutorial by Chris Uriarte <chrisjur@cju.com> Updated April 2001

IPv6 Addressing. John Rullan Cisco Certified Instructor Trainer Thomas A. Edison CTE HS

Sequences. A sequence is a list of numbers, or a pattern, which obeys a rule.

IPv6 Addressing. Awareness Objective. IPv6 Address Format & Basic Rules. Understanding the IPv6 Address Components

Expert Reference Series of White Papers. Binary and IP Address Basics of Subnetting

HOMEWORK # 2 SOLUTIO

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

The goal is to program the PLC and HMI to count with the following behaviors:

MEP Y9 Practice Book A

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

Transcription:

Decimal to Binary Conversion A tool that makes the conversion of decimal values to binary values simple is the following table. The first row is created by counting right to left from one to eight, for the basic eight bit positions. The table will work for any size binary value. The value row starts with one and doubles, Base 2, for each position to the left. Position: 8 7 6 5 4 3 2 1 Value: 128 64 32 16 8 4 2 1 The same conversion table and simple division can be used to convert binary values to decimal values. To convert 207 to binary: 1. Start with the digit farthest to the left. Determine if the decimal value can be divided by it. Since it will go one time, put a 1 in row three of the conversion table under the 128 value and calculate the remainder, 79. 2. Since the remainder can be divided by the next value, 64, put a 1 in row three under the 64 value of the table. 3. Since the remainder cannot be divided by either 32 or 16, put 0s in row three of our table under the 32 and 16 values. 4. Continue until there is no remainder. 5. If necessary, use row four to check the work. Position: 8 7 6 5 4 3 2 1 Value: 128 64 32 16 8 4 2 1 1 1 0 0 1 1 1 1 128 64 8 4 2 1 =207 Convert the following decimal values to binary values: a. 123

b. 202 c. 67 d. 7 e. 252 f. 91 g. 116.127.71.3 h. 255.255.255.0 i. 192.143.255.255. j. 12.101.9.16 Binary to Decimal Conversion To convert 10111001 to decimal: 1. Enter the binary bits in row three. In this example 10111001 2. Put the decimal values in row four only for the third row 1s. Technically the row two values are being multiplied by row three. 3. Now just add row four across. Position: 8 7 6 5 4 3 2 1 Value: 128 64 32 16 8 4 2 1 1 0 1 1 1 0 0 1 128 32 16 8 1 =185 Convert the following binary values to decimals: a. 1110 b. 100110 c. 11111111 d. 11010011 e. 01000001 f. 11001110 g. 01110101 h. 10001111 i. 11101001.00011011.10000000.10100100... j. 10101010.00110100.11100110.00010111... Hexadecimal Conversions The Hexadecimal (Hex) number system is used to refer to the binary numbers in a NIC or IPv6 address. The word hexadecimal comes from the Greek word for 16. Hexadecimal is often abbreviated

"0x", zero and lower case x. Hex numbers use 16 unique digits to display any combination of eight binary digits as only two hexadecimal digits. A Byte, or 8 bits, can range from 00000000 to 11111111. A Byte can create 256 combinations with decimal values ranging from 0 to 255 or Hex values 0 to FF. Each Hex value represents only four binary bits. The alpha (A-F) values are not case sensitive. A tool that makes the conversion of hexadecimal to decimal values simple is the following table. Use the same techniques as covered in binary to decimal conversions. The first row is the two Hex positions. The value row starts as 1 and 16, base 16, for each position to the left. Position: 2 1 Value: 16 1 Hexadecimal to decimal conversion: 1. Break the Hex value into pairs. Start at the right side. For example 77CE becomes 77 and CE. Insert a zero in the first position if necessary to complete the first pair. 2. Put each Hex pair in row three. The value in parenthesis is the decimal value of A-F. 3. To get the decimal values in row four, multiply the row two values with row three. 4. Now just add row four across. Position: 2 1 Value: 16 1 7 7 112 7 =119 Position: 2 1 Value: 16 1 C(12) E(14) 192 14 =206 Decimal to hexadecimal conversion: 1. To be valid for the purpose of this lab, the decimal value will be between 0 and 256. The first Hex value is derived by dividing the decimal value by 16. If the value is greater than 9 it will need to be put in Hex form A-F. 2. The second value is the remainder from step 1. If the value is greater than 9 it will need to be put in Hex form A-F.

3. For example, 209 divided by 16 is 13 with a remainder of 1. 13 equals D in Hex. Therefore, 209 equals D1. Hexadecimal to binary conversion: This is the easiest conversion. Remember that each Hex value converts to four binary bits, so work right to left. 1. For example, to convert 77AE to binary. Start with E. Use the table at the end of this exercise to go directly to binary. The other alternative is to convert the value to decimal, E = 14, and then use the last four positions of the table used in the decimal to binary conversions. 14 divided by 8 is 1 with a remainder of 6. 6 divided by 4 is 1 with a remainder of 2. 2 divided by 2 is 1 with no remainder. Add zeros if necessary to end up with four bits. Position: 4 3 2 1 Value: 8 4 2 1 1 1 1 0 8 4 2 =14 2. Using the same technique, A becomes 1010 and the total so far is 10101110. 3. Continuing using the same technique, the two 7s becomes 0111 and the total is 0111011110101110. Binary to hexadecimal conversion: 1. Each Hex value equals four binary bits. Start by breaking the binary value into 4-bit units from right to left. Add any leading zeros required to end up with all 4-bit values. 01101110. 11101100 would become 0110 1110 1110 1100. 2. Use the table at the end of this exercise to go directly to Hex. The other alternative is to convert each 4-bit binary value to decimal, 0-15. Then convert the decimal to Hex, 0-F. Position: 4 3 2 1 Value: 8 4 2 1 1 1 0 0 8 4 =12 or C Position: 4 3 2 1 Value: 8 4 2 1 1 1 1 0 8 4 2 =14 or E

The result is 6E-EC. Convert the following values to the other two forms: Decimal Hex Binary a9 FF Bad1 E7-63-1C 53 115 19 212.65.119.45 10101010 110 11111100.00111100 00001100.10000000.11110000.11111111 Table decimal-hexadecimal-binary conversion: Dec Hex Binary 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001

10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111