lesson

Updated 6 days ago Β· 2 views
Every processor in your phone or microcontroller inside a robot runs entirely on electrical switches that are either ON (1) or OFF (0).
To feed everyday numbers into digital circuits, we must convert standard base-10 numbersβknown as denary (or decimal)βinto base-2 binary.
In 1703, mathematician Gottfried Wilhelm Leibniz documented modern binary in his paper Explication de l'ArithmΓ©tique Binaire, proving that any integer can be expressed using only two digits.
How do we translate a number like 53 into a sequence of high and low voltage bits?
Method 1: The Place-Value Subtraction Method
Just like base-10 uses place values of 1,10,100, base-2 uses powers of 2: 1,2,4,8,16,32,64,128 from right to left.
To convert by subtraction, find the largest power of 2 that fits into your target number, place a 1 in that column, subtract it, and repeat with the remainder.
πA clean, horizontal visual breakdown of the place-value method converting 53 into an 8-bit binary number (00110101). Show 8 bit columns: 128, 64, 32, 16, 8, 4, 2, 1. For each column, show a card with the power of 2 value at the top, the binary bit (0 or 1) in the middle, and a running subtraction note below: '128 > 53 -> 0', '64 > 53 -> 0', '53 - 32 = 21 -> 1', '21 - 16 = 5 -> 1', '8 > 5 -> 0', '5 - 4 = 1 -> 1', '2 > 1 -> 0', '1 - 1 = 0 -> 1'. Active '1' cards have an electric cyan border (#00b4d8) and soft glow, '0' cards are muted light gray (#f1f3f5). High contrast dark navy text (#1e2945). Responsive down to 350px.
Let's trace denary 53: 32 fits into 53 leaving 21; 16 fits into 21 leaving 5; 4 fits into 5 leaving 1; and 1 fits into 1 leaving 0.
Summing the active place values gives 32+16+4+1=5310β, producing the 8-bit byte 00110101β.
Place-value subtraction is quick in your head, but what happens when you need an algorithm that handles any number systematically without guessing powers?
Method 2: Repeated Division by 2
The repeated division method repeatedly divides the integer quotient by 2 and records the remainder at each step until the quotient reaches 0.