Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in.
Post a replyTopic review (newest first)
you're right about the complement part, its what i said above when i went on two 10's complement with decimal.
Wow! look at the response this threads getting!
by 'regular binary' i meant place value, as in 1010 = 1*2^3 + 0*2^2 + 1*2^1 + 0*^0 = 12d
There is one more thing (two, perhaps). The other way to do negative numbers is to just have a sign bit, and the rest be interpreted as a normal positive value. Where else does 2's complement succeed when this method fails.
also note that this doesn't just work for binary numbers. if we define the negative integer as k-x where k is the number 1 followed by 'n' 0's where n is how many bits the number is. i.e. -0101 = 10000-0101 = 1011.
It simplifies adding a positive number to a negative number.
we use this system because we can use the exact same set of logic gates to add two normal binary integers, as we can to add two two's comlement binary integers. without any overhead such as 'if first bit is 1, then do this instead because it is negative' it can simply be treat as any other positive integer, and due to overflow's ends up giving the correct answer
Two's complement is "regular binary" for positive values. I'm not certain if that's what you were trying to say.
i'm not sure but i think -3(101)
The first bit (leftmost) is the sign bit and is not used in computing the value of the number. Zero signifies a positive number, a one signifies a negative. So with 4 bits, you can represent from 7 (0111) to -8 (1000).
oops! I'm sorry. I thought i was posting this in coders corner! my bad!
i'm taking a course in assembly language x_x |