Skip to content
IGCSE·Tuition
Tools

Boolean and number-representation lab

Truth tables and base conversions both feel mechanical until one bracket or one place value goes wrong.

On this page
  1. How do you use it?
  2. How do you read the result?
  3. Example walk-through
  4. What are the assumptions and limits?
  5. Which lessons explain the result?

Everything you enter stays on this device. Nothing is sent to us.

This lab has two modes. One turns a small Boolean expression into a full truth table. The other converts a number between binary, denary (decimal) and hexadecimal and shows the working.

Do the question on paper first, then use the lab to check each step.

How do you use it?

  1. Choose the mode: Boolean expression to truth table, or number base conversion.
  2. Boolean mode: type an expression using A to D, for example (A AND B) OR NOT C. Press Show working.
  3. Number mode: type the number, then choose the base it is written in (binary, denary or hexadecimal). Press Show working.
  4. Reset clears the lab.

How do you read the result?

Truth table. There is one row for every combination of inputs, so two inputs give 4 rows, three give 8 and four give 16. The Output column shows the result of the whole expression, and the heading counts how many rows give 1.

Conversion. You see one line with the number in all three bases, for example 1010 (base 2) = 10 (base 10) = A (base 16). Underneath is the method: place values for binary to denary, repeated division with the remainders listed for denary to binary or hexadecimal, and grouping in fours for binary to hexadecimal.

Example walk-through

Truth table. Enter (A AND B) OR NOT C. With three inputs there are 8 rows.

  • If C = 0, then NOT C is 1, so the output is 1 whatever A and B are. That is 4 rows.
  • If C = 1, NOT C is 0, so the output depends on A AND B. It is 1 only when A = 1 and B = 1. That is 1 row.

So 5 of the 8 rows give output 1, which is what the heading reports. Now try A AND B OR NOT C without brackets.

AND is applied before OR, so the same table appears. Try NOT A AND B and notice that NOT applies to A only.

Conversion. Type 10110100 as binary. The place values are 128, 32, 16 and 4 where the bits are 1, so 128 + 32 + 16 + 4 = 180. Grouping in fours gives 1011 and 0100, which are B and 4, so the hexadecimal is B4.

Check the other direction. Type 180 as denary. Dividing by 2 repeatedly gives remainders 0, 0, 1, 0, 1, 1, 0, 1.

Read from the bottom up, that is 10110100 again. Because these are exactly 8 bits, the tool adds that as two’s complement the value is 180 − 256 = −76.

What are the assumptions and limits?

  • Up to 4 different inputs, A to D, and an expression of at most 80 characters.
  • The precedence shown in the hint (NOT, then AND/NAND, then XOR, then OR/NOR) is what the tool uses. Your exam may draw a circuit instead, so use brackets to be safe.
  • Number input is limited to 16 binary digits, 4 hex digits or denary 0 to 65535. Negative and fractional numbers are not handled.
  • Malformed input gives an error message, not a guess.
  • Hexadecimal digits A to F stand for 10 to 15.
  • It is a practice aid, not an official exam tool.

Which lessons explain the result?

For Boolean expressions, start with evaluate a logical expression with parentheses, then construct a truth table. If your table disagrees with the tool, read compare two equivalent expressions using cases. Logic circuits are in interpret a simple logic circuit, and combine conditions with the correct Boolean grouping shows the same bracket issue in database queries.

For the number side, see convert between binary and denary and use hexadecimal as a compact representation. The wider topics are Boolean logic and representing numbers and text. Mixed questions are in the Boolean logic practice set.

If you would like a teacher to check your tables and conversions, see online one-to-one Computer Science tuition. More tools are in the learning tools directory.

Questions people ask

Which operators can I use in the Boolean expression?

Use the letters A to D as inputs, the constants 0 and 1, NOT, AND, OR, XOR, NAND, NOR and brackets. NOT binds tightest, then AND and NAND, then XOR, then OR and NOR. When in doubt, add brackets, because they make your meaning clear to the tool and to a marker.

How large a number can I convert?

Binary up to 16 digits, hexadecimal up to 4 digits, or denary from 0 to 65535. If you type something outside the chosen base, for example a 2 in a binary number, the tool says what is allowed instead of guessing.

What is the two's complement line for?

When the input is exactly 8 bits, the tool also shows the value those bits would have if read as a signed two's complement number. It is an extra reading of the same bits, not a replacement for the unsigned answer. Use it only if your course covers signed numbers.

Does the tool run my expression as code?

No. It uses an allowlisted parser that accepts only the listed words, letters and brackets. Nothing is evaluated as code, and expressions are capped at 80 characters. Anything else gives a readable error message.

Sources

  1. Cambridge IGCSE Computer Science 0478 syllabus page

Updated:

Your next step

If you get the method right but still slip on brackets or place values, a one-to-one teacher can check your working line by line and fix the habit behind the slip.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service