the largest negative and positive integers for n-bit 1’s and 2’s complement systems? What are these numbers for 32-bit registers?

If (1000001110)2 is an integer in a 10-bit 2’s complement system, what is the binary code for it in 20-bit 2’s complement system?

Recommended Answers

All 4 Replies

Since this is obviously homework, first tell us what you think the answer should be (and why).

Since this is obviously homework, first tell us what you think the answer should be (and why).

Im at a total lost for the first problem but for the second problem I think it would be 0000000000100001110 because it would be 20 bits without changing the value of the interger and it remains in 2's complement

Im at a total lost for the first problem but for the second problem I think it would be 0000000000100001110 because it would be 20 bits without changing the value of the interger and it remains in 2's complement

IIRC, you'd lose the sign value though. The 10 bit version was negative and you 20 bit version is positive (assuming the sign bit is always your most significant bit). Of course I might be wrong, but that was my first thought.

When filling out a number in order for it not to lose its sign you'll have to use the most significant bit.
For example:
0100 -> 00000100,
1010 -> 11111010.
Notice though, that this only concerns signed numbers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.