Late September 2026: in Year 1 of the technology track at Italian technical institutes, the subject Tecnologie informatiche (information technology) has just finished (or is finishing) the introduction to computer architecture and is moving into the block on bits, bytes and number systems. Binary arrives between the end of September and mid-October. The first test falls four to seven weeks later, so between the end of October and the start of November — and in most schools it is a structured test: conversions, true/false, short exercises with points, not an essay to write out in prose.
It often happens that someone who enrolled at a technical institute “because they like computers” is thrown by this start: they expected to write code and instead spend weeks converting numbers to base 2. It is worth explaining why you start exactly there, because it is not a whim of the syllabus: before programming a computer you need to know how that computer represents information — and binary and hexadecimal are exactly that.
Why you start from binary and not from code
A computer, at the physical level, distinguishes only two states: current flowing or not flowing, high or low voltage. Every piece of information — numbers, text, images, sounds — has to be translated into sequences of these two states, which we call 0 and 1: bits (binary digits). A programming language, however abstract, in the end always produces only sequences of bits that the machine executes. Understanding how a positional number system in base 2 works is not an exercise in itself: it is the first step to understanding what really happens “underneath” a program, before even writing one.
In Year 1, the lab that goes with the theory is not yet devoted to a real programming language: at most you work with a block-based environment or write your first algorithms in pseudocode and flowcharts. Most of the “technical” work of these weeks is numerical conversions, and those are exactly what is assessed in the first test.
Bits, bytes and multiples: the ambiguity nobody tells you about
A bit is a single binary digit, 0 or 1. A byte is a group of 8 bits, and a byte can represent different configurations (from 0 to 255). From here you go up with multiples, and this is where one of the most common confusions arises:
- in commercial computing (disks, network connections), 1 kB (kilobyte) = 1000 bytes, following the decimal system;
- in the machine’s “real” computing (RAM, internal data handling), 1 KiB (kibibyte) = 1024 bytes, that is , because the computer thinks in powers of 2.
This distinction, often neglected in popular texts, is exactly the reason why a disk sold as “1 TB” shows about 931 GiB in the operating system: the manufacturer counts in base 1000 (decimal), the operating system shows the value in base 1024 (binary). It is not a defect of the disk: they are two ways of counting the same number of bytes.
Positional systems: decimal, binary, hexadecimal
The decimal system we all use every day is positional in base 10: each digit is worth its own value multiplied by a power of 10, according to the position it occupies. For example:
The binary system works identically, but in base 2: each digit (0 or 1) is worth a power of 2 according to its position. The hexadecimal system works in base 16, with sixteen symbols: the digits 0 to 9 and then the letters A, B, C, D, E, F to represent the values 10 to 15.
Hexadecimal is not “just another random system”: it exists because a single hexadecimal digit represents exactly 4 bits. A byte (8 bits) is therefore written with just two hexadecimal digits, and this is why memory addresses, colours and technical codes are almost always written in hexadecimal rather than binary: it is much more compact to read and to write by hand, while remaining in direct and immediate correspondence with the bits.
Decimal → binary conversion: successive divisions by 2
The standard method for converting a decimal number to binary is to divide repeatedly by 2, noting the remainder at each step, until the quotient reaches 0. The remainders read from bottom to top (from the last calculated to the first) form the binary number.
Worked example 1 — convert 45 to binary:
| Division | Quotient | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from bottom to top: . So .
Worked example 2 — convert 156 to binary:
| Division | Quotient | Remainder |
|---|---|---|
| 156 ÷ 2 | 78 | 0 |
| 78 ÷ 2 | 39 | 0 |
| 39 ÷ 2 | 19 | 1 |
| 19 ÷ 2 | 9 | 1 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
From bottom to top: . So . Quick check: , it matches.
Binary → decimal conversion: the weights of the powers of 2
The reverse path is more direct: you multiply each binary digit by the weight of its position (a power of 2 increasing from right to left, starting from ) and add up the results.
Worked example — convert to decimal:
So .
Binary ↔ hexadecimal in groups of 4 bits
To convert from binary to hexadecimal, you group the binary digits in fours starting from the right (adding zeros on the left if needed to complete the last group), then convert each group of 4 bits into its hexadecimal digit.
Take again (the 156 from before): split into groups of 4 it is . The first group , the second . So . Check: , it matches.
Addition in binary with carry
Addition in binary follows the same rules as the column addition you already know, with only the digits changing: , , (write 0, carry 1), (write 1, carry 1).
Worked example — add (11) and (6):
1 1 ← carries
1 0 1 1
+ 0 1 1 0
---------
1 0 0 0 1
Column by column from the right: ; , write 0 carry 1; , write 0 carry 1; , write 0 carry 1, which goes into an extra column on the left. Result: . Check in decimal: , and . It matches.
Range of values on n bits: why a byte goes up to 255
With bits available you can form exactly different configurations, and so represent distinct values. If you start counting from 0 (as a computer always does), the maximum representable value is , not . It is the same reason why a byte (8 bits) represents values, which run from 0 to 255, not from 0 to 256.
Worked exercise — how many bits are needed to represent 100 different values? You need the smallest such that . With , , which is not enough. With , : 7 bits are enough.
How characters are represented: ASCII and a note on UTF-8
Numbers are not the only thing a computer has to represent in binary: text also has to be translated into sequences of bits. The historic standard is ASCII, which assigns to every letter, digit and symbol a number from 0 to 127 (so representable on 7 bits): the capital letter A is the number 65, the lowercase a is 97. ASCII is enough for the English alphabet, but not for accented letters, other alphabets or emoji: that is why today we use UTF-8, a more recent standard that represents a much larger number of characters using from 1 to 4 bytes per character, staying compatible with ASCII for the first 128 values. In Year 1 it is enough to know that these standards exist and what they are for; the details of UTF-8 are not part of this year’s syllabus.
Typical mistakes that cost marks
| Typical mistake | How you notice it |
|---|---|
| Reading the division remainders from top to bottom instead of from the bottom | The binary number comes out “backwards”: convert back to decimal to check, and if it doesn’t match you read the remainders the wrong way round |
| Mixing up the weights of the powers of 2 | Always write the powers above each binary digit before adding, starting from the right with |
| Getting the carry wrong in binary addition | Redo the column by hand: always generates a carry, don’t forget it in the next column |
| Confusing kB (1000 bytes) and KiB (1024 bytes) | Ask yourself whether the context is commercial (disks, networks: base 1000) or internal to the machine (RAM: base 1024) |
| Thinking that with bits you reach | The computer starts counting from 0: the maximum is always , like 255 on a byte |
Where you meet binary outside the test
Binary and hexadecimal don’t stay confined to this module: you will meet them, under different names, in three very concrete situations.
- Colours on web pages and in graphics are written in hexadecimal, like
#FF8800: three pairs of hexadecimal digits, one for red, one for green, one for blue, each a byte (0-255 in decimal, 00-FF in hexadecimal). - The IP addresses that identify every device on a network are 32-bit numbers, written in decimal in groups of 8 bits (one byte) for readability — it is the same conversion logic you are learning now, only applied to four bytes together.
- File permissions on Linux, the ones you see as
rwxr-xr--, are also represented as a three-digit octal (base 8) number, like754: each digit encodes three bits (read, write, execute) for owner, group and others.
How to prepare for a structured test
A structured test on this topic doesn’t reward those who can “explain” binary, but those who convert quickly and without mistakes. Some practical tips:
- Make the table of powers of 2 automatic up to (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024): knowing it by heart removes half the calculation mistakes under time pressure.
- Always check the conversion backwards: if you convert 45 to binary, convert the result back to decimal before handing in. A thirty-second check avoids a silly mistake.
- Always write out the remainders and the weights in full, even in “quick” exercises: the time you seem to lose you win back in mistakes avoided.
- Practise the conversion in groups of 4 bits for hexadecimal: it is a mechanical operation, faster than going through decimal as an intermediate step.
For information technology we don’t yet have a dedicated practice test; at /simulazioni/liceo/ you’ll find the high school maths and physics tests, which remain the closest category for practising timed exercises — I’m not promising that a specific practice test on this topic will arrive, but if it does you’ll find it there.
Whoever has got past this hurdle arrives more calmly at the next step too, loops and arrays in Year 3 computer science, where you go back to reasoning about indexes and data structures with the same logic but inside a real programming language. And if in Year 1 you are also tackling chemistry in Experimental sciences, the approach to preparing — understand the method before repeating by heart — is the same in both subjects.
In the same year you also cover spreadsheets: I explained it in the post on spreadsheets and algorithms. For the next step on binary, negative numbers, go to two’s complement and floating point.
Computer science lessons are online, one to one, and start from where you are stuck — often exactly from a step in the conversion method, not from the theory itself. If you’d like a hand, the first introductory call is free and lasts half an hour.