Binary Arithmetic.

Slides:



Advertisements
Similar presentations
“Working with Fractions” A Review of Addition and Subtraction CLICK HERE TO BEGIN.
Advertisements

Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Chapter 4.2 Binary numbers: Arithmetic
Mathematics with Binary. Question  Below is a binary string  Which is the least significant bit (LSB)?  Which is the most significant bit (MSB)? 0.
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Multiplication by multiples of 10 and 100 Objective to multiply numbers when 0’s are involved.
Use effective written methods to add whole numbers.
Binary Arithmetic In today’s lesson we will look at: a reminder of how binary works adding binary numbers overflow complements negative numbers and subtraction.
Chapter 4: Representation of data in computer systems: Number OCR Computing for GCSE © Hodder Education 2011.
Positional Number Systems
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Operations on Bits Arithmetic Operations Logic Operations
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Two’s Complement. A system used to represent a negative number in binary A system used to represent a negative number in binary Positive numbers start.
GCSE Computing: A451 Computer Systems & Programming Numbers Representation of Data in Computer Systems.
1 4. Computer Maths and Logic 4.1 Number Systems.
2’s Complement Another system that lets us represent negative numbers
Steps of Addition Move your mouse over each step to see the directions.
With Two-Digit Numbers. 1a. Multiply one’s column x 1 1 * 1 = 1.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Lesson Objectives Aims You should know about: Binary numbers ‘n’ that.
Unit 1 Introduction Number Systems and Conversion.
Binary & Decimal numbers
Binary, Denary, Hexadecimal Conversion Binary Addition
Binary and Hexadecimal
Binary -ve and +ve numbers!.
Factor the following completely:
Recap Add these numbers together in binary
Lesson Objectives Aims
Binary numbers: Week 7 Lesson 1
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
COMPUTING FUNDAMENTALS
Multiply By Two Digits Created by M. Guy.
Introduction to Programming Part 3
Knowing your math operation terms
2 Digit by 2 Digit Multiplication
Lesson objectives Understand how computers represent and manipulate numbers [unsigned integers, signed integers (sign and magnitude, Two’s complement)
Multiply Decimals L-2 6.NS.3.
How to Multiply By Two Digits
Factor the following completely:
Exercise: Add these two single precision IEEE 754 numbers: … …0 Left number: 1.101x24 Right number: 1.011x 22= x24.
Addition and Substraction
Lesson Objectives Aims You should be able to: Convert Denary to Binary
Topic 3: Data Binary Arithmetic.
King Fahd University of Petroleum and Minerals
Teaching Computing to GCSE
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.
Topic 3: Data Signed Binary.
Fundamentals of Data Representation
Teaching Computing to GCSE
Fundamentals of Data Representation
Unit 18: Computational Thinking
Binary “There are 10 types of people in the world: Those who understand binary, and those who don't.”
Objective 1.02 Understand Numbering Systems
Integer Review.
Binary  Name: Class: .
Introduction to Programming Part 3
Adding Integers Chp 2.2.
Hexadecimal.
Binary It’s all 0’s and 1’s.
Data Binary Arithmetic.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers.
To be able to multiply a number by 10, 100 and 1000
Chapter3 Fixed Point Representation
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Theory: 2.6 – Data Representation
Two’s Complement & Binary Arithmetic
Presentation transcript:

Binary Arithmetic

Learning Objectives 3.1.4 Be able to perform binary arithmetic [add, subtract, multiply] and understand the concept of overflow

Addition… 26 + 36 = 62… why? Remember that the position of the number is related to it’s value, so a carry in denary is worth 10 units. It’s the same in binary – remember the position relates to it’s value! 10’s 1’s 2 6 3 2+3+1 = 6 6+6 = 1 ten 2 units Carry 1 ten

Binary Addition Lets’ try 101 + 101 = 8’s 4’s 2’s 1’s 1 2+0+0 = 1 lot of 2 Carry 1 lot of 8 4+4 = 8 Carry 1 lot of 2 1+1 = 2

Some more examples - Try the following – 0101+0100 = 0111+0001 = 0101+0010 = 1010+0010 = This might cause a problem… 1111+0001 = 1001 1000 0111 1100 10000

Overflow! That’s what happens when “you run out of bits” If you try to store a number that is larger than the number of bits you have, you create an Overflow error. These are bad! Normally the result is treated as a negative!

Binary subtraction. Computers can only ADD… …well that’s a problem. What about … 5 + -3 = 2? We can work with that!

Subtraction…in binary Lets try 0101 – 0011 5 – 3 We know the answer should be 2. We need the Two’s compliment for -3. Flip all the bits 1100 Add 1 to answer 1101 8’s 4’s 2’s 1’s 1 IGNORE ANY CARRY!

Some more examples… Try these – 8 - 7 = 12 – 4 = 5 – 5 = 7 – 3 = 7 – 3 = 6 – 2 =

And finally – Multiplication. How have you been taught to multiply numbers together? For example 5 * 11 = 55? How did you work it out? Show method on board Now try 18 * 36 = … 648

What ever your method…try this https://youtu.be/ZS4Ql5vQbRY

Remember why you move over! Remember when you move over a column in DENARY it’s because the number is 10 times greater! When we do the same in binary it’s because it is TWICE as large!

https://youtu.be/ZS4Ql5vQbRY Watch this example… Be ready to talk about it afterwards! https://youtu.be/ZS4Ql5vQbRY

3 x 5 = 15. 16 8 4 2 1 1 1 1 1 1 1 1 1 Start using the method we have seen. From the right. Remember we are multiplying 2 x 1 when we move columns. So the answer has to be stored in the 2 column! Add up everything. We move over to the 2’s. 0 x anything is always 0. We have now finished with the least significant bit of 5. the 1’s. We have now finished with the 2’s. We move to the 4’s 4 x 1 = 4 4 x 2 = 8

Examples.. Now try these… 2 x 4 = 0010 * 0100 = 3 x 8 = 0011 * 1000 =

Plenary HOW do you add 2 binary numbers together? What is overflow? Can you get overflow when subtracting? HOW do you subtract one binary number from another? HOW do you multiply 2 numbers together?