Asked by Kid
How can I tell a negative binary number from a positive one? More specifically, what exactly is the difference?
For example, the binary number 1110 converted to a decimal number results in either 14 (positive) or -2 (negative). So which one would I write as the correct answer? Or are both values correct?
For example, the binary number 1110 converted to a decimal number results in either 14 (positive) or -2 (negative). So which one would I write as the correct answer? Or are both values correct?
Answers
Answered by
ghost
(this is plagiarized) Adding a “1” to the front of it if the binary number is negative and a “0” if it is positive. However, using this sign-magnitude method can result in the possibility of two different bit patterns having the same binary value. For example, +0 and -0 would be 0000 and 1000 respectively as a signed 4-bit binary number.
Answered by
oobleck
in signed binary, both 0000 and 1000 are just 0
in ones-complement, 1000 = -7 since 0111 = 7
in twos-complement, 1000 = -8 since 0111 +1 = 1000 (or it may be treated as an error)
in ones-complement, 1000 = -7 since 0111 = 7
in twos-complement, 1000 = -8 since 0111 +1 = 1000 (or it may be treated as an error)
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.