/en-tutor-prep-ib-cs-data-representation-binary-hex-logic/
/en-tutor-prep-ib-cs-data-representation-binary-hex-logic/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

IB Computer Science Data Representation and Logic: Tutor Prep Guide (binary, hex, seven gates, truth tables)

IB Computer Science Data Representation and Logic: Tutor Prep Guide (binary, hex, seven gates, truth tables)

  • 2026-11-27

This chapter has two halves: one gets the same bits written three ways, the other gets seven gates into order. Marks are rarely lost on the arithmetic; they are lost by grouping bits from the left and by missing a row in a truth table. Both are process failures, and a fixed format removes both.

Objectives — Students can: (1) convert between binary, denary and hexadecimal and state the four-bit grouping rule (for example 3F2A is 16,170, and 202 is 1100 1010, which is CA); (2) size a register from its bit count: 12 bits hold 4,096 values with a maximum of 4,095, and 10 bits hold 1,024; (3) size data: 1920 by 1080 at 24 bits is 49,766,400 bits, 6,220,800 bytes, 5.93 MiB, while 44,100 Hz at 16 bits over 2 channels is 1,411,200 bits a second and 30.28 MiB for three minutes; (4) write truth tables for all seven gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) and derive a Boolean expression, then simplify it with algebra or a Karnaugh map; (5) read a truth table off a circuit diagram and draw the diagram back from the table.

01 Prerequisites (3-minute check)

If any of these fails, fix it before the lesson starts.

Skill Quick check Pass mark
Powers of two What two to the tenth is Says 1024 and knows two to the eighth is 256
Bytes How many bits in a byte Says eight
Boolean values How true and false are written Uses 1 and 0, and knows there is no third value

02 Lesson flow (60 minutes)

Time Stage Tutor does Student does
0-8 min Opening probe Give 3F2A and ask for its value Guess first, check at the end
8-20 min Binary and hex conversion Group four bits from the right, pad on the left Six conversions
20-32 min How data becomes bits One line each for integers, characters, images, audio, video Size an image and a sound
32-44 min Seven gates AND, OR, NOT first, then build the rest with NOT Write seven truth tables
44-54 min Simplification and Karnaugh Three algebra rules plus one paired circle Reduce four rows to one term
54-60 min Exit check Collect three questions, mark at once Independent work

03 Teaching script (read it out)

Scene 1: Binary and hexadecimal: four bits at a time, from the right

Put the three notations on one number line: binary is for the machine, denary is for people, and hexadecimal is the compromise that stays aligned to bits, since one hex digit is exactly four bits.
The method has three fixed steps: group four bits from the right, convert each group to one hex digit, and pad the leftmost group with zeros. Show it forwards: 3F2A splits into 3, F, 2 and A, which is 0011, 1111, 0010 and 1010, and the place values sum to 16,170. Show it backwards: 202 by repeated division gives 1100 1010, which groups into 1100 and 1010, that is C and A, so CA.
Tie bit count to capacity: 4096 bits give 4,096 combinations with a maximum of 4,095, while 10 bits give only 1,024. Widening a register is not cosmetic; it buys range.

Student task: three conversions in a row, each with the intermediate binary line written out, never jumping straight from hex to denary.

Scene 2: How data becomes bits: every example lands as a calculation

Start with the easy one: integers are binary, characters come from a code table, and ASCII uses 7 bits for 128 characters, so a wider character set needs a wider code. A string is characters in sequence, so its size is the count times the bits per character.
Images need three facts: width, height and bits per pixel. 1920 by 1080 pixels at 24 bits each is 49,766,400 bits, which is 6,220,800 bytes, about 5.93 MiB. Two consequences to state: doubling resolution quadruples the pixels, while doubling colour depth only doubles bits per pixel. That is the usual lost mark, because the two feel the same and behave differently.
Audio needs sample rate, bit depth and channel count. 44,100 Hz means 44,100 samples a second, each 16 bits over 2 channels, giving 1,411,200 bits a second or 176,400 bytes; three minutes is 180 seconds, so 30.28 MiB. Video is images in sequence, so its size is the frame size times frames per second times seconds.

Student task: write the image and audio lines side by side, and say for each which parameter doubles the size and by how much.

Scene 3: Seven gates and simplification: build from NOT, then finish with a map

Do not spend equal time on all seven. Teach AND, OR and NOT as the base, then define NAND as AND followed by NOT, NOR as OR followed by NOT, XOR as one or the other but not both, and XNOR as equal inputs. Seven gates then cost three memories plus four combinations.
Fix the truth table format: inputs in the order 00, 01, 10, 11, and three inputs means eight rows from 000 to 111, because rows equal two to the number of inputs. Write the row count first, fill inputs second, outputs last. Missing rows is the commonest error, and the format prevents it.
Simplify one line: A and B, or A and not B, is true whenever A is true, whatever B does, so it reduces to A. Verify with four rows so students believe it.
A Karnaugh map is the same reasoning drawn: circle adjacent ones, keep only the variables that do not change inside the circle. One pair removes a variable, four cells remove two. IB wants simplification supported by a truth table, so every step should be narrated as which variable disappeared. Close with two algebra rules: a term and its complement summing away, and De Morgan, where negating a whole expression negates each variable and flips the gate.

Student task: take any truth table and say which rows are one, which group they form, and which variable the group removes.

04 Question types and worked steps

Type Example Steps Answer
Binary and hex conversion 3F2A to denary; 202 to hex Group four bits from the right, pad the left, convert each group 16,170; CA
Size an image or a sound 1920 by 1080 at 24 bits; 44,100 Hz at 16 bits over 2 channels Total bits, divide by eight for bytes, divide by 1024 twice for MiB 5.93 MiB; 30.28 MiB for three minutes
Write a truth table and simplify A and B, or A and not B Fix rows, fill inputs, fill outputs, circle adjacent ones Identical to A, so the expression is A
Read a Boolean expression off a circuit Two inputs through AND, then OR with a third Name each gate left to right, then substitute layer by layer (A and B) or C, with eight rows
Sanity check (teach this): Three checks: (1) one hex digit is always four bits, so a total bit count is always a multiple of four, and groups of five mean the split is wrong; (2) image size is pixels times bits per pixel then divided by eight, so 6,220,800 bytes must feel like about six million bytes, and six hundred megabytes means the divide by eight was skipped; (3) truth table rows are two to the number of inputs, four for two inputs and eight for three, and any other count means a duplicated or missing input. The most common misjudgement is bits against bytes: every file size question starts by dividing bits by eight, and everything after that inherits the error.

05 Independent practice (3 questions)

Question Answer What to watch
Convert 3F2A to binary and denary. 0011 1111 0010 1010; 16,170 Grouping from the right
How large is an image of 1920 by 1080 pixels at 24 bits? 6,220,800 bytes (5.93 MiB) Divide by eight, then by 1024 twice
Write the four rows for XOR and XNOR and state the relationship. XOR is one when inputs differ; XNOR is the opposite, XOR followed by NOT Uses same or different rather than memorised rows

06 Common mistakes and what to say

Mistake Student writes Say this
Grouping bits from the left Splitting 3F2A into 3, F2 and A “Group four bits from the right and pad the left. From the left, every low-order digit is wrong.”
Bits against bytes Reporting 6,220,800 bits as 6 MB “The question asks for size, so divide by eight first. You handed in bits, which is eight times too big.”
Missing truth table rows Only four rows for three inputs “Three inputs give eight combinations. Write the count first, then fill, or the whole simplification fails.”
Confusing NAND with NOR Treating NAND as not A or not B “NAND is AND then NOT: it outputs zero only when both inputs are one, and one in the other three cases.”

07 Homework (paper, section and question numbers)

08 Exit check (last 5 minutes)

Question Answer Decision
Conversion rule Four bits a group, from the right, pad the left Left grouping means replay act one
Size method Total bits divided by eight Skipping the divide means replay act two
Row count Two to the number of inputs Missing rows means replay act three

09 Tutor FAQ

Must all seven truth tables be memorised?

Yes, but three gates generate the rest: NAND and NOR are base gates with NOT, XOR is one or the other but not both, XNOR is equal inputs. Writing the row count first is safer than recall.

Is a Karnaugh map compulsory?

The syllabus asks for simplification supported by a truth table, and a map is the clearest drawing. Boolean algebra earns the same marks, so students should master whichever they use.

How far should negative numbers go?

This chapter is about integer conversion between binary and hex and how data becomes bits. Negative and floating point representations are extensions, so add them in a later lesson rather than crowding this one.

Find a tutor — freeTutor Registration →

A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →