Difference between revisions of "Subtraction"
Jmiester26 (talk | contribs) (→Revision) |
(→TRC PowerPoint) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | =Overview= | ||
+ | Video from 6:25 | ||
+ | |||
+ | <youtube>https://www.youtube.com/watch?v=CglODZZm_Z4&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=3</youtube> | ||
+ | |||
+ | https://www.youtube.com/watch?v=CglODZZm_Z4&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=3 (6:25 - End) | ||
+ | |||
=Binary Subtraction= | =Binary Subtraction= | ||
Binary subtraction uses twos's complement and binary addition. For example if a question asks for 73-62 in binary you would convert +62 to -62 using two's complement and then do 73+(-62) using binary addition. | Binary subtraction uses twos's complement and binary addition. For example if a question asks for 73-62 in binary you would convert +62 to -62 using two's complement and then do 73+(-62) using binary addition. | ||
Line 4: | Line 11: | ||
First you would write out 73 and 62 in their respective binary forms using your preferred method and then add 0's to make them 8bit: | First you would write out 73 and 62 in their respective binary forms using your preferred method and then add 0's to make them 8bit: | ||
− | 73= 64+0+0+8+0+0+1 = 1001001. In | + | 73 = 64+0+0+8+0+0+1 = 1001001. In 8 bit 01001001 |
− | 62 =32+16+8+4+2+0 = 111110. In | + | 62 = 32+16+8+4+2+0 = 111110. In 8 bit 00111110 |
Then convert +62 to -62 using your preferred method ([[Negative Numbers]]): | Then convert +62 to -62 using your preferred method ([[Negative Numbers]]): | ||
Line 47: | Line 54: | ||
Using Two's compliment work out 63 - 14, give your answer as a two's compliment binary integer. | Using Two's compliment work out 63 - 14, give your answer as a two's compliment binary integer. | ||
{ 11100111 } | { 11100111 } | ||
− | ||First you convert 63 and 14 to binary giving 00111111 and 00001110 respectively. Then you convert 14 (00001110) to a negative by inverting all figures after the first 1 on the right giving 11000001. Then you add the two binary figures 00111111 and 11000001 giving | + | ||First you convert 63 and 14 to binary giving 00111111 and 00001110 respectively. Then you convert 14 (00001110) to a negative by inverting all figures after the first 1 on the right giving 11000001. Then you add the two binary figures 00111111 and 11000001 giving 00110001. |
</quiz> | </quiz> |
Latest revision as of 08:26, 25 September 2020
Overview
Video from 6:25
https://www.youtube.com/watch?v=CglODZZm_Z4&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=3 (6:25 - End)
Binary Subtraction
Binary subtraction uses twos's complement and binary addition. For example if a question asks for 73-62 in binary you would convert +62 to -62 using two's complement and then do 73+(-62) using binary addition.
First you would write out 73 and 62 in their respective binary forms using your preferred method and then add 0's to make them 8bit:
73 = 64+0+0+8+0+0+1 = 1001001. In 8 bit 01001001 62 = 32+16+8+4+2+0 = 111110. In 8 bit 00111110
Then convert +62 to -62 using your preferred method (Negative Numbers):
-62 = 11000010
Then use binary addition to add 73 and -62:
01001001 + 11000010 =100001011
However the addition left us with a carried 1 that makes the result 9bit, as two's complement uses 8bit we simply ignore the carried one making our final answer equal 00001011.
We can check by converting to denary:
00001011 = 8+2+1=11 and 73-62=11.