The. Binary. Number System

Similar documents
Chapter 4 Section 2 Operations on Decimals

CHW 261: Logic Design

Octal & Hexadecimal Number Systems. Digital Electronics

THE LOGIC OF COMPOUND STATEMENTS

HOW TO DIVIDE: MCC6.NS.2 Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Example 2: Simplify each of the following. Round your answer to the nearest hundredth. a

Number Systems CHAPTER Positional Number Systems

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

Objectives. Connecting with Computer Science 2

Digital Fundamentals

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

Number representations

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

Bits. Binary Digits. 0 or 1

Adding and Subtracting with Decimals

CMPE223/CMSE222 Digital Logic Design. Positional representation

CHAPTER 2 Number Systems

Introduction to Computers and Programming. Numeric Values

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

COUNTING AND CONVERTING

MATH LEVEL 2 LESSON PLAN 5 DECIMAL FRACTIONS Copyright Vinay Agarwala, Checked: 1/22/18

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Lesson 1: THE DECIMAL SYSTEM

Beyond Base 10: Non-decimal Based Number Systems

Divide: Paper & Pencil

Korea University of Technology and Education

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Introduction to Numbering Systems

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Outline. What Digit? => Number System. Decimal (base 10) Significant Digits. Lect 03 Number System, Gates, Boolean Algebra. CS221: Digital Design

COMP Overview of Tutorial #2

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number System. Introduction. Decimal Numbers

Place Value. Verbal Form: 30,542 = Thirty thousand, five hundred forty-two. (Notice we don t use the word and.)

Chapter 1 Review of Number Systems

Digital Systems and Binary Numbers

Lecture 1: Digital Systems and Number Systems

Beyond Base 10: Non-decimal Based Number Systems

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

The type of all data used in a C (or C++) program must be specified

MATH 104B OCTAL, BINARY, AND HEXADECIMALS NUMBERS

1.- DECIMAL PLACE VALUE: tenths, hundredths, thousandths. 1.1 Ordering decimals. 1.2 Rounding CALCULATIONS. 2.- ADDITION AND SUBTRACTION OF DECIMALS

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Number Systems. Both numbers are positive

KNOWLEDGE OF NUMBER SENSE, CONCEPTS, AND OPERATIONS

Math 6 Notes Unit 03 Notes: Decimals

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

Module 2: Computer Arithmetic

Exponential Numbers ID1050 Quantitative & Qualitative Reasoning

Chapter Binary Representation of Numbers

The type of all data used in a C++ program must be specified

World Inside a Computer is Binary

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

CS & IT Conversions. Magnitude 10,000 1,

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Fraction to Percents Change the fraction to a decimal (see above) and then change the decimal to a percent (see above).

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

Math Glossary Numbers and Arithmetic

Decimals Outcomes. Represent Q Using Decomposition

CS101 Lecture 04: Binary Arithmetic

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

MS RtI Tier 3. Curriculum (107 topics + 91 additional topics)

Chapter 2: Number Systems

1.1 Review of Place Value

Level ISA3: Information Representation

Lecture (01) Introduction Number Systems and Conversion (1)

Common Core State Standards Mathematics (Subset K-5 Counting and Cardinality, Operations and Algebraic Thinking, Number and Operations in Base 10)

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

6. Binary and Hexadecimal

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

50 MATHCOUNTS LECTURES (6) OPERATIONS WITH DECIMALS

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Chapter 1 Emad Felemban

6th Grade Arithmetic (with QuickTables)

D I G I T A L C I R C U I T S E E

I can statements for NBT 1-7 1st attempt 2nd attempt mastered

Octal and Hexadecimal Integers

Divisibility Rules and Their Explanations

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Place Value and Operations with Whole Numbers

Basic Arithmetic Operations

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

Signed umbers. Sign/Magnitude otation

Chapter 5: Computer Arithmetic

Lesson Plan. Preparation

FUNDAMENTAL ARITHMETIC

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

Decimals. Chapter Five

FIFTH GRADE Mathematics Curriculum Map Unit 1

SECTION 3. ROUNDING, ESTIMATING, AND USING A CALCULATOR

Electronic Data and Instructions

Math 171 Proficiency Packet on Integers

Gateway Regional School District VERTICAL ALIGNMENT OF MATHEMATICS STANDARDS Grades 3-6

Transcription:

The Binary Number System

Why is Binary important? Everything on a computer (or other digital device) is represented by Binary Numbers

One to Five in various systems 1 2 3 4 5 I II III IV V 1 10 11 100 101

Decimal System Deci means Ten Base Ten System Ten symbols: 0 1 2 3 4 5 6 7 8 9

Decimal System Example: a decimal number 2 3 0 3 8

Decimal System Digits occupy Places 2 3 0 3 8

Decimal System The places have names 2 3 0 3 8 Ten- Thousand s Thousand s Hundred s Ten s One s

Decimal System Place names as numbers 2 3 0 3 8 10,000 1,000 100 10 1 (See a pattern in the place names?)

Decimal System Place determines the meaning of a digit 2 3 0 3 8 10,000 1,000 100 10 1 3 means three thousand 3 means three tens

Decimal System Place names as exponents of 10 2 3 0 3 8 10 4 10 3 10 2 10 1 10 0 (See a pattern in the place names?)

Bi means Two Base Two System Two symbols: 0 1 Understanding the Decimal system, replace Ten with Two

Place names as exponents of 2 2 4 2 3 2 2 2 1 2 0

Place names expressed in decimal numbers 16 8 4 2 1

Place names expressed in English Sixteen s Eight s Four s Two s One s

Interpreting the bits 1 0 0 1 0 16 8 4 2 1 Where there is a 1: add the place name Where there is a 0: DON T add

Interpreting the bits 1 0 0 1 0 16 8 4 2 1 16 + 2 = EIGHTEEN (18 in decimal)!

Conversion Shortcut: know the pattern! 1.Start with 1 as the right-most digit 2.Multiply by 2 each time, right to left: 1 2 1 4 2 1 8 4 2 1 16 8 4 2 2 32 16 8 4 2 1 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1

Converting Binary to Decimal Example: Convert 10011101 to Decimal: Write the pattern beneath each digit: 1 0 0 1 1 1 0 1 128 64 32 16 8 4 2 1 Add the pattern number where there is a 1: 128 + 16 + 8 + 4 + 1 = 157

Converting Decimal to Binary: Official Method Repeatedly divide by 2 recording the remainders (1 or 0) until the Dividend is 0. The answer is the list of remainders, last to first.

Converting Decimal to Binary: Official Method Example: convert 87 to Binary Dividend Answer: 1 0 1 0 1 1 1 Quotient Remainder 87 43 1 <-- right-most 43 21 1 21 10 1 10 5 0 5 2 1 2 1 0 1 0 1 <-- left-most

Converting Decimal to Binary: Official Method

Converting Decimal to Binary: Other Method 1. Let LeftOver = the number to convert 2. Write the pattern, right to left, until the place number is greater than LeftOver. Discard that digit. 3. Repeat left to right, for each bit: - If LeftOver >= place number: o Write 1 in the bit o Subtract the place number from LeftOver - If LeftOver < place number: o Write 0 in the bit

Converting Decimal to Binary: Other Method Example: Convert 87 to Binary Step 1: Let LeftOver = 87 Step 2: we don t need bit 128 (because 87 < 128), so start with bit 64 XX 64 32 16 8 4 2 1

Converting Decimal to Binary: Other Method Is 87 >= 64? Yes 1 64 32 16 8 4 2 1 LeftOver = 87 64 = 23 Is 23 >= 32? No 1 0 64 32 16 8 4 2 1 LeftOver left at 23

Is 23 >= 16? Yes 1 0 1 64 32 16 8 4 2 1 LeftOver = 23 16 = 7 Is 7 >= 8? No 1 0 1 0 64 32 16 8 4 2 1 LeftOver left at 7 Is 7 >= 4? Yes 1 0 1 0 1 64 32 16 8 4 2 1 LeftOver = 7 4 = 3

Is 3 >= 2? Yes 1 0 1 0 1 1 64 32 16 8 4 2 1 LeftOver = 3 2 = 1 Is 1 >= 1? Yes 1 0 1 0 1 1 1 64 32 16 8 4 2 1 LeftOver = 1 1 = 0 Answer: 1010111

Converting Decimal to Binary: Padding Sometimes a problem may state give the answer in a certain number of bits usually 4,8,16, etc. bits. If your answer contains less than the required number, simply add zeros on the left. Just as, in decimal, 48 = 0048, in Binary 1101 = 00001101

Addition: Adding 2 binary numbers Once again, it works similar to decimal - Starting on the right, going right to left: - Add the two digits (plus the carry if there is one) - Write the one digit result, or - If there is a two digit result, write down the right digit and carry the 1.

Addition: Adding 2 binary numbers Decimal Example: 192 + 889 1 1 1 1 1 1 9 2 1 9 2 1 9 2 + 8 8 9_ + 8 8 9_ + 8 8 9_ 1 8 1 1 0 8 1

Addition: Adding 2 binary numbers Adding in binary is even easier, since for any column, the highest sum is three (carry bits in red): 1 0 0 1 1 + _0 + _1 +_1 +_ 1 0 1 1 0 1 1

Addition: Adding 2 binary numbers Example: 1100 + 1110 (12 + 14 = 26) 1 1 0 0 + 1_1 1 0_ 0 1 1 0 0 + 1_1 1 0_ 1 0 1 1 1 0 0 + 1 _1 1 0_ 0 1 0 1 1 1 0 0 + 1 _1 1 0_ 1 1 0 1 0

Fractions Fractions in binary work as expected, following the pattern of how the Decimal system works the exponent on the base number is subtracted by 1 for each digit to the right. 0 0 4. 8 7 5 10 2 10 1 10 0. 10-1 10-2 10-3 100 10 1. _1_ 10 _1_ 100 _1_ 1000 100 10 1..1.01.001

Fractions 1 0 0. 1 1 1 2 2 2 1 2 0. 2-1 2-2 2-3 4 2 1. _1_ 2 _1_ 4 _1_ 8 4 2 1. 0.5 0.25 0.125 Convert 100.111: 4 + 0.5 + 0.25 + 0.125 = 4.875 Note: the point is called a radix point rather than a decimal point

Summary - for the test: - Know how to convert Binary to Decimal maximum 8 bit integer maximum 2 bits past the radix point - Know how to convert Decimal to Binary integers 0 to 255 fractions of.00,.25,.50, and.75 only - Know how to add two Binary integers - Vocabulary: Radix Point