![]() | ![]() | ![]() |
| | |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| i am having trouble to understand the meaning of complement 1 and complement 2 of a certain number after looking a this table:http://s290.photobucket.com/albums/l...t=IMG_8817.jpg i came to the conclution that the complement 1 and complement 2 of a positive stays the same but in the case of a negative number there is a unique transformation for each type of complement. how does the complement to 1 and the complement to 2 changes the value of a negative number and why it doesnt change possitive numbers | |
| |
| | (permalink) |
| Twos compliment subtracts the number from zero and so the top bit gets set. To obtain a twos compliment number you invert all the bits and add 1 to the result. So, 1 (00000001) gets inverted (11111110) and then incremented (11111111) to get -1. Also, -1 (11111111) gets inverted (00000000) and then incremented to get (00000001) 1. Ones compliment is the same except you don't do the increment after the inversion. So, -1 = 11111110. In both systems the largest positive number is 127. Check wikipedia for a longer explanation. Mike. | |
| |
| | (permalink) |
| is it ok??? " Ones complement and twos complement are methods of representing negative numbers. Therefore, they don't affect positive numbers. To represent a negative number in ones complement, the positive value simply has all its bits inverted. Example: to represent -25 in ones complement, take the binary representation of +25 which is 00011001, then invert the bits: 11100110. Done. To represent a negative number in twos complement, take the ones complement from the previous example, and add one to it: 11100110 + 00000001 = 11100111 " | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| AM receiver | raj_404 | General Electronics Chat | 61 | 11th July 2008 03:41 AM |
| bar graph display driver trouble | davidbball13 | General Electronics Chat | 35 | 17th May 2008 10:23 PM |
| Am I doing it in the right way? | Harros | Electronic Projects Design/Ideas/Reviews | 2 | 1st February 2008 02:58 PM |
| Am I USING PIC UART CORRECTLY?? | cyprio7 | Micro Controllers | 46 | 15th January 2008 07:03 PM |
| PIC16F88, PIC simulator lcd trouble | superbrew | Micro Controllers | 11 | 17th October 2007 03:18 AM |