Binary Numbers. Binary Octal Hexadecimal



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

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

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

Number and codes in digital systems

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

Computer Science 281 Binary and Hexadecimal Review

CPEN Digital Logic Design Binary Systems

CSI 333 Lecture 1 Number Systems

Chapter 2. Binary Values and Number Systems

NUMBER SYSTEMS. 1.1 Introduction

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

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

Lecture 2. Binary and Hexadecimal Numbers

Base Conversion written by Cathy Saxton

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

Useful Number Systems

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

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

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

Section 1.4 Place Value Systems of Numeration in Other Bases

Solution for Homework 2

Lecture 11: Number Systems

3. Convert a number from one number system to another

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

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

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

=

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

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

Binary Adders: Half Adders and Full Adders

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.

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

COMPSCI 210. Binary Fractions. Agenda & Reading

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

Numbering Systems. InThisAppendix...

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

Decimal to Binary Conversion

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

Chapter 4: Computer Codes

Chapter 1: Digital Systems and Binary Numbers

Systems I: Computer Organization and Architecture

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

Binary Representation

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

Number Systems. Introduction / Number Systems

Classless Subnetting Explained

MEP Y9 Practice Book A

Number Systems and Radix Conversion

THE BINARY NUMBER SYSTEM

Counting in base 10, 2 and 16

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Upon completion of unit 1.1, students will be able to

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

Unsigned Conversions from Decimal or to Decimal and other Number Systems

Number Representation

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

Binary, Hexadecimal, Octal, and BCD Numbers

2.3 IPv4 Address Subnetting Part 2

Verilog - Representation of Number Literals

Lecture 8: Binary Multiplication & Division

Scientific Notation. Section 7-1 Part 2

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

A Step towards an Easy Interconversion of Various Number Systems

Z80 Instruction Set. Z80 Assembly Language

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

CS201: Architecture and Assembly Language

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

Lecture N -1- PHYS Microcontrollers

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Positional Numbering System

COMBINATIONAL CIRCUITS

Sistemas Digitais I LESI - 2º ano

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

FX 115 MS Training guide. FX 115 MS Calculator. Applicable activities. Quick Reference Guide (inside the calculator cover)

HOMEWORK # 2 SOLUTIO

Teaching Pre-Algebra in PowerPoint

NUMBER SYSTEMS. William Stallings

Activity 6.7.4: IPv4 Address Subnetting Part 2

Copyright 2012 Pearson Education, Inc. Chapter 1 INTRODUCTION TO COMPUTING AND ENGINEERING PROBLEM SOLVING

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

Digital Electronics Detailed Outline

Basic Use of the TI-84 Plus

Two's Complement Adder/Subtractor Lab L03

Number of bits needed to address hosts 8

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

Cyber Security Workshop Encryption Reference Manual

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers.

Mathematics. What to expect Resources Study Strategies Helpful Preparation Tips Problem Solving Strategies and Hints Test taking strategies

Session 29 Scientific Notation and Laws of Exponents. If you have ever taken a Chemistry class, you may have encountered the following numbers:

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Modbus RTU Communications RX/WX and MRX/MWX

SCIENTIFIC CALCULATOR OPERATION GUIDE. <Write View>

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

BINARY CODED DECIMAL: B.C.D.

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

CS321. Introduction to Numerical Methods

Technical Support Bulletin Nr.18 Modbus Tips

ECE 0142 Computer Organization. Lecture 3 Floating Point Representations

Transcription:

Binary Numbers Binary Octal Hexadecimal

Binary Numbers COUNTING SYSTEMS UNLIMITED... Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how it is possible to count and do arithmetic without using all 10. Actually, there is no advantage in using 10 counting digits rather than, say, 8, 12, or 16. The 10-digit system (called the decimal system, since the word "decimal" means "based on 10") probably came into universal use because man first started to count by using his fingers, and there happen to be 10 of them. To see how to count by using other than 10 digits, notice how we count in the ordinary decimal system. We represent a number higher than 9, the highest digit, by a combination of two or more digits. The number next after 9 is 10, and then 11, etc. After we reach 99, the highest number that can be written with two digits, we start using three digits. The number next after 99 is 100, and then comes 101, etc. Now let's try counting in the octal system. "Octal" means "based on eight " ; that is, we use only the eight digits 0, 1, 2, 3, 4, 5, 6, and 7. The digits 8 and 9 are not used. So now what do we do after we have counted to 7? Since we have used up all the symbols we are permitted to use, we write 10 as the next number and then comes 11 and so on up to 17. After 17 comes 20.

Decimal Octal 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 20 17 21 18 22 19 23

Binary Numbers THE NATURAL BINARY SYSTEM... Now that you have seen how it is possible to count in numbering systems other than the decimal system, we shall consider the system of most interest in electronics. That is the binary system, which uses only the two digits 0 and 1. We can count in the binary system by using the plan explained in the preceding topic for counting in other systems. The first number in counting is 1, of course. Since we can use no digit higher than 1, we must go to two digits and write 10 for the second binary number. Then comes 11, and after that we must go to three digits and write 100. Binary numbers as written in the table form the natural binary numbering system. It is called natural because it follows the general counting method used in the decimal, octal, and other numbering systems. As you will see later in the lesson, the natural binary system is only one of a number of methods for representing numbers by using only the digits 0 and 1.

Decimal Octal 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 10 1000 9 11 1001 10 12 1010 11 13 1011 12 14 1100 13 15 1101 14 16 1110 15 17 1111 16 20 10000 17 21 10001 18 22 10010 19 23 10011

Binary Numbers CONVERSION BETWEEN OCTAL AND BINARY SYSTEMS... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into octal numbers, it is practical to write or machine print out natural binary numbers as octal numbers for ease in handling. A couple of examples will show you how the conversions are made. EXAMPLE... Convert binary number 1011010 to the octal equivalent. SOLUTION... The first step is to rewrite the number with the digits grouped in threes: 001 011 010 Note that two zeros were placed in front of the first digit 1 in order to make every group complete. Next, write the decimal equivalent over each group of three: 1 3 2 001 011 010 The octal equivalent of binary 1011010 is 132.

Binary Numbers The hexadecimal system, or Hex, uses base 16, therefore there are 16 possible digit symbols. The hexadecimal system groups binary number by 4 s and from 0 to 9 it is the same as a decimal number equivalent in binary form. This means 0000 is 0, 0001 is 1, 0010 is 2 and so on to 1001 being 9, but then from 1010 to 1111 of binary the hexadecimal uses letters from A to F and then when it reaches the value of 16 it becomes 10 because the two groups of four binary numbers are 0001 0000. When taken as a binary number it is 0001 0000 while the decimal number is 16 and the hexadecimal number is 10. Therefore an 8 bit binary number (byte) is divided into two groups of four bits each. The chart in the next slide shows all of this.

Decimal Octal Binary Hex 0 0 0000 0 1 1 0001 1 2 2 0010 2 3 3 0011 3 4 4 0100 4 5 5 0101 5 6 6 0110 6 7 7 0111 7 8 10 1000 8 9 11 1001 9 10 12 1010 A 11 13 1011 B 12 14 1100 C 13 15 1101 D 14 16 1110 E 15 17 1111 F 16 20 0001 0000 10 17 21 0001 0001 11 18 22 0001 0010 12 19 23 0001 0011 13

Binary Numbers CONVERSION BETWEEN HEXADECIMAL AND BINARY SYSTEMS... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into hexadecimal numbers, it is practical to write or machine print out natural binary numbers as hexadecimal numbers for ease in handling. A couple of examples will show you how the conversions are made. EXAMPLE... Convert binary number 1011010 to the hexadecimal equivalent. SOLUTION... The first step is to rewrite the number with the digits grouped in fours: 0101 1010 Note the zero were placed in front of the first digit 1 in order to make the two groups complete. Next, write the decimal equivalent over each group: 5 A 0101 1010 The hexadecimal equivalent of binary 1011010 is 5A.

Binary Addition Conceptually similar to decimal addition Example: Add the binary numbers 1010 and 11 (carry) 1 1 0 1 0 + 1 1 1 1 0 1

Binary Subtraction Example: Subtract binary number 101 from 1011 (borrow) 0 1 1 0 1 1-1 0 1 0 1 1 0

2s Complement Notation 2s complement representation - widely used in microprocessors. Represents sign and magnitude MSB LSB Sign bit (0 = + ; 1 = -) Decimal: +7 +4 +1 0-1 -4-7 2s Complement: 0111 0100 0001 0000 1111 1100 1001

2s Complement - Conversions Converting positive numbers to 2s complement: Same as converting to binary Converting negative numbers to 2s complement: Decimal to 2s Complement - 4 (decimal) 0 1 0 0 1 0 1 1 Convert decimal to binary 1s complement Add 1-4 = 1 1 0 0 (2s Complement) 2s Complement to Binary 1 1 0 0 (2s C) 0 0 1 1 0 1 0 0 (Binary) 1s complement Add 1

Adding/Subtracting in 2s Complement 2s complement notation makes it possible to add and subtract signed numbers (Decimal) (- 1) + (- 2) (- 3) (+1) + (- 3) (- 2) Discard 2s Complement 1 1 1 1 + 1 1 1 0 1 1 1 0 1 0 0 0 1 + 1 1 0 1 1 1 1 0 2s complement 2s complement

Practical Suggestion for Binary Math Use a scientific calculator. Most scientific calculators have DEC, BIN, OCT, and HEX modes and can either convert between codes or perform arithmetic in different number systems. Most scientific calculators also have other functions that are valuable in digital electronics such as AND, OR, NOT, XOR, and XNOR logic functions.