🔢 Decimal Multiplication

Understanding BCD Arithmetic Operations

📖Introduction

The multiplication of fixed-point decimal numbers is similar to binary multiplication, except for how partial products are formed. A decimal multiplier has digits ranging from 0 to 9, whereas in binary, the multiplicand only has values 0 and 1.

In the binary case, the multiplicand is simply added to the partial product if the multiplier bit is 1. In decimal multiplication, each digit multiplier is multiplied by the multiplicand and the result is added to the partial product. This operation can be accomplished by adding the multiplicand to the partial product n times, where n equals the value of the multiplier digit.

📊Register Organization

The register organization for binary multiplication is shown below. The multiplier requires 16 bits for storing four bits of each number. There are three registers:

BCD Multiplication Register
  • Registers A, B, and Q: Each register stores a 4-digit (16-bit) decimal number.
  • Sign Flip-Flops: Each register has a corresponding sign bit:As, Bs and Qs
  • Extension Digits (Ae and Be): These are 4-bit extensions (one decimal digit) to registers A and B.
    •    Ae (Overflow Digit): Holds the temporary carry/overflow during addition and can range from 0 to 9.
    •    Be: Used primarily during division for 9’s complement operations.
  • Flip-Flop E: Stores the end-carry generated during arithmetic operations (not C or V).
  • Digit QL: Refers to the least significant digit of the multiplier stored in register Q.

⚙️Multiplication Algorithm

Step-by-Step Process

Step 1: Initialize - Transfer multiplicand to B, multiplier to Q. Counter SC is set to number of digits in multiplier
Step 2: Check low-order digit of multiplier QL. If QL = 0, no addition is needed
Step 3: Add multiplicand in B to partial product in A (QL times). Decrement QL after each addition
Step 4: Any temporary overflow digit will reside in Ae and can be range in value from 0 to 9.
Step 5: Shift right - Partial product and multiplier shifted once to the right. Zeros transferred to Ae, and rightmost digit moves into QL
Step 6: Decrement the sequence counter (SC). Repeat k times to form double-length product in AQ register

🔄Operation Flow

BCD Multiplication Flowchart

🧮Interactive Demonstration

Try multiplying two decimal numbers (single digit for simplicity):

×

💡Key Takeaways

✓ Decimal multiplication uses BCD arithmetic with digits 0-9

✓ The multiplicand is added to the partial product n times (where n = multiplier digit value)

✓ A 17-bit memory organization handles the operation efficiently

✓ The algorithm involves initialization, checking, addition, shifting, and repetition

✓ Overflow handling ensures accurate multi-digit results

Decimal Division