# Value assigned to 0xFFFFFFFF in One's Complement and Two's Complement

-1

This is a short question and I just wanted to clarify something.

What is the value assigned to 0xFFFFFFFF in One and Two's Complement?

I thought that 0xFFFFFFFF is Two's Complement was -1. However when I used an online Two's Complement calculator, I got a value of 1.

Also, I wanted to check if the value of 0xFFFFFFFF in One's Complement was 0.

twos-complement
ones-complement
asked on Stack Overflow Jul 14, 2020 by scy17 • edited Jul 14, 2020 by scy17

1

Considered as a signed 32-bit integer, FFFFFFFF is -1 in a 2's complement system, or -0 in a 1's complement system (a characteristic of 1's complement representation is that it has +0 and -0).

Considered as an unsigned 32-bit integer, FFFFFFFF is 4,294,967,295 decimal.

As pointed out, the specific notation 0xFFFFFFFF in a specific programming language may be considered as unsigned or signed, 32 bits or longer.

I don't know what a Twos Complement Calculator does, but the 2's complement of -1 is 1, and vice-versa. Possibly you were asking it for the complement of FFFFFFFF.

answered on Stack Overflow Jul 14, 2020 by user13784117

User contributions licensed under CC BY-SA 3.0