Back to the full dot-point answer
SingaporeComputer ScienceQuick questions
Data Representation
Quick questions on Two's complement integers explained: H2 Computing
6short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is negating a number?Show answer
To form the negative of any two's complement number: invert every bit, then add one. The same procedure undoes itself, so it converts to and back to .
What is the representable range?Show answer
For bits the range is asymmetric:
What is detecting overflow?Show answer
Signed overflow happens when adding two numbers of the same sign produces a result of the opposite sign. Equivalently, overflow occurred if the carry into the sign bit differs from the carry out of it. Adding numbers of opposite signs can never overflow.
What is q1?Show answer
Represent in 8-bit two's complement. [2 marks]
What is q2?Show answer
State the range of a 16-bit two's complement integer. [1 mark]
What is q3?Show answer
Does adding and (8-bit signed) overflow? Explain. [2 marks]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.