Method 1: Divide by 2 Shortcut (Most Common and Easiest)
Divide the number by 2.
Example: Convert 13 to binary
| Division | Quotient | Remainder |
|---|---|---|
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
When the quotient is 0, stop.
Now read remainders from bottom to top:
So, 13 (decimal) = 1101 (binary)
Method 2: Tip for Small Numbers (Head Method):
You can memorize powers of 2:
| Power of 2 | Value |
|---|---|
| 2⁷ | 128 |
| 2⁶ | 64 |
| 2⁵ | 32 |
| 2⁴ | 16 |
| 2³ | 8 |
| 2² | 4 |
| 2¹ | 2 |
| 2⁰ | 1 |
“Can this power of 2 be used to build my number?”
Example: Convert 19 to binary using powers of 2
Write it:
What is Vernam Cipher?
HELLOXMCKLEQNVZ.Vernam Cipher (Using XOR)
| Bit P | Bit K | Result (C = P ⊕ K) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
So, XOR flips bits when the key bit = 1, and keeps bits the same when the key bit = 0.
How it Works (Step by Step)
A=0, B=1, …, Z=25).Example 1
Example 2:
Summary