|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
why is the complement of 6 = 11111010?
i understand how to get the figure, but not why i get that figure ***this is straight from my text, so it is right URL |
|
#2
|
|||
|
|||
|
How two's complement works:
Take positive number as binary value Subtract 1 from it Flip the bits Thus, 6 goes: 6: 00000110 6-1: 00000101 flip: 11111010 The reasons for this are pretty arbitrary -- two's complement is an entirely artificial system for representing a negative number that's just used because it has some useful properties, namely: 1) You get as many negative as positive numbers 2) It's simple 3) Every positive number has a negative equivalent in the same number of bits (a stricter version of (1), really). There are probably several other reasons for it that I haven't thought off of the top of my head. Just out of interest, why do you need to know about two's complement for 'Beginner' web work? :-) |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > binary numbers (two's complement) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|