DigiBacc

Practice questions › IB Computer Science › Computer fundamentals › Data representation and computer logic
IB Computer Science · Computer fundamentals

Data representation and computer logic practice questions.

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.

At a glance

About this topic

Syllabus code
A1.2
Subject
IB Computer Science
Topic
A1 · Computer fundamentals
Questions
115 with worked answers
Question types
94 fill-in-the-gap questions · 10 multiple-choice questions · 3 structured questions · 3 true/false questions · 2 flashcards · 2 matching tasks · 1 diagram task
Try it

Sample questions on Data representation and computer logic

How is the denary value -18 stored as an 8-bit two's complement number?

  • 10010010
  • 11101101
  • 11101110
  • 00010010

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?

  • AD
  • DA
  • BA
  • D2

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?

  • The register widens to 16 bits automatically so that 164 is stored.
  • The result is stored correctly as 164 because both values are positive.
  • The result is held at 127, the largest value the register can represent.
  • Overflow occurs and the stored pattern is read as a negative value.

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)?

  • NOT A OR NOT B
  • NOT A AND NOT B
  • A OR B
  • NOT (A OR 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?

  • ASCII, because using only seven bits for each character keeps the file small.
  • Two's complement, because it can represent very large values.
  • Hexadecimal, because two digits can express any byte value.
  • Unicode, because its code points cover many writing systems.

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)?

  • A AND C
  • C
  • A
  • 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 free
Exam tips

Command terms in this topic

Keep going

More topics in Computer fundamentals

All of Computer fundamentals →

115 Data representation and computer logic questions — free with an account. Spaced repetition, streaks and full exam simulations included.

Practise them free

This 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.