English:Binary numbers and Boolean logic - Computing Year 7
Introduction

Convert every unsigned four-bit value,explain carrying and overflow,and build complete Boolean truth tables. Trace and test original Python comparisons or use an accessible paper route. Year 7 placement is editorial within England’s KS3 Computing pathway.
Use binary place values and all sixteen patterns
Binary is a positional number system with two digits,zero and one. Decimal places use powers of ten; binary places use powers of two. For the original unsigned four-bit examples,write the weights eight,four,two,one from left to right. Each digit indicates whether that weight contributes. The representation 1011 means one eight,no four,one two and one one,not the decimal word one thousand and eleven.
The small subscript names the base; it is not another digit in the stored pattern. Leading zeroes preserve the width of a pattern without changing its unsigned value: 0011 represents three. A bit is a binary digit. A byte contains eight bits,whereas a four-bit group has only four. The symbol zero is a value,not an instruction to erase every other place.

To convert decimal thirteen,select eight,leaving five;select four,leaving one;do not select two;select one. The bits are 1101. Check by rebuilding the value eight plus four plus one. For decimal zero,select no weights and keep all four zeroes. For fifteen,select every weight. This method works for the stated non-negative four-bit range; negative or larger values need a different agreed representation.
| Unsigned four-bit pattern | Decimal value |
|---|---|
| 0000 | 0 |
| 0001 | 1 |
| 0010 | 2 |
| 0011 | 3 |
| 0100 | 4 |
| 0101 | 5 |
| 0110 | 6 |
| 0111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | 10 |
| 1011 | 11 |
| 1100 | 12 |
| 1101 | 13 |
| 1110 | 14 |
| 1111 | 15 |
Four positions with two choices each provide sixteen distinct patterns. The unsigned values run from zero to fifteen inclusive,so the number of values is sixteen while the greatest value is fifteen. Confusing those two quantities is a common boundary error. With eight unsigned bits there are 256 patterns and a largest value of255; that does not mean every byte must always be interpreted as a whole number.
The official Code.org How Computers Work series,on its current CodeAI channel,shows how binary digits can represent different data. Relate a numerical example to the original place weights. The complete written conversion table and native tasks remain available without the external player or sound. Original: CodeAI, How Computers Work: Binary & Data. The written explanations and native tasks work without sound or the external player.
Digital devices implement logical states using physical systems,such as ranges of electrical signal levels. A logical one is not a universal promise of exactly one volt,and an abstract zero need not mean every physical component is switched off. For our number reasoning,you need the agreed binary interpretation rather than a particular wiring design. Different interpretations of the same bits can encode a number,character,pixel component or instruction.
Add binary numbers and reason with truth tables
Binary addition follows place value and carrying. At one position,zero plus zero gives zero,zero plus one gives one,and one plus one gives binary10:write zero in that position and carry one to the next. If another one is already carried into one plus one,the total is binary11:write one and carry one. A carry has the value of one unit in the next place,not another independent one in the original place.
Work from the right. The ones column gives zero and a carry; the twos column also gives zero and a carry;the fours column gives zero and a carry;the eights column receives that carry and gives one. The result is binary1000,which represents decimal eight. Checking decimal seven plus one is a useful independent check,but the column explanation shows why the bit pattern changes.
Fifteen plus one needs the five-bit result10000. If a separately specified four-bit storage model keeps only the low four bits,the retained pattern would be0000 with an overflow/carry condition. That does not make the exact mathematical sum zero. Python's ordinary integers are not automatically restricted to four bits;do not assume this truncation happens in every programming language or every calculation.
Now distinguish arithmetic from Boolean logic. Boolean values are True and False. AND is True only when both inputs are True;inclusive OR is True when at least one is True,including when both are True;NOT reverses a Boolean input. In a truth table we may encode False as0 and True as1,but that convention does not turn every operation into ordinary numerical addition. One OR one is True,not a two-bit arithmetic answer10.
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| False | False | False | False | True |
| False | True | False | True | True |
| True | False | False | True | False |
| True | True | True | True | False |
The four rows cover every pair of Boolean inputs. There are two NOT outcomes even though NOT A repeats when B changes. In a circuit-style diagram,a two-input AND or OR element maps a pair to one output;NOT uses one input. You can draw labelled boxes and connections on paper using these tables. This is a logical simulation,not a specification for wiring real equipment or a physical safety controller.

Brackets can change the meaning of a compound expression. Compare the rule “A OR B,then AND C” with “A OR the result of B AND C”. With A True,B False and C False,the first result is False and the second True. Write brackets to make the intended grouping visible rather than trusting that natural-language punctuation or a neat diagram removes ambiguity.
Circuits and logic: the official Code.org How Computers Work series on its current CodeAI channel. Identify AND,OR and a changed input,and compare with the independently written truth table. Use the written Boolean rules and paper diagrams as the offline alternative.
Test a compound decision and original conversion functions
Build and test an explicit compound decision. In an original fictional learning scene,show a ready state only when a model pass is present,the briefing is complete,and the scene is not paused. These inputs are three supplied Boolean values,not a real permission check or a claim about a person's identity. The rule is “has_pass AND briefing_complete AND NOT paused”.
| has_pass | briefing_complete | paused | Ready output |
|---|---|---|---|
| False | False | False | False |
| False | False | True | False |
| False | True | False | False |
| False | True | True | False |
| True | False | False | False |
| True | False | True | False |
| True | True | False | True |
| True | True | True | False |
Eight rows cover all combinations of three Boolean inputs. Only True,True,False gives Ready True. A pause overrides the otherwise-ready combination. If someone mistakenly uses OR between the first two requirements,True,False,False becomes a counterexample:the correct rule is False,because the briefing is not complete. Use a revealing input to diagnose a wrong expression rather than trying only the one successful case.
The following original optional Python functions implement the four-bit conversions and this separate decision. The main course can be completed with place-value cards,truth tables and written traces. These functions have no file,network,account or real-device effects;they use explicitly limited input contracts and return results to the caller.
def from_four_bits(bits):
if type(bits) is not str or len(bits) != 4:
raise ValueError("Use exactly four binary digits as text")
value = 0
for digit in bits:
if digit not in ("0", "1"):
raise ValueError("Only zero and one are binary digits")
value = value * 2 + int(digit)
return valueThe decoder begins with zero. For each new digit,multiply the accumulated value by two and add that digit. For1011,the successive values are one,two,five,eleven. Each shift makes room for the next binary digit. The function requires exactly four text characters and rejects anything except zero or one;it does not silently treat1021 as a valid binary pattern or discard an unwanted fifth digit.
def to_four_bits(value):
if type(value) is not int or not (value >= 0 and 15 >= value):
raise ValueError("Use an integer from 0 to 15")
remaining = value
bits = ""
for power in range(3, -1, -1):
weight = 2 ** power
if remaining >= weight:
bits = bits + "1"
remaining = remaining - weight
else:
bits = bits + "0"
return bitsThe encoder tests weights eight,four,two,one in that order and retains leading zeroes. For thirteen,the remainder is five after eight,one after four,still one when two is skipped,and zero after one,giving1101. It rejects negative numbers,sixteen and non-integer values. In Python a Boolean can have some numeric behaviour,but this explicit contract deliberately rejects it as an integer-input substitute.
def scene_ready(has_pass, briefing_complete, paused):
if any(type(value) is not bool for value in
(has_pass, briefing_complete, paused)):
raise ValueError("Use Boolean inputs")
return (has_pass and briefing_complete) and not pausedThe decision requires actual Boolean values and returns a Boolean. The strings 'True' and 'False' are not accepted as truth values by this contract. Python's and/or can return operands when arbitrary objects are used,so the truth-table comparison here deliberately uses Boolean operands. Defining the functions does not automatically run a live quiz or change MOOCwiki's learning-point rules.

The exact functions were actually checked for all sixteen four-bit values in both directions,and the decision for all eight Boolean combinations. Invalid lengths,digits,number ranges and incorrect value types were also checked. A round trip alone is not enough:two wrong functions could reverse each other while sharing the same mistake. Compare each result with independently specified place values or known integer conversion as well as round-trip agreement.
For a complete practice portfolio,show the entire zero-to-fifteen table,convert thirteen and eleven with intermediate reasoning,trace seven plus one including each carry,and explain the five-bit result for fifteen plus one. Add all AND/OR/NOT rows and the complete three-input readiness table. If you run the optional code,record actual results separately from predictions;reading the checked source is not evidence that a learner executed it.
For transfer,change the fictional scene rule so either a model pass or a model invitation can satisfy the first requirement,while the briefing must still be complete and pause must still be False. Add the new Boolean input,brackets and all required table rows. If you later change number width or signed interpretation,update the range and tests explicitly rather than reusing unsigned four-bit answers without review.
Interactive Tasks
Quiz: Test Your Knowledge
What does the unsigned four-bit pattern one-zero-one-one represent? (Eleven from eight plus two plus one) (!One thousand and eleven because the digits look decimal) (!Thirteen from eight plus four plus one) (!Sixteen because every four-bit pattern has value sixteen)
How many distinct unsigned four-bit patterns exist? (Sixteen patterns representing values zero through fifteen) (!Fifteen patterns because zero is excluded) (!Eight patterns because a byte has eight bits) (!Seventeen patterns because both endpoints are counted twice)
What is the original four-bit pattern for decimal thirteen? (One-one-zero-one) (!One-zero-one-one) (!One-one-one-zero) (!Zero-one-zero-one)
What does binary seven plus one produce exactly? (Binary one-zero-zero-zero,representing eight) (!Binary zero-one-one-one because carries never change bits) (!Decimal ten because one plus one is written ten in every base) (!A guaranteed four-bit overflow even though eight fits)
What is the exact result of binary fifteen plus one? (A five-bit one followed by four zeroes,representing sixteen) (!Zero as a mathematical sum whenever four bits were used before) (!Fifteen because an extra one is silently ignored in all languages) (!The Boolean True instead of a numerical result)
What is inclusive OR when both Boolean inputs are True? (True because at least one input is True) (!False because exactly one input must be True) (!The integer two as an arithmetic sum) (!Undefined because the truth table has no such row)
Which original readiness inputs produce True? (Pass True,briefing True,pause False) (!Pass True,briefing False,pause False) (!Pass False,briefing True,pause False) (!Pass True,briefing True,pause True)
What does the original decoder do with a text pattern containing digit two? (Reject it rather than treating it as a valid binary digit) (!Convert it automatically as a signed four-bit number) (!Ignore the digit and claim an unchanged four-bit pattern) (!Create a real account permission from the pattern)
Why compare conversions with an independent reference as well as a round trip? (Two incorrect functions could share an error while undoing each other) (!A round trip always proves every claimed number system property) (!Independent place values are irrelevant to conversion correctness) (!A screenshot of unrelated code proves every function result)
What must change when the number width or interpretation changes? (The stated range,representation rules and expected tests) (!Only the photograph caption while every old answer stays universal) (!Nothing,because all binary patterns always mean unsigned four-bit integers) (!The actual MOOCwiki point formula without any new specification)
Memory Game
| Bit | One binary digit |
| Byte | A group of eight bits |
| Place value | The weight assigned to a digit position |
| Carry | A contribution passed to the next higher place |
| AND | True only when both Boolean operands are True |
| Inclusive OR | True when at least one Boolean operand is True |
Drag and Drop
| Four bits are claimed to have greatest unsigned value sixteen | Correct the maximum to fifteen while retaining sixteen distinct patterns |
| One plus one occurs in a binary column | Write zero in that column and carry one to the next |
| Both inputs to inclusive OR are True | The Boolean output is True |
| The briefing is incomplete but the pass is True and pause False | The original readiness rule remains False |
| A five-bit mathematical result is forced into four retained bits | State the truncation rule and overflow separately from the exact sum |
Crossword Puzzle
| BINARY | What positional system uses two digits? |
| DIGIT | What symbol occupies a place in the representation? |
| PLACE | What word describes the weighted position of a digit? |
| CARRY | What moves a contribution to the next higher column? |
| CONJUNCTION | What is another name for Boolean AND? |
| NEGATION | What logical action reverses a Boolean value? |
LearningApps
Optional extra practice. Choose an appropriate activity with your teacher. If the external collection is unavailable, use the native activities and independent tasks in this course.
Cloze Text
Open Tasks
Easy
- Build four weights: Use eight,four,two,one cards to represent zero,three,eleven,thirteen and fifteen.
- Explain a boundary: Distinguish the number of patterns from the greatest unsigned value.
- Trace a carry: Show each column in binary seven plus one.
- Complete two-input logic: Write all AND,OR and NOT outcomes using actual Boolean values.
Standard
- Trace the decoder: Follow one-zero-one-one through the successive accumulated values.
- Trace the encoder: Convert thirteen using descending weights and explicit remainders.
- Audit the scene: Complete all eight original readiness combinations and justify the single True row.
- Find a grouping counterexample: Use the stated A,B,C values to distinguish the two bracketed expressions.
Advanced
- Explain overflow: Separate the exact fifteen-plus-one result from a stipulated low-four-bit storage rule.
- Test the actual functions: Run valid and invalid cases where possible,using independent expected results as well as round trips.
- Extend the scene: Add an invitation alternative,retain briefing and pause requirements,and specify the expanded truth table.
- Change representation: Explain what a new bit width or signed interpretation changes,without claiming old unsigned answers are universal.
Learning Check
- Place values and conversions: Reconstruct the two original target values.
- Pattern count and carrying: Distinguish cardinality,largest value and column addition.
- Overflow and interpretations: Explain the exact result and a separate fixed-width storage model.
- Complete Boolean logic: Evaluate tables and a grouping counterexample.
- Original scene decision: Justify all requirements rather than one favourable case.
- Program evidence and transfer: Check independent results and update assumptions when extending.
Worked checks and assessment guidance
- The pattern1011 represents eight plus two plus one,so decimal eleven. Decimal thirteen uses eight,four and one,giving1101. Leading zeroes retain width without adding unsigned value. All sixteen four-bit patterns map exactly to zero through fifteen. A byte has eight bits;the four-bit learning group is not itself a full byte.
- Four positions with two choices give sixteen patterns,with greatest unsigned value fifteen because zero is included. In0111 plus0001,the ones,twos and fours each write zero and carry one onward;the eights place receives one,giving1000 or decimal eight. Decimal seven plus one independently checks the result without replacing the column explanation.
- 1111 plus0001 is10000,decimal sixteen,requiring five bits. A stipulated four-bit model retaining only low bits would store0000 with overflow/carry information,not change the exact sum to zero. Ordinary Python integers do not automatically wrap at four bits. The same binary pattern can have another meaning under a different signed,width,character or data interpretation.
- AND is True only for True,True;inclusive OR is True for either single True and also both True;NOT reverses each Boolean input. With A True,B False,C False,the grouped rule A-or-B then AND C is False,while A OR the grouped B-and-C is True. Use explicit brackets and Boolean operands rather than confusing logical OR with numerical addition.
- Ready requires pass True,briefing True and pause False;the other seven combinations are False. A pass with briefing incomplete and pause False exposes an incorrect OR between the first two requirements. The Python function requires Boolean inputs and models a fictional scene only. It does not authenticate anyone,wire equipment or change platform learning points.
- The decoder and encoder were actually checked on all sixteen values against independent conversion expectations and round trips;the scene function against all eight Boolean combinations,plus invalid input cases. A learner must distinguish their own actual run from a paper prediction. Adding a pass-or-invitation alternative expands the input table while briefing and not-paused remain required. Changing width or signed meaning requires new ranges and expected tests.
Learning evidence
Submit the complete zero-to-fifteen table,two worked conversions,column carrying and overflow explanations,all two-input truth rows and the full original three-input scene table. Add an explicit grouping counterexample and,if executed,the original program files with expected/actual valid and invalid test results. Paper cards and traces remain accessible alternatives;do not label them actual program execution.
OER and Wikipedia
Original four-bit conversion table,addition examples,Boolean tables,fictional scene,Python functions and assessments. DfE Computing programme of study, KS3 logic and binary representation;Year7 placement is editorial. University of Canterbury CS Unplugged binary topic supports the place-value concept;no source activity or worksheet is reproduced. Python Software Foundation built-in types supports Boolean semantics and integer representation. The official Code.org/CodeAI video library identifies the original binary/data and circuits/logic videos. Primary sources checked13November2026. All three Commons originals retain credits and licences and are identified as contextual illustrations rather than original conversion,gate or readiness diagrams.
Toy Blocks (50995087111).jpg, ajay_suresh, CC BY 2.0. Unchanged original; caption and learning activities are original.
Personal computer, exploded.svg, Gustavb, CC BY 2.5. Unchanged original; caption and learning activities are original.
Python Code.jpg, Weal2019, CC0. Unchanged original; caption and learning activities are original.
Linked learning areas
aiMOOC Projects
Schulfach+


aiMOOCs


aiMOOC Projekte


MOOCwiki · Deutsch
Nach dem Lernen ist vor dem Lernen
Entdecke direkt den nächsten Lernkurs. Weitere Inhalte erscheinen, wenn Du weiter nach unten scrollst.
Zur MOOCwiki-HauptseiteMediathek
Mediathek wird aus dem Wiki geladen ...
Keine passenden Inhalte gefunden. Bitte ändere Suche oder Filter.
NEWSLernweltNOAH fragen