Binary and Number Systems
Everything inside a digital radio — every frequency calculation, every stored setting, every decoded character — is ultimately represented as a sequence of ones and zeros. Before you can understand how digital circuits work, how software defined radio processes signals, or why your radio's firmware update is 131,072 bytes long, you need to understand the binary number system and how to move between binary and the decimal numbers you use every day.
This is not difficult. Binary is just a different way of counting — one that uses only two symbols instead of ten. Once the logic clicks, you will find binary completely natural, and you will start noticing it everywhere in your radio hobby.
Binary and decimal equivalents from 0 to 15, showing how the four bit positions carry weights of 8, 4, 2, and 1.
View LargerWhy Digital Circuits Use Binary
Imagine you are designing a circuit that needs to store a number. You could try to store an exact voltage — say, 3.7 volts means "37" and 1.2 volts means "12." The problem is that voltages drift with temperature, sag under load, and pick up noise from nearby circuits. By the time you try to read back "3.7 volts," you might get 3.6 or 3.9, and you have no idea whether the original value was 37 or 36 or 39.
Now instead, let us agree on just two states: "LOW" means any voltage below about 0.8 V and "HIGH" means any voltage above about 2.0 V. The exact voltage does not matter as long as it falls into one of the two bins. Noise, temperature changes, and component aging can shift a LOW signal from 0.1 V to 0.5 V without any ambiguity — it is still clearly LOW. A HIGH signal can vary from 2.1 V to 3.3 V and still read correctly.
This two-state approach is the foundation of all digital electronics. Each circuit element can be in exactly one of two states, which we call 0 and 1. The number system that uses only 0 and 1 is binary, or base 2. Every piece of information in a digital radio — whether it is a received frequency, a decoded callsign, a stored memory, or a software instruction — is represented as a combination of 0s and 1s, because those are the only two values a digital circuit can reliably hold.
Counting in Binary
You already know how to count in decimal. You start at 0 and increment: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. When you run out of single-digit symbols, you roll over to the next column: 10, 11, 12... This is counting in base 10, using ten symbols (0 through 9).
Binary works exactly the same way, but you only have two symbols: 0 and 1. Count up: 0, 1 — and now you are already out of symbols! So you roll over to the next column, just like going from 9 to 10 in decimal. In binary, after 1 comes 10 (one-zero, not "ten"). Then 11, and then you need another column: 100, 101, 110, 111, 1000...
Here is a side-by-side comparison of decimal and binary for the first sixteen numbers:
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | 10 | 1010 |
| 3 | 0011 | 11 | 1011 |
| 4 | 0100 | 12 | 1100 |
| 5 | 0101 | 13 | 1101 |
| 6 | 0110 | 14 | 1110 |
| 7 | 0111 | 15 | 1111 |
Notice that with 4 binary digits (bits), you can represent decimal values 0 through 15 — that is 16 different values. With 8 bits you get 256 values (0 through 255). With 16 bits you get 65,536 values. The number of different values you can represent with N bits is always 2N.
Positional Notation and Powers of Two
In the decimal system, each column position represents a power of 10. The rightmost column is the ones place (100 = 1), the next is the tens place (101 = 10), the next hundreds (102 = 100), and so on. The number 347 means (3 × 100) + (4 × 10) + (7 × 1) = 347.
Binary uses exactly the same positional logic, but with powers of 2 instead of powers of 10. From right to left, the bit positions have weights: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024...
- Bit 0 (rightmost) = 20 = 1
- Bit 1 = 21 = 2
- Bit 2 = 22 = 4
- Bit 3 = 23 = 8
- Bit 4 = 24 = 16
- Bit 5 = 25 = 32
- Bit 6 = 26 = 64
- Bit 7 = 27 = 128
The bit on the far right is called the least significant bit (LSB). The bit on the far left is the most significant bit (MSB).
To find the decimal value of a binary number, you simply add up the weights of all the bit positions where a 1 appears.
Converting Binary to Decimal
Write down the binary number, identify which bit positions contain a 1, and add up those positions' weights.
Write the bit positions with their weights:
- Bit 3 (weight 8): value = 1 → contributes 8
- Bit 2 (weight 4): value = 0 → contributes 0
- Bit 1 (weight 2): value = 1 → contributes 2
- Bit 0 (weight 1): value = 1 → contributes 1
Total: 8 + 0 + 2 + 1 = 11 decimal
This is an 8-bit number. List the bit positions from MSB (bit 7) to LSB (bit 0):
- Bit 7 (128): 1 → 128
- Bit 6 (64): 0 → 0
- Bit 5 (32): 1 → 32
- Bit 4 (16): 1 → 16
- Bit 3 (8): 0 → 0
- Bit 2 (4): 1 → 4
- Bit 1 (2): 0 → 0
- Bit 0 (1): 0 → 0
Total: 128 + 32 + 16 + 4 = 180 decimal
Converting Decimal to Binary
The standard method is repeated division by 2. Divide the decimal number by 2 and record the remainder. Divide the result again by 2 and record the remainder. Continue until the result is 0. The binary number is the sequence of remainders read from bottom to top.
- 43 ÷ 2 = 21, remainder 1
- 21 ÷ 2 = 10, remainder 1
- 10 ÷ 2 = 5, remainder 0
- 5 ÷ 2 = 2, remainder 1
- 2 ÷ 2 = 1, remainder 0
- 1 ÷ 2 = 0, remainder 1
Reading remainders from bottom to top: 101011
Verify: 32 + 8 + 2 + 1 = 43 ✓
An alternative method that many people find faster: start with the largest power of 2 that fits inside the number, write a 1, subtract it, and repeat with the remainder. For 43: the largest power of 2 that fits is 32 (25), so bit 5 = 1, remainder 11. Largest power fitting in 11 is 8 (23), so bit 3 = 1, remainder 3. Largest fitting in 3 is 2 (21), so bit 1 = 1, remainder 1. Finally 1 = 1 × 20, so bit 0 = 1. Fill in zeros for the remaining positions: 101011.
Binary / Decimal Calculator
Binary to Decimal Converter
Enter a binary number (only 0s and 1s, up to 32 bits). The decimal equivalent is shown immediately.
Decimal to Binary Converter
Enter a positive decimal integer (0 to 4,294,967,295). The binary equivalent and bit breakdown are shown.
Binary Arithmetic
Binary Addition
Binary addition uses the same column-by-column process as decimal addition, with carry propagation. The rules are simple:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (zero, carry 1)
- 1 + 1 + 1 (carry) = 11 (one, carry 1)
1011 (11) + 0110 ( 6) ------ 10001 (17)
Column by column from right: 1+0=1; 1+1=10, write 0 carry 1; 0+1+1(carry)=10, write 0 carry 1; 1+0+1(carry)=10, write 0 carry 1; 0+0+1(carry)=1. Result: 10001 = 16+1 = 17 ✓
Overflow
When the result of an addition requires more bits than are available, the high bits are lost — this is called overflow. For example, if you are working with 4-bit numbers (maximum value 15) and you add 12 + 9 = 21, the correct result 10101 requires 5 bits. Keeping only 4 bits gives 0101 = 5, which is wrong. Digital circuits must detect and handle overflow conditions.
Two's Complement: Negative Numbers
Ordinary binary can only represent non-negative integers. To handle negative numbers, digital systems use a scheme called two's complement. In two's complement, the most significant bit is not just a regular bit — it is the sign bit. If the sign bit is 0, the number is positive or zero. If the sign bit is 1, the number is negative.
To find the two's complement of a number (i.e., to negate it), the procedure is:
- Write the number in binary
- Flip every bit (0 becomes 1, 1 becomes 0) — this is called one's complement
- Add 1 to the result
- +5 in binary: 00000101
- Flip all bits (one's complement): 11111010
- Add 1: 11111010 + 00000001 = 11111011
So −5 is represented as 11111011 in 8-bit two's complement.
Verify: the sign bit is 1 (negative). Apply the same process to get back to +5: flip bits to get 00000100, add 1 to get 00000101 = 5. ✓
The elegant property of two's complement is that ordinary binary addition works correctly for both positive and negative numbers. If you add +5 (00000101) and −5 (11111011), you get 00000000 (with a carry out of the 8-bit range that is discarded). The result is correctly zero.
- 8-bit signed: −128 to +127
- 16-bit signed: −32,768 to +32,767
- 32-bit signed: −2,147,483,648 to +2,147,483,647
Unsigned (no negative numbers): 8-bit = 0 to 255; 16-bit = 0 to 65,535; 32-bit = 0 to 4,294,967,295.
Bits, Bytes, and Word Lengths
A single binary digit — one 0 or one 1 — is called a bit. Eight bits grouped together form a byte. A byte can hold values from 0 to 255 (unsigned) or −128 to +127 (signed two's complement).
Groups of 16 bits are called a word or short integer; groups of 32 bits are a long word or double word (DWORD); 64-bit groups are a quad word. Modern processors work on 32-bit or 64-bit numbers in a single operation.
Data storage is measured in multiples of bytes. One kilobyte (kB) is 1,024 bytes (210), not 1,000 bytes as the SI prefix would suggest — this is because binary storage is naturally organized in powers of 2. One megabyte (MB) = 1,024 kB = 1,048,576 bytes. One gigabyte (GB) = 1,073,741,824 bytes.
Binary in Ham Radio
Binary arithmetic is not abstract theory — it shows up constantly in amateur radio work:
Firmware and memory sizes. When your transceiver receives a firmware update, the file size is typically an exact power of 2 or a multiple of 1,024 bytes. A "64k flash memory" chip holds exactly 65,536 bytes (216 = 64 × 1,024). The memory map in a radio's service manual is written in hexadecimal, a compact shorthand for binary that the next lesson covers in detail.
Frequency tuning resolution. The frequency display in your transceiver is backed by a binary counter or a direct digital synthesis (DDS) chip. The tuning step size depends on the number of bits in the frequency register. A 32-bit frequency word with a 100 MHz reference clock gives a step size of 100,000,000 / 232 ≈ 0.023 Hz — fine enough for any amateur purpose.
Digital modes. FT8 transmits 8-symbol packets. Each symbol is one of 8 tone choices (0 through 7). Three bits are needed to represent 8 choices (23 = 8). PSK31 encodes ASCII characters using varicode, a binary code where common characters are assigned short bit sequences and rare characters longer ones — a form of Huffman coding that compresses data before transmission.
Analog-to-digital converters (ADC). The ADC in a software-defined radio samples the incoming RF signal and produces a binary number for each sample. A 12-bit ADC produces numbers from 0 to 4,095 (212 − 1). A 16-bit ADC reaches 65,535. Each additional bit roughly doubles the precision of the measurement, adding about 6 dB of dynamic range.
CW memory and macro storage. Most modern transceivers store CW messages and keyboard macros as ASCII text, where each character is represented by a 7-bit or 8-bit binary code. The ASCII code for the letter "A" is 65 decimal = 01000001 binary. The ASCII code for "K" (as in "over") is 75 = 01001011.
Experiment: Count in Binary with LEDs
Make binary counting visible by using four LEDs as display bits. This requires no soldering — everything goes on a breadboard.
- Breadboard
- 9 V battery and clip
- 4 × red LEDs
- 4 × 470 Ω resistors
- Jumper wires
- Insert the four LEDs in a row on the breadboard. Label them (mentally or with tape) D3, D2, D1, D0 from left to right, representing bits 3, 2, 1, 0.
- Connect a 470 Ω resistor in series with the anode of each LED. Connect the cathode of each LED to the negative rail. Connect the positive rail to the 9 V battery positive terminal and the negative rail to the battery negative.
- Wire each resistor's free end to a separate jumper wire that you can touch to the positive rail (battery +) to turn that LED on, or leave floating/low to turn it off.
- Start with all LEDs off (0000 binary = 0 decimal). Then turn on only D0: 0001 = 1. Then only D1: 0010 = 2. Then D1 and D0: 0011 = 3. Continue through all 16 states from 0000 to 1111.
- Try to light up specific values: set 1010 (decimal 10), then 1101 (decimal 13), then 1111 (decimal 15).
Frequently Asked Questions
Do I need to be able to do binary conversions in my head as a ham operator?
For day-to-day operation, no — you will usually use a calculator or your radio's built-in display. But understanding binary well enough to read a memory map, interpret an error code, or debug a digital mode problem is genuinely useful. The conversion technique using powers of 2 is quick enough to do mentally for small numbers (up to 8 bits), which covers the most common cases.
What is the difference between a bit and a byte?
A bit is a single binary digit — the smallest possible unit of digital information, holding only a 0 or a 1. A byte is 8 bits grouped together, giving 256 possible values (0 to 255). Data transmission speeds are measured in bits per second (bps or Mbps), while storage sizes are measured in bytes (kB, MB, GB). Confusingly, networking bandwidth is in bits but file sizes are in bytes — so a 10 Mbps connection transfers about 1.25 megabytes per second (10 ÷ 8 = 1.25).
Why does 1 kilobyte equal 1,024 bytes rather than 1,000 bytes?
Because computer memory is addressed in powers of 2. The nearest power of 2 to 1,000 is 210 = 1,024. Calling this "kilo" was informal but became universal in computing. To reduce confusion, the official standard now uses "kibibyte" (KiB) for 1,024 bytes and reserves "kilobyte" (kB) for 1,000 bytes — though most radio and computer people still say "kilobyte" when they mean 1,024.
Is hexadecimal the same as binary?
No, but it is closely related. Hexadecimal (base 16) is a compact way of writing binary numbers. Every 4 binary bits correspond to exactly one hexadecimal digit, because 24 = 16. So the 8-bit binary number 10110100 can be written as the two-digit hex number B4 (where B = 1011 and 4 = 0100). Hexadecimal is covered fully in the next lesson.
What does "32-bit transceiver" or "64-bit DSP" mean?
It refers to the width of numbers the processor handles in a single operation. A 32-bit processor can add, multiply, or compare two 32-bit numbers in one clock cycle. A wider word length means the processor can work with more precise numbers and larger memory addresses. In audio DSP, 32-bit or 64-bit floating point arithmetic allows very high dynamic range computation — signals can be multiplied, filtered, and combined many times without losing precision due to rounding errors.
Test Your Knowledge
Answer the questions below to check your understanding. Every answer can be found in the lesson above.