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



Similar documents
Useful Number Systems

Computer Science 281 Binary and Hexadecimal Review

CSI 333 Lecture 1 Number Systems

Base Conversion written by Cathy Saxton

Section 1.4 Place Value Systems of Numeration in Other Bases

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

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

Decimal to Binary Conversion

3. Convert a number from one number system to another

Lecture 11: Number Systems

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

Chapter 2. Binary Values and Number Systems

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

Binary, Hexadecimal, Octal, and BCD Numbers

Positional Numbering System

NUMBER SYSTEMS. 1.1 Introduction

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

=

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

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

COMPSCI 210. Binary Fractions. Agenda & Reading

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

Binary Numbers. Binary Octal Hexadecimal

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

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

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

NUMBER SYSTEMS. William Stallings

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

Number Systems and Radix Conversion

Counting in base 10, 2 and 16

CPEN Digital Logic Design Binary Systems

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

Activity 1: Using base ten blocks to model operations on decimals

Chapter 4: Computer Codes

Binary Representation

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

YOU MUST BE ABLE TO DO THE FOLLOWING PROBLEMS WITHOUT A CALCULATOR!

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

THE BINARY NUMBER SYSTEM

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

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

Unsigned Conversions from Decimal or to Decimal and other Number Systems

FRACTIONS COMMON MISTAKES

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

2.3 IPv4 Address Subnetting Part 2

Systems I: Computer Organization and Architecture

Activity 6.7.4: IPv4 Address Subnetting Part 2

Exponents, Radicals, and Scientific Notation

Preliminary Mathematics

CS201: Architecture and Assembly Language

Number of bits needed to address hosts 8

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

Creating a Gradebook in Excel

CS321. Introduction to Numerical Methods

5.4 Solving Percent Problems Using the Percent Equation

Binary Adders: Half Adders and Full Adders

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Memory Management Simulation Interactive Lab

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.

Math Circle Beginners Group October 18, 2015

Subnetting Study Guide

The use of binary codes to represent characters

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

Math Workshop October 2010 Fractions and Repeating Decimals

Number and codes in digital systems

Decimals Adding and Subtracting

Number Systems. Introduction / Number Systems

PREPARATION FOR MATH TESTING at CityLab Academy

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Decimal Notations for Fractions Number and Operations Fractions /4.NF

Making and Editing Screenshots in PowerPoint 2010

Web Instructions To Get You Started

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

The Crescent Primary School Calculation Policy

Lecture 2. Binary and Hexadecimal Numbers

DIVISION OF DECIMALS We then we multiply by the

Chapter 5. Binary, octal and hexadecimal numbers

HOMEWORK # 2 SOLUTIO

FreeConference SharePlus TM. Desktop Sharing User Guide. SharePlus TM Desktop Sharing User Guide

Definition 8.1 Two inequalities are equivalent if they have the same solution set. Add or Subtract the same value on both sides of the inequality.

4.3 TABLE 3 TABLE five

How to Set-Up your Pay Pal Account and Collect Dues On-Line

Getting Started on the Computer With Mouseaerobics! Windows XP

INTRODUCTION TO FRACTIONS

Chapter 1: Order of Operations, Fractions & Percents

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

Cyber Security Workshop Encryption Reference Manual

Radicals - Multiply and Divide Radicals

Decimals and other fractions

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

Paramedic Program Pre-Admission Mathematics Test Study Guide

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

Adobe Acrobat Professional DC Tutorial

Mimeo Printer User Guide

WHAT YOU OWN HOME INVENTORY SOFTWARE

JobTestPrep's Numeracy Review Decimals & Percentages

BINARY CODED DECIMAL: B.C.D.

Seriously Simple Sums! Vedic Maths Free Tutorial. Maths Tips and Tricks to Improve Your Math Abilities

This explains why the mixed number equivalent to 7/3 is 2 + 1/3, also written 2

Microsoft Office via Office 365 Subscription Download/Install Instructions and Frequently Asked Questions

Transcription:

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal) and converting between them. This lab can be printed out directly or downloaded and printed. Click here for a printable PDF version of the lab. You can write your responses directly on the printed sheet. To print this sheet directly: make sure you have a printer available on your machine or network. In the browser, drag down the File menu and click on print. To download, drag down your browser s File menu and select Save as Then save the file with whatever name you wish to your machine. You can then print the file. Note on formatting used below: x 2 ^ 2 equals times 2 raised to 2. The notation *2**2 is the same thing. You might see this in a computer language. In the spirit of being well-rounded both will be used here. First, a quick review of how to do number conversions. Decimal: base ( 2 3 4 5 6 7 8 9) Binary: base 2 ( ) Octal: base 8 ( 2 3 4 5 6 7) Hexadecimal: base 6 ( 2 3 4 5 6 7 8 9 A B C D E F) Our handy basic number conversion table: Base base 2 base 8 base 6 Decimal binary octal hex(adecimal) 2 2 2 (base 2 is at 2 digits already) 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 (base 8 just went to 2 digits) 9 9 ------------------------------------------------------------ (base goes to two digits) 2 A 3 B 2 4 C 3 5 D 4 6 E 5 7 F (beyond this base 6 goes to 2 digits) Let s look at the value of digit at PLACE given the four numbering systems:

POWER (place) 4 3 2 Base Base 2 6 8 4 2 Base 8 496 52 64 8 Base 6 65536 496 256 6 For example: POWER (place) 4 3 2 Final result in Decimal Base of Base 2 of Base 8 of Base 6 o x ^ 4, x 2 ^ 4 6 x 8 ^ 4 496 x 6 ^ 4 65536 x ^ 3 x 2 ^ 3 x 8 ^ 3 x 6 ^ 3 x ^ 2 x 2 ^ 2 x 8 ^ 2 x 6 ^ 2 x ^ x 2 ^ x 8 ^ x 6 ^ x ^ x x 2 ^ x x 8 ^ x x 6 ^ x + + + + 6 + + + + 7 496 + + + + 497 65536 + + + + 65537 Going from binary/octal/hexadecimal to decimal: An easy way to remember it: take the number and raise the base to the place binary to decimal example *2**2 + *2** + *2** 4 + + 5 That s times the base (of 2) raised to the place (2) PLUS times the base (again, 2) raised to the place () PLUS times the base (still 2) raised to the place () octal to decimal example 5 *8** + 5*8** 8 + 5 3 That s times the base (of 8) raised to the place () PLUS 5 times the base (again, 8) raised to the place () hex to decimal examples *6** + *6** 6

That s times the base (of 6) raised to the place () PLUS times the base (yup, 6) raised to the place (). A *6** + *6** 26 That s times the base (of 6) raised to the place () PLUS (A is in decimal) times the base (of 6) raised to the place (). With hex you have to remember what the decimal equivalent of the numbers are using our handy chart above. Going from Decimal to Binary (and octal and hex) One way is to work with the remainder continually dividing the initial number and then resulting numbers by the base until it cannot be divided without fractions. Then take the remainders, beginning with the first one produced, and write them out from right to left. Example of decimal to binary: Take the decimal number to convert to binary. The decimal number is divided by the base (2) to find the quotient and remainder. The number / 2 5 with remainder of The number 5 / 2 25 with remainder of The number 25 / 2 2 with remainder of The number 2 / 2 6 with remainder of The number 6 / 2 3 with remainder of The number 3 / 2 with remainder of The number / 2 with remainder of Now from the top take the remainders and write from right to left (or from the bottom up and write left to right). That gives us the binary number: Example of decimal to octal: Take the decimal number to convert to octal. The decimal number is divided by the base (8) to find the quotient and remainder. The number / 8 2 with remainder of 4 The number 2 / 8 with remainder of 4 The number / 8 with remainder of Now from the top take the remainders and write right to left. That gives us the octal number: 44 Another easy way for smaller numbers is using the place table. We know for each place in base 2 we are multiplying by two. We have: PLACE 6 5 4 3 2

Decimal Equivalent if present Total of all these numbers added together 27 Binary equivalent (a 6 digit binary number) 64 32 6 8 4 2 64 32 6 8 4 2 So, for example, how would you represent 45 decimal in binary? PLACE 6 5 4 3 2 Decimal 64 32 6 8 4 2 Equivalent if present 45 these 32 8 4 numbers added together Binary equivalent, Binary: So, ever wonder why everything in computers is 6, 32, 64, 28, 256, 52, etc? Now it should be making a lot more sense. The computer, of course, is using binary numbers. Going from binary to octal/hex and back (recall our basic conversion table) Base base 2 base 8 base 6 Decimal binary octal hex(adecimal) 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 9 9 ----------------------------------------------------------------- 2 A 3 B

2 4 C 3 5 D 4 6 E 5 7 F Octal is every three bits starting from right-most digit. Example: (grouping the digits three at a time from the right-most digit) NOW, simply find the octal value for each grouping of three in order from left and that is the final result BINARY OCTAL 2 2 3 223 you can do the same thing going backwards to binary. Hex works the same way. But, it is every 4 bits starting from right-most digit. Example: BINARY OCTAL 9 3 93 Questions Ok, time for you to do a little work. Use the number conversion program to check your answers. You must show your work.. Take the following decimal numbers and convert them to binary, octal and hexadecimal: 2 35 27 245 768 2. Take the following binary numbers and convert to octal, hex, and decimal: 3. Take the following octal numbers and convert to binary and hex: 77

35 2 467 4. Take the following hex numbers and convert to binary and octal: F FE A23 AB2C3