115 exam-style questions on Data representation and computer logic — topic A1.2 of Computer fundamentals in the IB Computer Science syllabus — with answers and explanations. Samples below; the full set is free with an account.
How is the denary value -18 stored as an 8-bit two's complement number?
Answer: 11101110
18 is 00010010; inverting every bit gives 11101101 and adding 1 gives 11101110. The pattern 10010010 is sign-and-magnitude and 11101101 stops one step early at the one's complement.
The 8-bit pattern 11011010 is to be written in hexadecimal. Which pair of digits is correct?
Answer: DA
Split the byte into nibbles: 1101 is D and 1010 is A, giving DA. AD is the same two nibbles written in the wrong order, the error made when the pattern is read from the right.
The 8-bit two's complement values 01100100 and 01000000, that is 100 and 64, are added in an 8-bit register. What is the outcome?
Answer: Overflow occurs and the stored pattern is read as a negative value.
100 + 64 = 164 lies outside the range -128 to 127, so the carry lands in the sign bit and the pattern 10100100 is read as -92. Registers neither widen nor stop at the maximum on their own.
Which Boolean expression is equivalent to NOT (A AND B)?
Answer: NOT A OR NOT B
De Morgan's law turns the negation of an AND into an OR of the negated inputs. Keeping the AND gives NOT A AND NOT B, which is the negation of an OR instead.
A messaging service must store text written in Greek, Arabic and Chinese in one file. Which character encoding is appropriate, and why?
Answer: Unicode, because its code points cover many writing systems.
ASCII has only 128 code points, enough for unaccented English letters, digits, punctuation and control codes, while Unicode was created so that many scripts can be mixed in one document. Two's complement and hexadecimal are number notations, not character sets.
Which Boolean expression is equivalent to A AND (A OR C)?
Answer: A
Whenever A is 0 the whole expression is 0, and whenever A is 1 the bracket is already 1, so the value follows A alone and C is absorbed. Keeping C in the answer is the usual slip, because the bracket looks as though it must matter.
That was 6 of 115 Data representation and computer logic questions.
Practise all 115 freeStateAO1 · 1–2 marks
One word or one short sentence. No explanation, no working: the mark is for the fact itself.
DistinguishAO2 · 2–4 marks
Make the difference clear for BOTH terms — a definition of one of them is only half an answer.
ConstructAO2 · 2–4 marks
Build it as instructed — a table, a diagram, an argument — with every required element present.
115 Data representation and computer logic questions — free with an account. Spaced repetition, streaks and full exam simulations included.
Practise them freeThis platform is independently developed and is not endorsed by, affiliated with, or sponsored by the International Baccalaureate Organization. “International Baccalaureate” and “IB” are registered trademarks of the IBO.