📐 Decimal Division

Master the algorithm with interactive examples

🎯 What is Decimal Division?

Decimal division is similar to binary division, but operates in base-10 (digits 0-9). The process involves repeated subtraction and shifting, where you subtract the divisor as many times as possible until a negative remainder results.

💡 Key Concept: The remainder is restored by adding back the divisor when subtraction results in a negative value. The digit representing the number of subtractions excludes the one that caused the negative remainder.

📋 The Algorithm

Step-by-Step Process:

1 Initialize: Place dividend in register AQ, divisor in register B. Set SC (step counter) to k.
2 Shift Left: Shift AQ left with most significant digit placed in Ae.
3 Subtract: Perform A ← A - B (subtract divisor from partial remainder).
4 Check Sign: If A < B (negative result), restore by A ← A + B and set QL = 0. Otherwise, set QL ← QL + 1.
5 Decrement: Decrease SC by 1. If SC ≠ 0, repeat from step 2.
6 Complete: Quotient is in Q, remainder is in A.

🔄 Flowchart Overview

BCD Division Flowchart

🎮 Interactive Demo

Try it yourself! Enter a dividend and divisor to see the result:

📝 Example Walkthrough

Example: Divide decimal numbers

Process:

  1. The partial remainder and quotient bits are shifted left
  2. The process repeats k times to form k quotient digits
  3. The remainder is found in register A
  4. Quotient digits are accumulated in register Q
⚠️ Important: When the result is negative (A < B), the divisor is added back to restore the partial remainder, and QL stays at 0. The quotient digit equals the number of times divisor was subtracted from the dividend.
Start Learning I/O Organization