Skip to main content

7.1 Radix Number Systems & Inter-Base Conversion

πŸ“šModule 07: Number Systems, Complements & ArithmeticTopic 7.1⏱️20 min read
🎯High-Yield For:University Semester Exams β€’ Hardware Engineering Rounds β€’ Foundational Computing

πŸ’‘ Core Intuition: The Odometer & The Radix Weight Balance​

Every number we write is a shorthand code. When you write the number 354354, you do not simply possess three digits; you possess:

3Γ—102+5Γ—101+4Γ—100=300+50+43 \times 10^2 + 5 \times 10^1 + 4 \times 10^0 = 300 + 50 + 4

The baseβ€”or Radix (rr)β€”defines how many distinct numerical symbols exist in that system before a column rolls over to zero and propagates a carry to the next position, exactly like the mechanical wheels of an automotive odometer.

🍳 The Everyday Analogy: The Currency Exchange Desk​

Imagine an eccentric bank where cash is dispensed strictly in powers of a currency unit:

  • In a Decimal (Base-10) bank, the teller dispenses $1000, $100, $10, and $1 notes.
  • In a Binary (Base-2) bank, the teller only stocks $16, $8, $4, $2, and $1 notes.
  • In an Octal (Base-8) bank, the teller dispenses $64, $8, and $1 notes.
  • In a Hexadecimal (Base-16) bank, the teller dispenses $4096, $256, $16, and $1 notes.

If you request $42 from the Binary teller, they hand you:

1Γ—32+0Γ—16+1Γ—8+0Γ—4+1Γ—2+0Γ—1=(101010)21 \times 32 + 0 \times 16 + 1 \times 8 + 0 \times 4 + 1 \times 2 + 0 \times 1 = (101010)_2

Each base is merely a different combination of power weights describing the exact same underlying physical quantity!

πŸ’» Bridging to Computer Science & Silicon Hardware​

Why do digital computers operate in binary when humans think in decimal?

  1. CMOS Voltage Margins: In silicon, distinguishing between two discrete electrical voltage states (ground 0 V0\,\text{V} and supply VDD=1.2 VV_{DD} = 1.2\,\text{V}) provides maximum noise immunity. Distinguishing 10 distinct voltage levels (0.12 V0.12\,\text{V} per state) would cause catastrophic bit flips from thermal noise.
  2. Octal (232^3) and Hexadecimal (242^4) as Human Shorthand: Modern 64-bit microprocessors deal with memory addresses like 0x7FFE_4A10_B9C0. Writing this address in binary requires 64 ones and zeros (0111111111111110...), which is humanly impossible to parse without error. Because 16=2416 = 2^4, each hexadecimal character directly groups exactly 4 binary bits (one nibble), providing a 1:1 lossless window into physical hardware memory without performing complex division.


πŸ“ Positional Number Systems & The Radix Polynomial​

In a positional number system with radix rr, any real number NN is expressed as an ordered sequence of digits:

(N)r=(dnβˆ’1 dnβˆ’2…d1 d0 . dβˆ’1 dβˆ’2…dβˆ’m)r(N)_r = (d_{n-1} \, d_{n-2} \dots d_1 \, d_0 \, . \, d_{-1} \, d_{-2} \dots d_{-m})_r

Where:

  • rr is the Radix (Base) of the number system (rβ‰₯2, r∈Z+r \ge 2, \, r \in \mathbb{Z}^+).
  • did_i is a digit satisfying 0≀di≀rβˆ’10 \le d_i \le r - 1.
  • nn is the number of integer digits to the left of the radix point.
  • mm is the number of fractional digits to the right of the radix point.
πŸ“The Fundamental Radix Polynomial Expansionformula
(N)10=βˆ‘i=βˆ’mnβˆ’1diβ‹…ri=dnβˆ’1rnβˆ’1+β‹―+d1r1+d0r0+dβˆ’1rβˆ’1+β‹―+dβˆ’mrβˆ’m(N)_{10} = \sum_{i=-m}^{n-1} d_i \cdot r^i = d_{n-1}r^{n-1} + \dots + d_1 r^1 + d_0 r^0 + d_{-1} r^{-1} + \dots + d_{-m} r^{-m}

Each position corresponds to an exponential weight rir^i. Notice that:

  • r0=1r^0 = 1 is always the units digit directly preceding the radix point.
  • Positions to the left increment powers: r1,r2,r3,…r^1, r^2, r^3, \dots
  • Positions to the right decrement negative powers: rβˆ’1=1r, rβˆ’2=1r2,…r^{-1} = \frac{1}{r}, \, r^{-2} = \frac{1}{r^2}, \dots

πŸ—‚οΈ Standard Radices in Computing (Base 2, 8, 10, 16)​


πŸ”„ Non-Decimal to Decimal: Weighted Expansion​

To convert any number from an arbitrary base rr to Decimal (Base-10), expand every digit into its corresponding weight rir^i and compute the arithmetic sum in decimal.

Example 1: Binary to Decimal with Fractions​

Convert (11010.101)2(11010.101)_2 to decimal:

(11010.101)2=(1Γ—24)+(1Γ—23)+(0Γ—22)+(1Γ—21)+(0Γ—20)+(1Γ—2βˆ’1)+(0Γ—2βˆ’2)+(1Γ—2βˆ’3)=16+8+0+2+0+0.5+0+0.125=(26.625)10\begin{aligned} (11010.101)_2 &= (1 \times 2^4) + (1 \times 2^3) + (0 \times 2^2) + (1 \times 2^1) + (0 \times 2^0) + (1 \times 2^{-1}) + (0 \times 2^{-2}) + (1 \times 2^{-3}) \\ &= 16 + 8 + 0 + 2 + 0 + 0.5 + 0 + 0.125 \\ &= (26.625)_{10} \end{aligned}

Example 2: Hexadecimal to Decimal​

Convert (3F2.C)16(3\text{F}2.\text{C})_{16} to decimal (recall F=15, C=12\text{F} = 15, \, \text{C} = 12):

(3F2.C)16=(3Γ—162)+(15Γ—161)+(2Γ—160)+(12Γ—16βˆ’1)=(3Γ—256)+(15Γ—16)+(2Γ—1)+(12Γ—0.0625)=768+240+2+0.75=(1010.75)10\begin{aligned} (3\text{F}2.\text{C})_{16} &= (3 \times 16^2) + (15 \times 16^1) + (2 \times 16^0) + (12 \times 16^{-1}) \\ &= (3 \times 256) + (15 \times 16) + (2 \times 1) + (12 \times 0.0625) \\ &= 768 + 240 + 2 + 0.75 \\ &= (1010.75)_{10} \end{aligned}

βž— Decimal to Any Base: Successive Division & Multiplication​

Converting from Decimal (Base-10) to an arbitrary target radix rr requires separating the number into its integer and fractional components:

  1. Integer Part: Processed using Successive Division by rr.
  2. Fractional Part: Processed using Successive Multiplication by rr.

Decimal to Arbitrary Radix (Base r) Conversion Framework

Decomposing real numbers into integer division and fractional multiplication pipelines

Successive Division

Integer Part (N_int)

Dominant Architecture / DomainRepeated Division by Radix r
  • β€’Divide integer dividend N by target radix r at each iteration.
  • β€’Record remainder as the current radix-r digit (range: 0 to r - 1).
  • β€’Replace dividend with the integer quotient: Q = ⌊N / rβŒ‹.
  • β€’Termination Condition: Stop when quotient reaches 0.
  • β€’Crucial Read Order: Read remainders Bottom-to-Top (First remainder = LSB, Final remainder = MSB).
Successive Multiplication

Fractional Part (N_frac)

Dominant Architecture / DomainRepeated Multiplication by Radix r
  • β€’Multiply current fractional part by target radix r at each iteration.
  • β€’Extract the generated integer carry digit (range: 0 to r - 1).
  • β€’Retain the remaining purely fractional part for the next cycle.
  • β€’Termination Condition: Stop when fraction equals 0 or required precision bits are met.
  • β€’Crucial Read Order: Read extracted integer digits Top-to-Bottom (First carry = MSB / r⁻¹, subsequent = r⁻², r⁻³, ...).
Architecture Flow

Dual-Pipeline Base Conversion Execution Flow

Step-by-step algorithm branching into Integer Division and Fractional Multiplication

Step 1

Divide by Target Radix r

N Γ· r

Perform integer division of dividend N by radix r.

β†’
Produces Q and R
Step 2

Record Remainder (R)

0 ≀ R < r

Remainder R becomes next digit. First remainder is LSB.

β†’
Update dividend N = Q
Step 3

Check Q = 0 Condition

Loop until Q = 0

If Q > 0, repeat division. When Q = 0, stop.

β†’
Collect digits
Final Digits

Read Bottom-to-Top

LSB β†’ MSB

Assemble integer digits in reverse generation order (Bottom-to-Top).

Step 1

Multiply by Radix r

F Γ— r

Multiply remaining fractional value by target radix r.

β†’
Extract integer part
Step 2

Record Integer Carry

Digit = ⌊F Γ— rβŒ‹

Extracted integer is next fractional digit. First carry is MSB (r⁻¹).

β†’
Retain fractional part
Step 3

Check F = 0 Condition

Loop until F = 0 or limit

Continue multiplying remaining fraction until it reaches 0 or required precision.

β†’
Collect digits
Final Digits

Read Top-to-Bottom

MSB β†’ LSB

Assemble fractional digits in direct order of extraction (Top-to-Bottom).

1. Integer Conversion: Successive Division Algorithm​

Divide the integer repeatedly by target base rr. At each iteration:

  • The remainder becomes the next digit.
  • The quotient becomes the dividend for the next step.
  • Stop when the quotient reaches 00.
  • Critical Order: The first remainder generated is the Least Significant Bit (LSB) (r0r^0). The last remainder generated is the Most Significant Bit (MSB). Read from Bottom to Top!

Example: Convert (53)10(53)_{10} to Binary (r=2r=2)​

DividendQuotientRemainder53Γ·2261(LSB)↑26Γ·213013Γ·2616Γ·2303Γ·2111Γ·201(MSB)\begin{array}{r|c|l} \text{Dividend} & \text{Quotient} & \text{Remainder} \\ \hline 53 \div 2 & 26 & 1 \quad (\text{LSB}) \uparrow \\ 26 \div 2 & 13 & 0 \\ 13 \div 2 & 6 & 1 \\ 6 \div 2 & 3 & 0 \\ 3 \div 2 & 1 & 1 \\ 1 \div 2 & 0 & 1 \quad (\text{MSB}) \\ \end{array}

Reading bottom-to-top: (53)10=(110101)2(53)_{10} = (110101)_2.


2. Fractional Conversion: Successive Multiplication Algorithm​

Multiply the fractional portion repeatedly by target base rr. At each iteration:

  • The integer part of the product is extracted as the next digit.
  • The remaining fractional part is multiplied again by rr.
  • Stop when the fractional part reaches exactly 00, or when desired precision is reached.
  • Critical Order: The first integer extracted corresponds to rβˆ’1r^{-1} (the MSB of the fraction). The subsequent integers follow downwards. Read from Top to Bottom!

Example: Convert (0.6875)10(0.6875)_{10} to Binary (r=2r=2)​

0.6875Γ—2=1.3750β€…β€ŠβŸΉβ€…β€ŠDigitΒ dβˆ’1=1(MSBΒ ofΒ fraction)↓0.3750Γ—2=0.7500β€…β€ŠβŸΉβ€…β€ŠDigitΒ dβˆ’2=00.7500Γ—2=1.5000β€…β€ŠβŸΉβ€…β€ŠDigitΒ dβˆ’3=10.5000Γ—2=1.0000β€…β€ŠβŸΉβ€…β€ŠDigitΒ dβˆ’4=1(Terminates!)\begin{aligned} 0.6875 \times 2 &= \mathbf{1}.3750 \implies \text{Digit } d_{-1} = 1 \quad (\text{MSB of fraction}) \downarrow \\ 0.3750 \times 2 &= \mathbf{0}.7500 \implies \text{Digit } d_{-2} = 0 \\ 0.7500 \times 2 &= \mathbf{1}.5000 \implies \text{Digit } d_{-3} = 1 \\ 0.5000 \times 2 &= \mathbf{1}.0000 \implies \text{Digit } d_{-4} = 1 \quad (\text{Terminates!}) \end{aligned}

Reading top-to-bottom: (0.6875)10=(0.1011)2(0.6875)_{10} = (0.1011)_2.


⚑ Power-of-Two Fast Groupings (Binary ↔ Octal ↔ Hex)​

Whenever two radices are related by a power of two (r1=2kr_1 = 2^k), conversion bypasses decimal arithmetic completely!

8=23β€…β€ŠβŸΉβ€…β€Š1Β OctalΒ Digitβ€…β€ŠβŸΊβ€…β€Š3Β BinaryΒ Bits8 = 2^3 \implies \mathbf{1 \text{ Octal Digit}} \iff \mathbf{3 \text{ Binary Bits}} 16=24β€…β€ŠβŸΉβ€…β€Š1Β HexΒ Digitβ€…β€ŠβŸΊβ€…β€Š4Β BinaryΒ BitsΒ (1Β Nibble)16 = 2^4 \implies \mathbf{1 \text{ Hex Digit}} \iff \mathbf{4 \text{ Binary Bits (1 Nibble)}}

Binary ↔\leftrightarrow Hexadecimal Fast Mapping​

  1. Binary to Hexadecimal: Group the binary string into sets of 4 bits, starting from the radix point:
    • For the integer part: Group moving left from the radix point (pad leading zeros on the far left if needed).
    • For the fractional part: Group moving right from the radix point (pad trailing zeros on the far right if needed).
    • Substitute each 4-bit group with its hexadecimal symbol (0…9,A…F0\dots9, \text{A}\dots\text{F}).

Example: Convert (10111101011.101101)2(10111101011.101101)_2 to Hexadecimal​

  • Integer part: 0101⏟51110⏟E1011⏟B\underbrace{0101}_{5} \quad \underbrace{1110}_{\text{E}} \quad \underbrace{1011}_{\text{B}} (padded with leading zero)
  • Fractional part: 1011⏟B0100⏟4\underbrace{1011}_{\text{B}} \quad \underbrace{0100}_{4} (padded with two trailing zeros)
  • Result: (5EB.B4)16(5\text{EB}.\text{B}4)_{16}
Binary Groups010111101011.10110100
Hex Equivalent5EB.B4

Binary ↔\leftrightarrow Octal Fast Mapping​

Group into clusters of 3 bits:

  • (10111101011.101101)2β€…β€ŠβŸΉβ€…β€Š010⏟2111⏟7101⏟5011⏟3.101⏟5101⏟5=(2753.55)8(10111101011.101101)_2 \implies \underbrace{010}_{2} \quad \underbrace{111}_{7} \quad \underbrace{101}_{5} \quad \underbrace{011}_{3} \quad . \quad \underbrace{101}_{5} \quad \underbrace{101}_{5} = (2753.55)_8

πŸŒ‰ Arbitrary Base-to-Base Conversions (The Decimal Bridge)​

When converting between two arbitrary bases where neither is an integer power of the other (e.g., Base-5 to Base-7, or Base-3 to Base-8), use Decimal as the intermediate bridge:

SourceΒ BaseΒ r1β†’WeightedΒ PolynomialΒ ExpansionDecimalΒ (BaseΒ 10)β†’SuccessiveΒ DivisionΒ /Β MultiplicationTargetΒ BaseΒ r2\text{Source Base } r_1 \xrightarrow{\text{Weighted Polynomial Expansion}} \text{Decimal (Base 10)} \xrightarrow{\text{Successive Division / Multiplication}} \text{Target Base } r_2

Concrete Problem: Convert (243.2)5(243.2)_5 to Base 7​

Step 1: Convert Base-5 to Decimal

(243.2)5=(2Γ—52)+(4Γ—51)+(3Γ—50)+(2Γ—5βˆ’1)=(2Γ—25)+(4Γ—5)+(3Γ—1)+(2Γ—0.2)=50+20+3+0.4=(73.4)10\begin{aligned} (243.2)_5 &= (2 \times 5^2) + (4 \times 5^1) + (3 \times 5^0) + (2 \times 5^{-1}) \\ &= (2 \times 25) + (4 \times 5) + (3 \times 1) + (2 \times 0.2) \\ &= 50 + 20 + 3 + 0.4 = (73.4)_{10} \end{aligned}

Step 2: Convert (73.4)10(73.4)_{10} to Base-7

  • Integer (73): 73Γ·7=10remΒ 3↑73 \div 7 = 10 \quad \text{rem } 3 \uparrow 10Γ·7=1remΒ 310 \div 7 = 1 \quad \text{rem } 3 1Γ·7=0remΒ 11 \div 7 = 0 \quad \text{rem } 1 β€…β€ŠβŸΉβ€…β€Š(133)7\implies (133)_7
  • Fraction (0.4): 0.4Γ—7=2.8β€…β€ŠβŸΉβ€…β€Š2↓0.4 \times 7 = \mathbf{2}.8 \implies 2 \downarrow 0.8Γ—7=5.6β€…β€ŠβŸΉβ€…β€Š50.8 \times 7 = \mathbf{5}.6 \implies 5 0.6Γ—7=4.2β€…β€ŠβŸΉβ€…β€Š40.6 \times 7 = \mathbf{4}.2 \implies 4 β€…β€ŠβŸΉβ€…β€Š(0.254… )7\implies (0.254\dots)_7

Final Result: (243.2)5=(133.254… )7(243.2)_5 = (133.254\dots)_7.


πŸŽ›οΈ Interactive Radix Converter & Derivation Stepper​

Experiment with any integer or fractional value across Binary, Octal, Decimal, and Hexadecimal. Inspect the full successive division and multiplication tables live:

BinaryBase 2
101010.101
Bits (0, 1)
OctalBase 8
52.5
Digits (0–7)
DecimalBase 10
42.625
Standard Base
HexadecimalBase 16
2A.A
Digits (0–9, A–F)
πŸ’‘ Direct Power-of-Two Bit Grouping (Binary ↔ Hex / Octal)
4-Bit Nibbles to Hexadecimal: (padded on left with 0s)
00100x2
10100xA
3-Bit Groups to Octal: (padded on left with 0s)
101O5
010O2
Integer: Successive Division by 2LSB to MSB (Bottom to Top)
DividendDivisorQuotientRemainder
42Γ· 2210
21Γ· 2101
10Γ· 250
5Γ· 221
2Γ· 210
1Γ· 201
⬆ Read remainders from bottom to top!
Fraction: Successive Multiplication by 2MSB to LSB (Top to Bottom)
FractionMultiplierProductInteger Part
0.625000Γ— 21.2500001
0.250000Γ— 20.5000000
0.500000Γ— 21.0000001
⬇ Read integer parts from top to bottom!

⚠️ Fractional Precision Limits & Floating-Point Hazards​

One of the most profound realizations in computer systems is that finite decimal fractions do not necessarily terminate in binary!

Consider the seemingly innocuous decimal number 0.1100.1_{10} (one-tenth):

0.1Γ—2=0.2β€…β€ŠβŸΉβ€…β€Š0↓0.2Γ—2=0.4β€…β€ŠβŸΉβ€…β€Š00.4Γ—2=0.8β€…β€ŠβŸΉβ€…β€Š00.8Γ—2=1.6β€…β€ŠβŸΉβ€…β€Š10.6Γ—2=1.2β€…β€ŠβŸΉβ€…β€Š10.2Γ—2=0.4β€…β€ŠβŸΉβ€…β€Š0(PatternΒ repeatsΒ indefinitely!)\begin{aligned} 0.1 \times 2 &= \mathbf{0}.2 \implies 0 \downarrow \\ 0.2 \times 2 &= \mathbf{0}.4 \implies 0 \\ 0.4 \times 2 &= \mathbf{0}.8 \implies 0 \\ 0.8 \times 2 &= \mathbf{1}.6 \implies 1 \\ 0.6 \times 2 &= \mathbf{1}.2 \implies 1 \\ 0.2 \times 2 &= \mathbf{0}.4 \implies 0 \quad (\text{Pattern repeats indefinitely!}) \end{aligned} (0.1)10=(0.00011β€Ύ00110011… )2(0.1)_{10} = (0.0\overline{0011}00110011\dots)_2

Because silicon registers have finite bit width (32-bit single precision or 64-bit double precision), the repeating bits must eventually be truncated or rounded! This leads to the famous programming anomaly:

console.log(0.1 + 0.2 === 0.3); // Output: FALSE! (Evaluates to 0.30000000000000004)
πŸ“Condition for Terminating Fractional Representationformula

A reduced fraction PQ\frac{P}{Q} terminates in radix rr if and only if all prime factors of the denominator QQ divide the radix rr.

  • In Decimal (r=10=2Γ—5r=10 = 2 \times 5): Any fraction whose denominator factors into only 22s and 55s terminates (e.g. 12,14,15,110\frac{1}{2}, \frac{1}{4}, \frac{1}{5}, \frac{1}{10}).
  • In Binary (r=2r=2): Only fractions whose denominator is an exact power of 22 (2k2^k) terminate! 110=12Γ—5\frac{1}{10} = \frac{1}{2 \times 5} contains a prime factor 55, making it infinitely repeating in binary!

🏭 Real-World Production Context: Memory Addressing, Endianness & Unix Permissions​

In system programming and computer architecture, multi-radix mastery directly bridges software abstraction with underlying hardware registers.

Computing Systems Multi-Radix Representation Hierarchy

Application Layer

POSIX File Permissions & Hex Bitmasks

πŸ’»

Developers use octal chmod 755 (rwxr-xr-x) and hexadecimal color hexes (#FF5733) or network socket flags for readability.

POSIX Octal ModesRGB Color Hex (#RRGGBB)Memory Offsets (0x1000)
↓Mapped to OS Memory Paging
OS & Kernel

64-Bit Virtual Memory Addressing (Hex)

πŸ—‚οΈ

Page tables and GDB debuggers express 64-bit pointers in 16 hex digits (e.g. 0x7FFF_FFFF_E000), where each character groups exactly 4 binary bits.

4-Bit Nibble GroupingLossless Memory InspectionCache Line Alignment
↓Passed to CPU Register Files
Architecture Datapath

ALU Register Files & Floating-Point Units

⚑

ALU datapaths execute operations on 32-bit/64-bit binary registers, where fractions like 0.1 become infinitely repeating mantissas.

Fixed-Point Word SizingBinary Rounding HazardsALU Status Flags
↓Transistor Gate Voltage Switching
Physical Silicon

CMOS Dual Voltage Levels (0V / 1.2V)

πŸ”¬

Transistors switch between GND (Logic 0) and VDD (Logic 1), providing maximal noise margin in binary logic.

Noise Margin ImmunityTransistor Cutoff / SaturationDeterministic Switching Delay
  • Memory Addressing in Hexadecimal: Modern 64-bit systems handle addresses that would be unreadable in binary. Because 16=2416 = 2^4, each hexadecimal character directly corresponds to 4 physical flip-flop states (one nibble), enabling engineers to audit memory layouts losslessly without division.
  • Octal in Unix Permissions: The classic POSIX permissions model maps 3 bits (Read =4= 4, Write =2= 2, Execute =1= 1) into a single octal digit (00 through 77). An octal string like 755 provides an instant view of three independent 3-bit registers controlling Owner, Group, and Other privileges.

πŸ“ Numerical Applications & Worked Examples​

Example 1: High-Precision Fractional Conversion to Binary & Hexadecimal​

Problem Statement:
Convert the decimal quantity N=(105.6875)10N = (105.6875)_{10} into:

  1. Exact binary representation.
  2. Hexadecimal representation via power-of-two nibble grouping.

Step-by-Step Solution:

  1. Integer Conversion (10510β†’105_{10} \to Binary via Successive Division by 2):
    • 105Γ·2=52105 \div 2 = 52 rem 11 (LSB)
    • 52Γ·2=2652 \div 2 = 26 rem 00
    • 26Γ·2=1326 \div 2 = 13 rem 00
    • 13Γ·2=613 \div 2 = 6 rem 11
    • 6Γ·2=36 \div 2 = 3 rem 00
    • 3Γ·2=13 \div 2 = 1 rem 11
    • 1Γ·2=01 \div 2 = 0 rem 11 (MSB)
    • Reading Bottom-to-Top: 10510=11010012105_{10} = \mathbf{1101001}_2.
  2. Fractional Conversion (0.687510β†’0.6875_{10} \to Binary via Successive Multiplication by 2):
    • 0.6875Γ—2=1.375β€…β€ŠβŸΉβ€…β€Š10.6875 \times 2 = \mathbf{1}.375 \implies 1 (MSB, 2βˆ’12^{-1})
    • 0.375Γ—2=0.75β€…β€ŠβŸΉβ€…β€Š00.375 \times 2 = \mathbf{0}.75 \implies 0 (2βˆ’22^{-2})
    • 0.75Γ—2=1.5β€…β€ŠβŸΉβ€…β€Š10.75 \times 2 = \mathbf{1}.5 \implies 1 (2βˆ’32^{-3})
    • 0.5Γ—2=1.0β€…β€ŠβŸΉβ€…β€Š10.5 \times 2 = \mathbf{1}.0 \implies 1 (2βˆ’42^{-4})
    • Fraction terminates at 0. Reading Top-to-Bottom: 0.687510=0.101120.6875_{10} = \mathbf{0.1011}_2.
    • Combined Binary Result: (105.6875)10=1101001.10112(105.6875)_{10} = \mathbf{1101001.1011}_2.
  3. Hexadecimal Conversion via 4-Bit Nibble Grouping:
    • Pad integer on the left to complete 4-bit nibbles: 0110⏟61001⏟9β€…β€ŠβŸΉβ€…β€Š6916\underbrace{0110}_{6} \quad \underbrace{1001}_{9} \implies \mathbf{69}_{16}.
    • Fractional nibble: 1011⏟Bβ€…β€ŠβŸΉβ€…β€Š.B16\underbrace{1011}_{\text{B}} \implies \mathbf{.B}_{16}.
    • Final Hexadecimal Result: (105.6875)10=69.B16(105.6875)_{10} = \mathbf{69.B}_{16}.

Example 2: Arbitrary Base Conversion via the Decimal Bridge​

Problem Statement:
Convert the base-5 number (314.2)5(314.2)_5 into its equivalent octal (base-8) representation, carrying the fractional conversion to 3 octal places.

Step-by-Step Solution:

  1. Bridge to Decimal via Radix-5 Polynomial Expansion:
    (314.2)5=(3Γ—52)+(1Γ—51)+(4Γ—50)+(2Γ—5βˆ’1)(314.2)_5 = (3 \times 5^2) + (1 \times 5^1) + (4 \times 5^0) + (2 \times 5^{-1})
    (314.2)5=(3Γ—25)+(1Γ—5)+(4Γ—1)+(2Γ—0.2)=75+5+4+0.4=(84.4)10(314.2)_5 = (3 \times 25) + (1 \times 5) + (4 \times 1) + (2 \times 0.2) = 75 + 5 + 4 + 0.4 = \mathbf{(84.4)_{10}}
  2. Convert Decimal Integer 841084_{10} to Octal via Successive Division by 8:
    • 84Γ·8=1084 \div 8 = 10 rem 44 (LSB)
    • 10Γ·8=110 \div 8 = 1 rem 22
    • 1Γ·8=01 \div 8 = 0 rem 11 (MSB)
    • Reading Bottom-to-Top: 8410=(124)884_{10} = \mathbf{(124)_8}.
  3. Convert Decimal Fraction 0.4100.4_{10} to Octal via Successive Multiplication by 8:
    • 0.4Γ—8=3.2β€…β€ŠβŸΉβ€…β€Š30.4 \times 8 = \mathbf{3}.2 \implies 3 (First octal fractional digit)
    • 0.2Γ—8=1.6β€…β€ŠβŸΉβ€…β€Š10.2 \times 8 = \mathbf{1}.6 \implies 1
    • 0.6Γ—8=4.8β€…β€ŠβŸΉβ€…β€Š40.6 \times 8 = \mathbf{4}.8 \implies 4
    • Fractional Part: (0.314… )8(0.314\dots)_8.
    • Final Result: (314.2)5=(124.314… )8(314.2)_5 = \mathbf{(124.314\dots)_8}.

Example 3: Determination of Unknown Radix from an Algebraic Equation​

Problem Statement:
Find the unknown radix bb for which the arithmetic equation is valid:
(41)b=(5)b\sqrt{(41)_b} = (5)_b

Step-by-Step Solution:

  1. Identify Positional Constraints on Radix bb:
    • The equation contains the digit 55 in (5)b(5)_b and digit 44 in (41)b(41)_b.
    • Because every digit in radix bb must be <b< b, the base must satisfy b>5b > 5 (i.e. bβ‰₯6b \ge 6).
  2. Expand Both Sides into Decimal Algebraic Expressions:
    • LHS: (41)b=4β‹…b1+1β‹…b0=4b+1\sqrt{(41)_b} = \sqrt{4 \cdot b^1 + 1 \cdot b^0} = \sqrt{4b + 1}
    • RHS: (5)b=5β‹…b0=5(5)_b = 5 \cdot b^0 = 5
  3. Solve for bb:
    4b+1=5\sqrt{4b + 1} = 5
    Square both sides:
    4b+1=25β€…β€ŠβŸΉβ€…β€Š4b=24β€…β€ŠβŸΉβ€…β€Šb=64b + 1 = 25 \implies 4b = 24 \implies \mathbf{b = 6}
  4. Verification:
    • Check b=6b = 6: (41)6=4(6)+1=2510(41)_6 = 4(6) + 1 = 25_{10}.
    • 2510=510=(5)6\sqrt{25_{10}} = 5_{10} = (5)_6.
    • The constraint bβ‰₯6b \ge 6 is met exactly. The radix is b=6b = 6.

🎯 Exam & Interview Pitfall Check​

Core Conceptual Questions
  • Why must we pad zeros on the LEFT for integers and on the RIGHT for fractions when grouping into nibbles?
    Prepending zeros to an integer (0011=30011 = 3) does not change its numerical magnitude (0Γ—23+0Γ—22+1Γ—21+1Γ—20=30 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0 = 3). Similarly, appending zeros to the tail of a fraction (0.1100=0.750.1100 = 0.75) does not change its value. However, appending zeros to an integer or prepending zeros to a fraction radically shifts the radix power weights and corrupts the number!
  • How many total binary bits are required to store an nn-digit decimal integer?
    To represent an integer N<10nN < 10^n, we need 2kβ‰₯10nβ€…β€ŠβŸΉβ€…β€Škβ‰₯nlog⁑2(10)β‰ˆ3.322Γ—n2^k \ge 10^n \implies k \ge n \log_2(10) \approx 3.322 \times n. Thus, each decimal digit requires approximately 3.323.32 bits (practically, we allocate 4 bits per decimal digit in BCD).
Common Interview Traps
  • Trap: Forgetting that a Hexadecimal digit can represent up to 15, not 16.
    In Base-16, the symbol 10 represents (16)10(16)_{10}. The digit for decimal 15 is F. Never write 16 or 10 as a single digit in base 16!
  • Trap: Inverting the read-out order between division and multiplication.
    • Division remainders (integer conversion) are read Bottom to Top (first remainder is LSB).
    • Multiplication products (fractional conversion) are read Top to Bottom (first extracted digit is MSB). Inverting this order is the most common error in timed university examinations!

πŸ’¬

Discussion & Doubts