Chapter 4.2 Binary numbers: Arithmetic

Slides:



Advertisements
Similar presentations
Intro to CS – Honors I Representing Numbers GEORGIOS PORTOKALIDIS
Advertisements

John Owen, Rockport Fulton HS
DATA REPRESENTATION CONVERSION.
Information Processing Session 5B Binary Arithmetic Slide
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Binary Numbers.
Binary Numbers 1.Binary and Denary RecapBinary.
Long multiplication Long division
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
© GCSE Computing Candidates should be able to:  convert positive denary whole numbers (0-255) into 8-bit binary numbers and vice versa  add two 8-bit.
Binary and Hexadecimal Numbers
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
IT253: Computer Organization
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Lecture 2 Bits, Bytes & Number systems
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
BINARY 1. Number Systems Base 10 uses the numbers 0-9 Represents numbers as ones, tens, hundreds etc HundredsTensOnesSolution = =
Chapter 4: Representation of data in computer systems: Number OCR Computing for GCSE © Hodder Education 2011.
Number systems, Operations, and Codes
Binary Values and Number Systems
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Conversions Denary to Binary Method 1
Chapter 2 Number Systems: Decimal, Binary, and Hex.
THE BINARY SYSTEM.
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
Candidates should be able to:
A)Convert positive denary whole numbers (0-255) into 8-bit binary numbers and vice versa b)Add two 8-bit binary integers and explain overflow errors which.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Number Representation Lecture Topics How are numeric data items actually stored in computer memory? How much space (memory locations) is.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
 2012 Pearson Education, Inc. Slide Chapter 4 NumerationSystems.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
Conversions 1)Binary to Denary Method 1 Work out the position values of the binary bits and add those values together So above would be
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
Digital Design Chapter One Digital Systems and Binary Numbers
Binary, Denary, Hexadecimal Conversion Binary Addition
Binary and Hexadecimal
Different Numeral Systems
Discrete Mathematics Numbering System.
By: Jonathan O. Cabriana
Lesson Objectives Understand the hexadecimal numbering system
COMPUTING FUNDAMENTALS
Convert Decimal to Binary
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
Number Systems and Binary Arithmetic
Lesson Objectives To understand how to add 4 and 8 bit binary numbers together To understand what is meant by the term “Overflow” ALL students will add.
Numbering System TODAY AND TOMORROW 11th Edition
Data Hexadecimal.
Topic 3: Data Hexadecimal.
Digital Electronics and Microprocessors
AP Computer Science LESSON 1 on Number Bases.
Binary  Name: Class: .
Chapter Four Data Representation in Computers By Bezawit E.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.4 Hexadecimal Conversion.
Hexadecimal.
Data Binary Arithmetic.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers.
Presentation transcript:

Chapter 4.2 Binary numbers: Arithmetic OCR GCSE Computing Chapter 4.2 Binary numbers: Arithmetic OCR GCSE Computing © Hodder Education 2013 Slide 1

OCR GCSE Computing © Hodder Education 2013 Slide 2 Index to topics Denary and binary numbers Adding binary numbers Hexadecimal numbers OCR GCSE Computing © Hodder Education 2013 Slide 2

Chapter 4.2 Binary numbers Numbers can be expressed in many different ways. We usually use decimal or denary. Denary numbers are based on the number 10. We use ten digits: 0,1,2,3,4,5,6,7,8,9. When we put the digits together, each column is worth ten times the one to its right. OCR GCSE Computing © Hodder Education 2013 Slide 3

Chapter 4.2 Binary numbers So, the denary number 5162 is Place value 1000 100 10 1 Digit 5 6 2 5 x1000 = 5000 1 x 100 = +100 6 x 10 = +60 2 x 1 = +2 Total 5162 OCR GCSE Computing © Hodder Education 2013 Slide 4

Chapter 4.2 Binary numbers It is simpler to make machines that only need to distinguish two states, not ten. That is why computers use binary numbers. Each column is worth 2 times the value on its right: So 10010111 is: 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 +16 +4 +2 +1 =151 OCR GCSE Computing © Hodder Education 2013 Slide 5

Chapter 4.2 Binary numbers To convert from base 10 (denary) to base 2 (binary) simply divide by 2 repeatedly, recording the remainders until the answer is 0. To convert 135 from base 109 to binary: 135 ÷ 2 67 Remainder 1 33 16 8 4 2 The answer is the remainder column starting at the last value 1 OCR GCSE Computing © Hodder Education 2013 Slide 6

Chapter 4.2 Binary numbers The rules for binary addition: 0 + 0 = 0 0 + 1 = 1 1 + 1 = 0 carry 1 1 + 1 + 1 = 1 carry 1 Add the binary equivalents of denary 4 + 5. Denary Binary 4 1 + 5 = 9 Carry OCR GCSE Computing © Hodder Education 2013 Slide 7

Chapter 4.2 Binary numbers Sometimes we run into problems. Suppose we have eight bits in each location. When we add the binary equivalent of denary 150 + 145: There is no room for a carry so it is lost and we get the wrong answer, 39 instead of 295. When there isn’t enough room for a result, this is called overflow and produces an overflow error. Denary Binary 150 1 +145 = 39 (1) Carry OCR GCSE Computing © Hodder Education 2013 Slide 8

Chapter 4.2 Binary numbers Programmers often write numbers down in hexadecimal (hex) form. Hexadecimal numbers are based on the number 16. They have 16 different digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Each column is worth 16 times the one on its right. 256 16 1 OCR GCSE Computing © Hodder Education 2013 Slide 9

Chapter 4.2 Binary numbers We can convert denary numbers to hexadecimal by repeated division just as we did to get binary numbers. Take the denary number 141. We have the hexadecimal values 8 and 13 as remainders. 13 in hexadecimal is D. So, reading from the bottom again 141 in hexadecimal is 8D. 141 ÷ 16 = 8 Remainder 13 8 D OCR GCSE Computing © Hodder Education 2013 Slide 10

Chapter 4.2 Binary numbers To convert from hexadecimal to denary all we do is multiply the numbers by their place values and add them together. For example, the hexadecimal number 14F. 256 + 64 + 15 = 335 So, 14F is 335 in denary. Place value 256 16 1 Hex digits 4 F Denary =1*256 =4*16 =15*1 =256 64 15 OCR GCSE Computing © Hodder Education 2013 Slide 11

Chapter 4.2 Binary numbers To convert from binary to hexadecimal is straightforward. Simply take each group of four binary digits, (nibble) starting from the right and translate into the equivalent hex number. Binary 1 Hex F 3 OCR GCSE Computing © Hodder Education 2013 Slide 12

Chapter 4.2 Binary numbers To convert from hexadecimal to binary simply reverse the process, though you may prefer to go via denary. Treat each digit separately. So DB in hexadecimal is 11011011 in binary. Hex D B Denary 13 11 Binary 1 OCR GCSE Computing © Hodder Education 2013 Slide 13

Chapter 4.2 Binary numbers Large binary numbers are hard to remember Programmers use hexadecimal values because: each digit represents exactly 4 binary digits; hexadecimal is a useful shorthand for binary numbers; hexadecimal still uses a multiple of 2, making conversion easier whilst being easy to understand; converting between denary and binary is relatively complex; hexadecimal is much easier to remember and recognise than binary; this saves effort and reduces the chances of making a mistake. OCR GCSE Computing © Hodder Education 2013 Slide 14