Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: BEJ

Is there a negative zero?

Yes. In ones-complement binary arithmetic all zeros represent positive zero and all ones represents negative zero. Most computers, today, use twos-complements arithmetic where all zeros represents zero and all ones represents minus one.


6 posted on 10/10/2022 9:19:03 AM PDT by SubMareener (Save us from Quarterly Freepathons! Become a MONTHLY DONOR)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: SubMareener
Incorrecto... There is no negative binary zero. Binary numbers are a "two's complement". The leftmost bit is the sign. For example:

Minus one is 11111111 (One byte)
add one: 00000001
result: 00000000, with the carry bit set in the status register

Now take zero 00000000
subrtact one 00000001
result: 11111111 (minus one), with the carry bit set in the status register

Carry bit set after a subtraction, you ask? Yes. Two's complement subtraction is done by complementing the bits and adding, and then adding another one.

28 posted on 10/10/2022 10:04:07 AM PDT by GingisK
[ Post Reply | Private Reply | To 6 | View Replies ]

To: SubMareener

Thanks for that info.


73 posted on 10/11/2022 7:25:03 AM PDT by BEJ
[ Post Reply | Private Reply | To 6 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson