Lecture 13

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mbers 0101 + 0010 = 1- 0110 2- 0111 3- 1001 4- 1010 Add the Binary Numbers Add the Binary Numbers 0101 + 0010 = 1- 0110 2- 0111 3- 1001 4- 1010 Add the Binary Numbers Add the Binary Numbers 0101 + 0101 = 1- 0110 2- 0111 3- 1001 4- 1010 Add the Binary Numbers Add the Binary Numbers 0101 + 0101 = 1- 0110 2- 0111 3- 1001 4- 1010 News Flash! Choose your own topics! Use those laptops List and vote: 1. 2. 3. Overflow in Binary Addition Overflow in Binary Addition Typically we are limited to representing a number by a certain number of binary digits. Let’s say we are using 4 bits and want to add 1110 and 0010 The answer is 10000, but we only have 4 bits so the extra 1 is lost and we reset to 0000 This is like the odometer on your car. Such overflow can lead to funny unexpected results. Subtracting Binary Numbers Subtracting Binary Numbers 0 1 1 0 0 ­ 0 0 1 1 0 0 Again we subtract column by column Subtracting Binary Numbers Subtracting Binary Numbers 0 0 1 1 10 0 ­ 0 0 1 1 0 0 But we may have to carry like we would in decimal subtraction. Subtracting Binary Numbers Subtracting Binary Numbers 0 0 1 1 2 0 ­ 0 0 1 1 0 0 But we may have to carry much as we would in decimal subtraction. Subtracting Binary Numbers Subtracting Binary Numbers 0 0 1 1 2 0 ­ 0 0 1 1 0 1 0 But we may have to carry much as we would in decimal subtraction. Subtracting Binary Numbers Subtracting Binary Numbers 0 2 0 1 1 2 0 ­ 0 0 1 1 0 1 1 0 But we may have to carry much as we would in decimal subtraction. Subtracting Binary Numbers Subtracting Binary Numbers 0 2 0 1 1 2 0 ­ 0 0 1 1 0 0 0 1 1 0 But we may have to carry much as we would in decimal subtraction. Subtract the Binary Numbers Subtract the Binary Numbers 0101 – 0010 = 1- 0010 2- 0011 3- 0110 4- 1001 Subtract the Binary Numbers Subtract the Binary Numbers 0101 – 0010 = 02 0101 0010 0011 1- 0010 2- 0011 3- 0110 4- 1001 Subtract the...
View Full Document

This note was uploaded on 03/12/2010 for the course ENGIN 101 taught by Professor Jeffringenberg during the Fall '07 term at University of Michigan.

Ask a homework question - tutors are online