IBDP Computer Science A1.2 Data representation and computer logic HL Paper 1- New Syllabus
Question
(a) The hexadecimal representation of a particular integer is $\text{7A}$.
State the binary representation of this integer. $[1]$
(b) The binary representation of a particular integer is $00011100$.
State the hexadecimal representation of this integer. $[1]$
Most-appropriate topic code (CED):
▶️ Answer/Explanation
(a)
Each hexadecimal digit corresponds to exactly $4$ binary bits.
For $\text{7A}$:
$\text{7}=0111$
$\text{A}=1010$
Combining the two groups:
$\text{7A}=0111\ 1010$
Therefore, the $8$-bit binary representation is:
$\boxed{01111010}$
Answer: $01111010$
(b)
To convert an $8$-bit binary number to hexadecimal, separate it into groups of $4$ bits from the right:
$00011100=0001\ 1100$
Convert each group to hexadecimal:
$0001=\text{1}$
$1100=\text{C}$
Therefore:
$00011100=\text{1C}$
$\boxed{\text{1C}}$
Answer: $\text{1C}$
Question
X = NOT A OR B AND C OR NOT B \( [4] \)Most-appropriate topic code (CED):
▶️ Answer/Explanation
The expression is:
\( X = \mathrm{NOT}\ A\ \mathrm{OR}\ (B\ \mathrm{AND}\ C)\ \mathrm{OR}\ \mathrm{NOT}\ B \)
The AND operation is evaluated before the OR operations. The completed truth table is:
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Answer: The truth table has output \(X=0\) only when \(A=1,\ B=1,\ C=0\). For all other input combinations, \(X=1\).
Question
W = C OR NOT B AND NOT A OR B\( [4] \)
Most-appropriate topic code (CED):
▶️ Answer/Explanation
The completed truth table is:
| A | B | C | W |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Answer: The value of W is \(0\) only when \(A=1\), \(B=0\), and \(C=0\). It is \(1\) for all other combinations.
