Download presentation
Presentation is loading. Please wait.
1
Data Binary Arithmetic
2
Binary Addition The process of performing addition in binary is very similar to addition in denary. 1 + 1 + 1 + Rules: 0 - 0 + 1 = 1 1 + 1 = 0 carry 1 = 1 carry 1 Question: What is ? Complete tasks 4.1 and 4.2.
3
Overflow When there isn’t enough room for a result, this is called an overflow and it produces an overflow error. 1 + No room for a carry, so it is lost and we get the wrong answer. Humans can easily work around this, but it isn’t so easy for a computer.
4
Binary Subtraction The process of performing subtraction in binary is very similar to subtraction in denary. 1 - 10 1 - 1 - Rule: 0 - 1 won’t go so borrow 10 (2) from the column to the left = 1. Question: What is ? Complete tasks 4.3 and 4.4.
5
1 = minus 0 = plus Sign and Magnitude
This is the simplest method of representing negative numbers in binary. The most significant bit is the ‘sign bit’. 1 = minus = plus Sign bit 128 64 32 16 8 4 2 1 +27 -27 Question: Convert this sign and magnitude binary number to denary: 1111 Complete tasks 4.5 and 4.6.
6
The Problem with Sign and Magnitude
The problem with sign and magnitude is that addition doesn’t always work. 1 (+7) (-5) + (-12)
7
-128 + 8 + 4 + 1 = -115 Two’s Complement
Two’s complement is an alternative method of representing negative numbers. This method works with binary addition. The most significant bit is a minus number. -128 64 32 16 8 4 2 1 = -115 Question: Convert this sign and magnitude binary number to denary: 1101 Complete tasks 4.7 and 4.8.
8
Floating Point Numbers
In binary floating point numbers are split into two parts; the Mantissa and the Exponent. Mantissa Exponent The mantissa contains the actual number and the exponent defines the position of the binary point.
9
Floating Point Numbers
The numbers to the right of the binary point define the fraction. 1/ / /8 1/16 8/16 4/16 2/16 1/16 In denary the number above is: 7 ½ Complete task 4.9.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.