my maths is not good we dont do much maths in school and dont do binary or hex but i am interested in learning this stuff so can you tell me if i got this write using your example please "(00001010)" so this inverted is 11110101?? is that right?? and adding 1 to it makes it 11110110??? and convert to hex (on the calculator) makes it f6??
do i have that correct?? one last question and i know its stupid but whats 2's compliment??
logan
2's compliment is a good way for expressing numbers that are negative or positive.
It is often used on Centigrade temperature sensors that cover ranges like -55º to +125º C.
One way of looking at 2's compliment is that the most significant digit represents minus what it would represent in binary. An 8 bit temperature would have bits that represent
-128º C
64º C
32º C
16º C
8º C
4º C
2º C
1º C
can you tell me if i got this write using your example please
"(00001010)" so this inverted is 11110101?? is that right?? Yes, this is also known as the 1's complement
and adding 1 to it makes it 11110110??? and convert to hex (on the calculator) makes it f6??
do i have that correct?? Yes. correct again
one last question and i know its stupid but whats 2's compliment??
As others have said, the 2's complement is a way of writing negative numbers in binary.
So, the original hex number 0x0A which is equivalent to 10 in decimal has been converted to the hex equivalent of -10 in decimal.
And just as 10 + (-10) = 0 in decimal, so a binary number added to its 2's complement is also zero.
As a side issue, at the machine level, computers work in binary.
For us humans trying to remember binary numbers is a real pain (at least it is for me!), so hexadecimal is just a convenient way of remembering and writing binary numbers.