A Clear Guide to Understanding Positional Numeration
Positional numeration is the silent engine behind every digital device, every financial ledger, and every time you read a price tag. Once you see how the position of a digit changes its weight, you can decode any base and build faster mental models for computing, budgeting, and cryptography.
The same rule that lets you distinguish 503 from 305 also lets a router tell 11001001 from 10011001. Understanding the rule once lets you reuse it forever.
The Core Rule: Place Equals Power
Each slot in a positional number is a labeled container whose label is the base raised to an integer power. The right-most slot is always the 0-th power, so it multiplies the digit by 1.
Move one step left and the exponent climbs by one; move right past the radix point and the exponent drops by one. This single idea unites binary fractions, hexadecimal colors, and ordinary grocery prices.
Because the exponent is tied to position, erasing a digit and shifting the rest left is identical to multiplying the entire number by the base.
Visualizing Exponents on Your Fingers
Hold out ten fingers; each finger is a power of ten. Bend the third finger from the right and you have just removed 10², or 100, from the total.
Redo the exercise with two fists and you are now counting in base-two exponents; the same bent finger now means 2², or 4. The gesture never changes, only the base label does.
Decimal, Binary, Hex: Same Skeleton, Different Skin
Decimal 947 is 9×10² + 4×10¹ + 7×10⁰. Binary 1010 is 1×2³ + 0×2² + 1×2¹ + 0×2⁰, which is ten in decimal.
Hexadecimal 0x3F8 breaks into 3×16² + 15×16¹ + 8×16⁰, yielding the same ten-bit number 101111111000. The only difference is the multiplier you choose; the scaffold stays identical.
Color Codes as Hex Flashcards
CSS #FF7700 is a mnemonic for 255 red, 119 green, 0 blue. Each pair is a byte you can read directly in hex without converting to decimal first.
Designers who memorize the eight key hex digits (0,3,6,9,C,F) can estimate colors faster than scrolling a picker.
Converting by Hand Without Tables
To convert 4321₅ to decimal, multiply the left-most digit by the base and add the next digit, repeat until the end. Start with 4, multiply by 5 to get 20, add 3 to get 23, multiply by 5 to get 115, add 2 to get 117, multiply by 5 to get 585, add 1 to reach 586.
This Horner-style method keeps numbers small and fits on a sticky note. Reverse the process for decimal to any base: divide by the base, keep the remainder as the right-most digit, repeat with the quotient until it hits zero.
Mental Check Using Casting Out
After converting 586 to base-5, you should get 4321₅. Add its digits 4+3+2+1 to get 10, then 1+0 to get 1.
Now take 586 mod 4 (since 5-1 is 4) and you also get 1, so the conversion is probably correct. The same trick works in any base by using base-minus-one.
Fractions and the Radix Point
The dot in 12.625 is called the radix point, not the decimal point, because the rule works for every base. In binary 1010.101 the first 1 after the dot means 2⁻¹, or 0.5, the next 1 means 2⁻³, or 0.125, so the total is 10.625 in decimal.
To convert a fractional decimal to binary, repeatedly multiply the fractional part by 2; each overflow digit becomes a bit. Stop when the fraction hits zero or you reach desired precision.
Fixed-Point Microcontroller Hack
8-bit chips lack floating-point units, so engineers treat the last three bits of an 8-bit byte as fractional. The number 00101.111 is 5.875 and still fits in eight bits.
Multiplication becomes a shift-and-add routine that runs in five cycles, faster than any software float library.
Signed Numbers and Two’s Complement
Writing a minus sign in hardware is impossible, so we encode sign into the bits themselves. Invert every bit of a positive number and add 1; the result is its two’s-complement negative.
This trick gives one unique zero and lets addition circuits ignore sign, cutting transistor count in half. The left-most bit becomes a built-in traffic light: 1 means negative, 0 means non-negative.
Quick Negation Trick
To negate 01110110 (118) flip to 10001001 and add 1 to get 10001010 (-118). You can do this in your head faster than reaching for a calculator.
Overflow Detection in Hardware
When two positive two’s-complement numbers add to a negative, the carry into the sign bit differs from the carry out. An XOR gate on those two carries flags overflow in a single tick.
Compilers rely on this flag to promote 32-bit ints to 64-bit silently. Knowing the flag bit lets embedded programmers decide whether to saturate, wrap, or raise an exception.
Arbitrary Base Alphabets
Base-64 encoding uses 0-9, A-Z, a-z, +, / to fit 64 symbols into ASCII text. Each character represents a 6-bit slice, so three bytes become four characters, a 33% size increase that survives email gateways.
URL-safe variants swap + and / for – and _ to avoid percent escapes. The choice of alphabet is purely contractual; the positional math never changes.
Custom Base for Tiny URLs
A startup can save database space by issuing IDs in base-36 (0-9 plus A-Z). Record 123456789 becomes the seven-character string 21I3V9, cutting storage by 30% and fitting in a tweet.
Prime Bases and Error Detection
Using a prime base like 7 makes every digit position coprime to the base, which simplifies modular checksums. The ISBN-10 code is actually a weighted sum modulo 11 where the weights are 10,9,8…1.
If the sum mod 11 is not zero, the ISBN is invalid. The prime modulus guarantees that single-digit errors and adjacent-digit swaps are always caught.
DIY Check Digit
Give any serial number a base-7 check digit by computing the weighted sum mod 7 and appending the result. A scanner reading 6302154 knows the last digit 4 must satisfy the formula; if it sees 6302159, the mismatch triggers a rescan.
Scaling Large Numbers With Scientific Notation in Any Base
Binary scientific notation shifts the radix point after the first non-zero bit and records the shift count as an exponent. The 32-bit float 0 10000101 01010000000000000000000 has exponent 133-127=6, so the real value is 1.0101₂×2⁶ = 82.0.
Same idea works in hex: 0x1.ABCp+8 equals 1.ABC₁₆×2⁸. The letter p separates significand from exponent, avoiding confusion with the hex digit E.
Comparing Floats Without Floating Hardware
Strip the sign bit, compare exponents first, then compare mantissas as unsigned integers. This integer-only comparison runs on a $0.50 Cortex-M0 and saves battery.
Base Conversion in Spreadsheets
Excel provides DEC2BIN, BIN2DEC, DEC2HEX, and HEX2DEC but caps at 10 bits. To go beyond, roll your own formula using QUOTIENT and MOD in adjacent columns.
Drive the formula downward until the quotient reaches zero; the remainders read upwards give the new base. This live sheet converts a 48-bit MAC address to hex in under 20 milliseconds.
Google Sheets Array Trick
Enter =ArrayFormula(MOD(INT(A1/2^(ROW(INDIRECT(“1:16”))-1)),2)) to split a decimal into a vertical column of 16 bits. Change the 2 to 16 and you get hex digits instead.
Teaching Kids With Everyday Objects
Give a child 12 egg cartons that each hold 10 eggs. When a carton fills, close it and place it in a “tens” pile; the remaining loose eggs show the unit digit.
Trade ten cartons for a single box of 100 eggs and the child has enacted base-10 carry without hearing the word “algorithm”. Swap the cartons for egg trays that hold only two eggs and the same child is now doing binary.
Lego Base-16 Counter
Stack red bricks for units, blue for sixteens, green for 256s. When the red stack hits 16, trade it for one blue brick and start over. Kids build a 32-bit color in under a minute and remember hex for life.
Security Implications of Base Choices
Base-58 removes 0, O, I, l from Bitcoin addresses to cut copy-paste errors. Fewer look-alike glyphs shrink the attack surface where a typo could send coins to a black-hole address.
Base-32 encoding in QR codes balances density and error resilience; the alphabet fits in 5 bits, leaving room for Reed-Solomon correction. Security is not just cryptography—it is also ergonomics.
Timing Attack Defense
Constant-time base conversion routines prevent leaking secret key bits through execution timing. A lookup table indexed by secret bits must be avoided; instead use bit-slicing operations that always touch the same memory pattern.
Compression via Base Awareness
Log files filled with 32-bit integers can shrink 50% by printing them in base-62 instead of decimal. Each character carries 5.95 bits instead of 3.32, cutting storage and bandwidth bills.
Combine with delta encoding first and the savings climb to 70%. The decoder reverses the steps with a single division loop that streams data faster than gzip decompression.
Embedded Sensor Payload
A LoRa radio packet has 51 bytes. Store temperature, humidity, pressure as 14-bit, 10-bit, 14-bit deltas, then pack into base-64 printable text. The result survives noisy channels without binary escape overhead.
Future-Proofing With Base-Agile Designs
Build converters as pure functions that take base as a parameter. When quantum computers bring base-65536 arithmetic, your codebase changes one variable, not every routine.
Store numbers as byte arrays accompanied by a small base tag. Migration becomes a reprint, not a rewrite.
Protocol Versioning Trick
Declare the base in the first header byte. Old software reads decimal, new software reads base-36, and both know when to stop parsing. The network gains extensibility without breaking legacy nodes.