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?
- Choose the mode: Boolean expression to truth table, or number base conversion.
- Boolean mode: type an expression using A to D, for example (A AND B) OR NOT C. Press Show working.
- Number mode: type the number, then choose the base it is written in (binary, denary or hexadecimal). Press Show working.
- 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.