130 likes | 264 Views
Binary Arithmetic. Everything a computer does is based on mathematical equations But computers can only carry out simple functions So the equations have to worked out in terms of what the computer is capable of
E N D
Everything a computer does is based on mathematical equations • But computers can only carry out simple functions • So the equations have to worked out in terms of what the computer is capable of • Therefore very complicated functions are broken down into a step by step process by a program Why?
The program executes each step (instruction) • Solutions to even relatively simple problems can take many thousands of steps • But because the computer can execute millions of instructions per second the results seem almost instantaneous • Binary arithmetic is the beating heart of every computer system Binary Arithmetic
As in normal maths computer need to be able to work with negative numbers • Signed binary numbers have the MSB to indicate whether the number is positive or negative • Unsigned binary numbers are presumed to be positive • When the MSB = 1 then the number = negative • When the MSB = 0 th……………………… = positive Signed or unsigned
Operand = a number upon which an arithmetic function operates (e.g. x + y = z x,y are the operands) • Augend = the number in an addition operation to which another number is added • Addend = the number in and addition operation that is added to another • Sum = the result of an addition operation • Carry = A digit that is carried over to the next most significant position if the sum of digits is too large to be expressed as a single digit Key terms for Addition
0 + 0 = 00 • 1 + 0 = 01 • 1 + 1 = 10 (110 + 110 = 210) • 1 + 1 + 1 = 11 Sum bit Carry bit Addition rules
10010 = 18 • 1010 = 10 • 11100 = 16 + 8 + 4 + 0 + 0 = 28 • Now write 28 in hex • Calculate 1010011 + 11100 Check your work
Difference = The result of the subtraction operation • Minuend = The number in a subtraction operation from which another number is subtracted • Subtrahend = the opposite of minuend • Borrow = a digit brought back from a more significant position when the subtrahend digit is larger than the minuend digit Binary subtraction
0 – 0 = 0 • 1 – 0 = 1 • 1 – 1 = 0 • 10 – 1 = 1 Binary Subtraction rules
1110 = 14 • 1001 = 9 • 0101 = 5 • Calculate 110011 - 011010 Check your work