Logout

3.5.5 Apply binary notation to represent integers, both positive and
negative, using the method-of-two’s complement.

(No teaching note for this one.)

Sample Question 1:

(b) Express the decimal number –20 in 8-bit two’s complement format. [2 marks]

Sample Question 2:

Numeric data is stored in a computer in binary format.

(a) Using a 7-bit two’s complement binary format show how the following integer
values would be represented.

(i) 3710 [1 mark]

(ii) –3710 [2 marks]

(b) Given a 7-bit two’s complement binary format, and showing all working, calculate

(i) the largest integer that can be stored; [1 mark]

(ii) the smallest integer that can be stored. [2 marks]

JSR Notes:

***video instruction***

You are required to know what is meant by the "method-of-twos complement", and you equally required to do such questions this way, showing this method's work. Coming up with the correct answer another way is not enough in this case.

Say it 5 times aloud: "Flip the bits, and add a binary one."

That's it...

That's it, except that "that's it" is a "that's it" that is gargantuanly prone to errors. I guess the problem is that in the Twenty-first Century, you often no longer have practice with these sorts of rudimentary non-calculator procedures. So, once again, slow down, and do it right. Remember with 1 + 1 = 0, carry the 1 over to the next place to the left.

And remember that you cannot express an integer outside of the range of -128 to 127 when using 8 bits.

And the one thing I didn't mention the first time through is that integers can be either "signed" or "un-signed" in various programming languages. When they are "signed" that means that the MSB is negative whatever that place would normally be.

And... MSB is a term you need to know is "Most Significant Bit". The question will read something like, in a 6-bit systems with a negative MSB, represent the value...