+John Teacake MVC Posted November 27, 2003 MVC Share Posted November 27, 2003 Could anyone give me the basics steps for doing 8bit 2's compliment arithmatic, im realy stuck. Thanks Link to comment Share on other sites More sharing options...
aem4162 Posted November 27, 2003 Share Posted November 27, 2003 math Link to comment Share on other sites More sharing options...
Betelgeuse Posted November 28, 2003 Share Posted November 28, 2003 I swear I'm going to form a "Forums need spell checkers Alliance." :p It's Arithmetic and I hate math. Link to comment Share on other sites More sharing options...
Hum Posted November 28, 2003 Share Posted November 28, 2003 :o 8-bit 2's compliment Math ??? I'm lucky if I can count to 10. :unsure: http://www.math.com/ http://www.mathleague.com/help/help.htm Link to comment Share on other sites More sharing options...
Sn00pY Posted November 28, 2003 Share Posted November 28, 2003 leave the leading number as is... 00010011 <-- the first 1[as in the number 1] from the right>left direction [unless its a 0 then you contintue till you come to the first 1...] changes to this... 11101101 we keep the leading 1 and from there you work out the binary... anything else or? Link to comment Share on other sites More sharing options...
Viserov Posted November 28, 2003 Share Posted November 28, 2003 Or, even more simply stated... - Look at the last 1 in the number (for example, 11001001). - Leave that 1 alone and flip everything before that (i.e., 0's become 1's, 1's become 0's). So, our example, after two's compliment, becomes 00110111. Link to comment Share on other sites More sharing options...
Sn00pY Posted November 28, 2003 Share Posted November 28, 2003 Hehe - i really did write that in a round-a-bout way didnt i :D Link to comment Share on other sites More sharing options...
Viserov Posted November 28, 2003 Share Posted November 28, 2003 lol, It's cool, though :) I just hope the original poster found all our tips helpful, if he comes back to check :p Link to comment Share on other sites More sharing options...
+John Teacake MVC Posted November 28, 2003 Author MVC Share Posted November 28, 2003 hello im back, now im realy stuck with pointers in C, so im off to post in the Programming forum unless anyone can help me with that, id like to chat to the on MSN if anyone can help. Thanks for all the help anyway its just ive got a test on Monday and i need to get at least 35 percent to pass. So im going to be revising **** loads for it. Thanks guys for the help. Link to comment Share on other sites More sharing options...
HPMCommander Posted November 28, 2003 Share Posted November 28, 2003 -->contribution<-- Link to comment Share on other sites More sharing options...
+John Teacake MVC Posted November 28, 2003 Author MVC Share Posted November 28, 2003 -->contribution<-- huh ? :huh: Link to comment Share on other sites More sharing options...
+John Teacake MVC Posted November 29, 2003 Author MVC Share Posted November 29, 2003 Ok so can anyone do Karnaugh Maps ? Link to comment Share on other sites More sharing options...
+John Teacake MVC Posted November 29, 2003 Author MVC Share Posted November 29, 2003 So can anyone help me with this. i need to add 51 and 20 in 8 bits 2's compliment. Link to comment Share on other sites More sharing options...
SanGreal Posted November 30, 2003 Share Posted November 30, 2003 Ok so can anyone do Karnaugh Maps ? easily Link to comment Share on other sites More sharing options...
strumbum Posted November 30, 2003 Share Posted November 30, 2003 ANSWER: If you are adding two numbers, don't change ANYTHING! Just add them! 01 + 01 = 10! you ONLY change something if you are going to SUBTRACT it. For instance... 5 - 1 simple enough? 5 = 101 1 = 001 because you are subtracting 001, flip it around (110) and add 1 (111) now add the two number together, 101 + 111 = 1,100 wow, if you take that last 1 off, you get 4, tada! want to see it again? 95 - 40 (hey, we just gots to use bigger numbers) 95 = 1011111 40 = 0101000 notice, you must make both numbers the same number of bits (just add 0's) flip the 40 (1010111) and add 1 (1011000) 1011111 + 1011000 = 10110111 now you have , , , 55! cool, eh. Notice I only added 1 to it each time. I believe you add 2 for 2's compliment. I believe I just showed you 1's compliment. Wew :blink: Link to comment Share on other sites More sharing options...
SanGreal Posted November 30, 2003 Share Posted November 30, 2003 Notice I only added 1 to it each time. I believe you add 2 for 2's compliment. I believe I just showed you 1's compliment.Wew :blink: No, you did it correctly. With 1's compliment you simply flip all the bits, with 2's compliment you add 1. Link to comment Share on other sites More sharing options...
Recommended Posts