Number systems and logic gates
Connect binary storage to simple Boolean gates, then convert short positive values between denary, binary and hexadecimal.
Section Component 1 · Computer Systems and Logic
Mapped to the Cambridge IGCSE Computer Science 0265 syllabus for exams in 2029. These original explanations and self-checks are independent study support, not Cambridge papers, official marks or grades. Practical programming is taught with worked code and trace tasks; an executable Python workspace and timed digital-exam simulation are not yet available.
Before you begin
- Use the 2029 syllabus for this course. Cambridge specifies Python 3.10 or higher for programming and digital exams for both components. The syllabus currently identifies this route for 2029 only; confirm later-year availability with Cambridge and your school.
Work on paper. Try each question before revealing help, and explain why your method works.
Quick readiness check
Before number systems and logic gates, which statement is the safest starting point?
What you will learn
- Explain why computers represent data in binary
- Convert positive values between denary, binary and hexadecimal within the syllabus limits
- Predict the output of the six specified logic gates
Binary represents stored data
A computer stores and processes data as binary values. A logic gate applies a Boolean rule to one or two input bits and produces an output bit. The six gates in this syllabus are NOT, AND, OR, NAND, NOR and XOR.
Denary uses base 10, binary base 2 and hexadecimal base 16. To convert a positive binary integer to denary, add the powers of two for its set bits. A hexadecimal digit represents one group of four binary bits, so conversion between binary and hexadecimal is a regrouping exercise.
Convert without losing the requested width
To convert denary to binary, repeatedly identify powers of two or divide by two and read the remainders in reverse. For hexadecimal, convert a denary value to binary first, then group from the right in fours. The syllabus limits conversion values to positive integers and binary strings to at most 12 bits.
A truth table lists every possible combination of input bits and the output defined by a gate. XOR is true when its two inputs differ; OR is true when at least one is true. NAND and NOR invert the result of AND and OR respectively.
Pause and explain
Which habit best checks your understanding of number systems and logic gates?
Worked example
Convert denary 45 to binary and hexadecimal.
Show the worked solution
- 45 = 32 + 8 + 4 + 1, so the binary place values 32, 16, 8, 4, 2, 1 give 101101.
- Pad to groups of four bits from the left: 0010 1101.
- 0010 is 2 and 1101 is D in hexadecimal.
Answer Binary 101101₂; hexadecimal 2D₁₆.
Try a topic test
Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.
Test this topic →From guided practice to a new situation
Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.
Convert 110101₂ to denary, showing the place values used.
Give me a hint
Start at the rightmost bit with place value 1.
Compare my reasoning
- The set-bit place values are 32, 16, 4 and 1.
- Add them: 32 + 16 + 4 + 1.
- State the base-10 result.
53
Look for these in your work
- Set bits identified
- Place values applied
- Sum shown
Write denary 156 as an 8-bit binary number, then as two hexadecimal digits.
Give me a hint
Use the 128, 64, 32, 16, 8, 4, 2, 1 places, then group nibbles.
Compare my reasoning
- 156 = 128 + 16 + 8 + 4, giving 10011100.
- Split into 1001 and 1100.
- Those nibbles represent 9 and C.
10011100₂ = 9C₁₆
Look for these in your work
- Eight bits used
- Groups made from the right
- Hex digits correct
A door opens when sensor A is on and either sensor B or C is on. Write a Boolean expression using AND and OR, with brackets to show the intended grouping.
Give me a hint
Translate ‘and’ and ‘either’ separately, then preserve the order with brackets.
Compare my reasoning
- The two alternatives are B or C, so form B OR C.
- The door also requires A, so combine A with that result using AND.
- Check that A alone cannot open the door.
A AND (B OR C)
Look for these in your work
- Both conditions represented
- Grouping explicit
- Expression matches the scenario
Common mistakes
- Reading a binary string as if its place values were powers of ten.
- Grouping binary from the left instead of from the right.
- Treating XOR as equivalent to OR.
What can you explain now?
For inputs 1 and 1, what does XOR output?
Compare with the explanation
0
XOR is true only when the inputs differ.
After trying it yourself, choose your next review. This is your self-assessment.
Your review choice appears on Today. Sign in to sync it across devices.
Make it stick
How do binary place values, hexadecimal nibbles and truth tables help you represent and reason about data?
If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.