Skip to main content

Back to the full dot-point answer

SingaporeComputer ScienceQuick questions

Data Representation

Quick questions on Binary addition and overflow explained: O-Level Computing

9short 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 are the four addition rules?
Show answer
Adding two bits (plus any carry coming in) follows four simple cases:
What is adding column by column?
Show answer
Start at the rightmost column (the least significant bit) and work left. Add the two digits and any incoming carry, write the result digit, and pass any carry to the next column:
What is checking with denary?
Show answer
Always confirm a binary addition by converting both numbers and the result to denary. If a+ba + b in denary does not equal the denary value of your binary result, you have dropped a carry somewhere.
What are fixed-width registers?
Show answer
A register stores a fixed number of bits, often 88. An unsigned 8-bit register can hold the values 00 to 255255, because 28=2562^8 = 256 patterns. The largest unsigned value is 2n12^n - 1 for nn bits.
What is overflow?
Show answer
Overflow happens when an addition produces a carry out of the most significant bit, because the result needs more bits than the register has. The extra bit is lost, so the stored answer is wrong. You detect overflow by checking for a carry out of the top column, or by checking whether the true result exceeds 2n12^n - 1.
What is not checking with denary?
Show answer
Skipping the denary check is the most common reason a wrong binary sum goes unnoticed.
What is q1?
Show answer
Add 00001111200001111_2 and 00000001200000001_2 and give the 8-bit result. [2 marks]
What is q2?
Show answer
State the largest value an unsigned 8-bit register can hold, and why. [2 marks]
What is q3?
Show answer
Add 10000000210000000_2 and 10000000210000000_2 in an 8-bit register and explain the result. [3 marks]

All Computer ScienceQ&A pages