5 = 00000101
-5 = ~5 + 1
= 11111010 + 1 = 11111011
But, 11111011 is not 5 in decimal. So what is -5 in binary ?
5 = 00000101
-5 = ~5 + 1
= 11111010 + 1 = 11111011
But, 11111011 is not 5 in decimal. So what is -5 in binary ?
Hi @anuj_it you have correctly formulated -5 in binary i.e. 11111011 , i think you are confused in how computer percives negetive number
lets think like how a compter thinks when it recieves 00000101 and 11111011 (consider int as 8 bit number )
In case of any doubt feel free to ask
If you got the answer mark your doubt as resolved
if you liked the answer then hit a like
Ok… so 10000001 (binary form) would be a -ve number and not 129 ?
And if someone asks me what is binary of -5, so ans would be 11111011 ?
And if its written somewhere 11111011, so how will I come to know whether its -5 or 251 ?
by its most significant bit if 1 then its a negetive number and 0 then positive if we are dealing with 8 digit binary numbers than 11111011 then its -5 and if we are dealing with 32 bit number then it is 251
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
I think that Oracle Exam Practice Test Questions is crucial for graduating from any university. Every student should know how to write and I think you should be able to do it, too. I would recommend you to take some extra classes or enroll in additional course.
The most common encoding of negative numbers in processors is not using 1’s complement but 2’s complement.
Using 2’s complement 00000101 is 5, but 11111010 means -6, not -5.
If we use the common addition rule we get 11111111 which is -1 as expected.
We can see it another way: if we were using 1’s complement for encoding negative numbers then what would be the opposite of zero (encoded as 00000000) ? Wouldn’t it be 11111111 ?
And if you want to more knowledge about it then you take some IT Courses that improve your knowledge about it. So get the latest ECCouncil 312-38 exam questions for free that stimulates a real Certified Network Defender with the right answers