Division Algorithm क्या है?

Division Algorithm (Division Algorithm क्या है?)

Division Algorithm एक step-by-step procedure या method है, जिसका उपयोग Computer Architecture में binary numbers (0 और 1) को divide करने के लिए किया जाता है।

यह algorithm CPU को यह बताता है, कि Dividend को Divisor से कैसे divide करना है, ताकि सही Quotient (भागफल) और Remainder (शेषफल) प्राप्त हो सके।

Division को mathematically ऐसे represent किया जाता है :

Dividend ÷ Divisor = Quotient + Remainder

Key Points 

  • Division Algorithm binary numbers पर Work करता है।
  • यह CPU के अंदर ALU (Arithmetic Logic Unit) द्वारा execute किया जाता है।
  • यह algorithm step-by-step shift और subtract operations का उपयोग करता है।
  • Banking software, GST calculation, EMI calculation जैसे real-life systems में indirect रूप से use होता है।
  • Hardware level पर registers (A, Q, M) का उपयोग किया जाता है।

Example

  • Decimal Example : 10 ÷ 3 = 3 remainder 1
  • Binary Example : 1010 ÷ 0011

Basic Terms in Division

S.No

Term (English)

हिंदी अर्थ

Explanation 

Example

1

Dividend

भाज्य

वह संख्या जिसे divide किया जाता है

20 ÷ 4 → 20 is Dividend

2

Divisor

भाजक

वह संख्या जिससे divide किया जाता है

20 ÷ 4 → 4 is Divisor

3

Quotient

भागफल

Division के बाद प्राप्त मुख्य परिणाम

20 ÷ 4 = 5 → 5 is Quotient

4

Remainder

शेषफल

Division के बाद बची हुई संख्या

10 ÷ 3 = 3 remainder 1

5

Binary Division

द्विआधारी भाग

0 और 1 में division process

1010 ÷ 0011

6

Accumulator (A)

रजिस्टर

Division के दौरान intermediate result store करता है

Restoring division में use

7

Q Register

Dividend Register

इसमें Dividend store होता है

Q = 1010

8

M Register

Divisor Register

इसमें Divisor store होता है

M = 0011

9

n (Bit Count)

बिट

Total bits की संख्या

4-bit division

10

ALU (Arithmetic Logic Unit)

अंकगणितीय तर्क इकाई

CPU का भाग जो division perform करता है

CPU hardware

Why Division Algorithm is Important?
(Division Algorithm क्यों आवश्यक है?)

1. Accurate Mathematical Computation : Division Algorithm CPU को सही Quotient और Remainder निकालने में मदद करता है।

  • Scientific calculations
  • Engineering formulas
  • Physics simulations
  • Data analysis

इन सभी में accurate division जरूरी है।

2. Banking & Financial Systems : हर दिन लाखों transactions divide operations पर depend करते हैं:

  • EMI Calculation
  • Interest Rate Calculation
  • GST calculation
  • Tax distribution

3. CPU Performance & Efficiency : Division addition और subtraction की तुलना में ज्यादा complex operation है।

Efficient Division Algorithm:

  • Processing speed बढ़ाता है
  • Hardware resources optimize करता है
  • ALU को fast computation करने में मदद करता है

Modern processors Non-Restoring या optimized hardware division techniques use करते हैं।

4. Compiler & Programming Support : जब आप C, C++, Java या Python में division operator ( / ) use करते हैं, तो Compiler internally CPU instruction generate करता है, जो division algorithm follow करता है।

5. Real-Time Systems में उपयोग

  • Traffic management system
  • Stock market software
  • Online gaming score calculation
  • Cloud computing resource allocation

इन systems में fast division जरूरी है।

Types of Division Algorithm
(Division Algorithm के प्रकार)

Computer Architecture में Division Algorithm मुख्य रूप से दो प्रकार के होते हैं।

  1. Restoring Division Algorithm
  2. Non-Restoring Division Algorithm

1. Restoring Division Algorithm

Restoring Division Algorithm एक binary division method है, जिसका उपयोग Computer Architecture में signed या unsigned binary numbers को divide करने के लिए किया जाता है।

इस method में जब subtraction (A – M) के बाद result negative हो जाता है, तो accumulator (A) को फिर से original value में restore किया जाता है। इसी कारण इसे “Restoring” Division Algorithm कहा जाता है।

Key Points

  • Binary numbers पर Work करता है।
  • CPU के ALU (Arithmetic Logic Unit) में execute होता है।
  • Negative result आने पर restore operation होता है।
  • Left shift operation महत्वपूर्ण होता है।
  • Bit-by-bit quotient generate होता है।

Registers Used

Register

Purpose

A

Partial remainder store करता है

Q

Dividend store करता है

M

Divisor store करता है

n

Number of bits

Steps of Restoring Division Algorithm

  1. A = 0 initialize करें।
  2. Dividend को Q में load करें।
  3. Divisor को M में load करें।
  4. (A,Q) को left shift करें।
  5. A = A – M
  6. if A < 0
    • Q₀ = 0
    • A = A + M (Restore)
  7. else
    • Q₀ = 1
  8. n = n – 1
  9. जब तक n = 0 न हो जाए, repeat करें।

Example : 1010 ÷ 0011

Step 1: Initialize Registers

  • Dividend (Q) = 1010 
  • Divisor  (M) = 0011 
  • Accumulator (A) = 0000 
  • n = 4

Step 2: Iteration Process

Step

Operation

A (Accumulator)

Q (Dividend)

Remark

Initial

Initialize

0000

1010

A=0

1

Left Shift (A,Q)

0001

0100

Shift

 

A = A – M

0001 – 0011 = -0010

0100

Negative

 

Restore A

0001

Q₀ = 0

Restore

2

Left Shift (A,Q)

0010

1000

Shift

 

A = A – M

0010 – 0011 = -0001

1000

Negative

 

Restore A

0010

Q₀ = 0

Restore

3

Left Shift (A,Q)

0101

0000

Shift

 

A = A – M

0101 – 0011 = 0010

0000

Positive

 

Set Q₀ = 1

0010

0001

No Restore

4

Left Shift (A,Q)

0100

0010

Shift

 

A = A – M

0100 – 0011 = 0001

0010

Positive

 

Set Q₀ = 1

0001

0011

Final

Final Answer

  • Quotient (Q) = 0011  → (3)
  • Remainder (A) = 0001 → (1)
Restoring Division Algorithm – Advantages (लाभ)
  1. Simple & Easy to Understand : Step-by-step approach होने की वजह से beginners के लिए सीखना आसान होता है।
  2. Accurate Binary Division : Restore step की वजह से quotient और remainder हमेशा सही रहते हैं।
  3. Hardware Implementation Simple : केवल basic registers (A, Q, M) और ALU operations का उपयोग करके implement किया जा सकता है।
  4. Good for Educational Purpose : Computer Architecture और Digital Electronics में division का concept clear करने के लिए best है।
  5. Step-by-Step Debugging Possible : हर iteration को manually या simulation में check किया जा सकता है।
  6. Works for Signed & Unsigned Numbers : Proper modifications से positive और negative दोनों numbers divide किए जा सकते हैं।
  7. Foundation for Other Algorithms : Non-Restoring और SRT Division Algorithm जैसे advanced methods इसी पर base करते हैं।
  8. Predictable Hardware Usage : Registers और ALU cycles का count known रहता है।
  9. Clear Understanding of Shift & Subtract Concept : Binary arithmetic और bitwise operations को सीखने में मदद करता है।
Restoring Division Algorithm – Disadvantages (हानियाँ)  
  1. Slow Process : Negative result पर restore step की वजह से हर iteration में extra cycle लगती है।
  2. Extra Hardware Cycles : CPU को restore और subtract operations दोनों execute करने पड़ते हैं।
  3. Inefficient for Large Numbers : High-bit dividend में बहुत time-consuming और CPU-intensive होता है।
  4. Not Suitable for High-Speed CPUs : Modern processors fast division techniques prefer करते हैं।
  5. Complex for Signed Division : Negative numbers के लिए extra handling और additional logic required होती है।
  6. Memory and Registers Usage : हर step में A, Q और M registers का usage ज्यादा होता है।
  7. Cannot Directly Handle Floating-Point Numbers : Floating point division के लिए additional algorithm या normalization step जरूरी होता है।
  8. Extra Addition During Restore : Restore step के कारण additional addition operation perform करनी पड़ती है।
  9. Limited Efficiency Compared to Non-Restoring : Non-Restoring method cycle-saving और faster होता है।

2. Non-Restoring Division Algorithm

Non-Restoring Division Algorithm एक binary division method है, जिसका उपयोग Computer Architecture में signed या unsigned numbers को divide करने के लिए किया जाता है।

इस method में negative result आने पर restore operation नहीं किया जाता, बल्कि अगली iteration में correction कर दी जाती है।

Key Points 

  •  ALU (Arithmetic Logic Unit) द्वारा perform होता है।
  •  Negative result आने पर restore step skip होता है।
  •  Left shift operation जरूरी है।
  • Non-Restoring Division Algorithm की speed Restoring Division Algorithm की तुलना में ज्यादा होती है।
  •  Hardware efficient, modern CPUs में ज्यादा use होता है।

Registers Used

Register

Purpose

A

Partial remainder store करता है

Q

Dividend store करता है

M

Divisor store करता है

n

Number of bits

Steps of Non-Restoring Division Algorithm

  1. A = 0 initialize करें।
  2. Q में Dividend load करें।
  3. M में Divisor load करें।
  4. Left Shift (A,Q) करें।
  5. Check A :
    • अगर A ≥ 0 → A = A – M
    • अगर A < 0 → A = A + M
  6. Set Q₀ :
    • अगर A ≥ 0 → Q₀ = 1
    • अगर A < 0 → Q₀ = 0
  7. n = n – 1
  8. Repeat until n = 0
  9. Final Correction :
    • अगर A < 0 → A = A + M

Example : 1010 ÷ 0011 (Binary Division)

Step1: Initial Values

Register

Value

A

0000

Q

1010

M

0011

n

4

Step2: Iteration Table

Iteration

Operation

Left Shift (A,Q)

A after Subtract/Add M

Q₀ (Quotient bit)

Notes

1

Left Shift

A=0000, Q=1010 → A=0000, Q=1010

A = 0000 – 0011 = 1101 (Negative) → A = A + M = 0000

0

Negative → Q₀=0, no restore needed

2

Left Shift

A=0000, Q=1010 → A=0000, Q=1010

A = 0000 – 0011 = 1101 (Negative) → A = A + M = 0000

0

Negative → Q₀=0

3

Left Shift

A=0000, Q=1010 → A=0001, Q=0100

A = 0001 – 0011 = 1110 (Negative) → A = 1110 + M = 0001

0

Negative → Q₀=0

4

Left Shift

A=0001, Q=0100 → A=0010, Q=1000

A = 0010 – 0011 = 1111 (Negative) → A = 1111 + M = 0000

0

Negative → Q₀=0

Final Result

Register

Value

Quotient (Q)

0011

Remainder (A)

0001

Non-Restoring Division Algorithm – Advantages (लाभ)
  • Faster than Restoring Division : Negative result पर restore step skip होने से execution speed बढ़ जाती है।
  • Hardware Efficient : Extra addition operations कम होने से CPU cycles बचती हैं।
  • Fewer CPU Cycles Required : Large binary numbers के लिए computation और भी efficient होता है।
  • Handles Signed & Unsigned Numbers : Positive और negative दोनों numbers divide किए जा सकते हैं।
  • Efficient for Large Numbers : High-bit dividend में भी Non-Restoring method better performance देता है।
  • Simpler in Modern CPUs : Optimized hardware में easy implementation possible → high-speed division achievable।
  • No Restore Step Every Iteration : Redundant operations कम होने से execution तेज़ हो जाता है।
  • Foundation for Advanced Algorithms : SRT division और pipelined division जैसी modern methods इसी पर base करती हैं।
 Non-Restoring Division Algorithm – Disadvantages (हानियाँ)
  • Slightly Complex Algorithm : Restoring method की तुलना में logic थोड़ा complicated है।
  • Final Correction Required : Last iteration में यदि A < 0 हो तो final correction करना पड़ता है।
  • Manual Calculation Harder : Students के लिए step-by-step manual calculation Restoring method से challenging होता है।
  • Control Logic More Complex : CPU design में slightly more complex control signals की जरूरत पड़ती है।
  • Not Beginner Friendly : Initial learning phase में understanding Restoring method से आसान नहीं।
  • Error Prone in Manual Work : Multiple iterations में Q₀ और A calculation miss होने की संभावना रहती है।

Arithmetic Unit (Arithmetic Unit क्या है?)

Arithmetic Unit (AU) कंप्यूटर का वह हिस्सा है, जो mathematical operations perform करता है। यह ALU (Arithmetic Logic Unit) का मुख्य भाग होता है। Arithmetic Unit addition, subtraction, multiplication, division, increment, decrement जैसे operations को process करता है।

Key Points 

  • Arithmetic Unit ALU का हिस्सा है।
  • यह Binary numbers (0 और 1) के आधार पर calculations करता है।
  • Basic operations :
    • Addition (जोड़)
    • Subtraction (घटाव)
    • Multiplication (गुणा)
    • Division (भाग)
    • Increment / Decrement
  • Full Adder और Half Adder इसके मुख्य building blocks हैं।
  • Subtraction के लिए 2’s Complement method का उपयोग किया जाता है।
  • Modern computers में इसे multiplexer और control signals के साथ flexible बनाया जाता है।
  • Banking, E-commerce (Flipkart, Paytm), ISRO calculations, ERP systems में इसका उपयोग होता है।

Basic Components Used in Arithmetic Unit Design

1. Logic Gates : Arithmetic Unit के सभी operations logic gates पर आधारित होते हैं।

  • AND Gate – Multiplication और Carry generate करने के लिए।
  • OR Gate – Carry propagate और decision making में।
  • NOT Gate – Complement operations में।
  • XOR Gate – Addition और Subtraction में sum calculate करने के लिए।

2. Half Adder (HA)

  • दो 1-bit numbers को जोड़ने के लिए use होता है।
  • Outputs : Sum और Carry
  • केवल single-bit addition handle कर सकता है।
  • Subtraction directly नहीं कर सकता।
  • Formula :
    • Sum = A ⊕ B ⊕ Cin
    • Cout = (A·B) + (Cin·(A ⊕ B))

3. Full Adder (FA)

  • तीन inputs add करता है: A, B, Carry-in (Cin)
  • Outputs: Sum और Carry-out (Cout)
  • Multi-bit binary addition के लिए chain में use होता है।
  • Subtraction के लिए 2’s complement के साथ काम करता है।

4. Multiplexer (MUX)

  • Arithmetic Unit में multiple operations select करने के लिए use होता है।
  • Control signals के आधार पर operation select करता है जैसे: Addition, Subtraction, Increment आदि।

5. Registers

  • Temporary data storage के लिए उपयोग में आता है।
  • Inputs (A, B) और Result को store करता है।
  • High-speed computation में मदद करता है।

6. Control Signals 

  • Decide करते हैं कि कौन सा operation perform होगा।
  • Signals examples: Add, Subtract, Increment, Transfer
  • Arithmetic Unit को flexible और programmable बनाते हैं।

Advantages of Arithmetic Unit (अर्थमैटिक यूनिट के लाभ)

  1. High-Speed Computation
    • Arithmetic Unit में specially optimized circuits जैसे Carry Look Ahead Adder (CLA) use होते हैं।
    • High-speed operations possible होते हैं।
  2. Accurate Arithmetic Operations
    • Binary addition, subtraction, multiplication, और division बिना errors के perform होती हैं।
    • Scientific calculations में critical role निभाता है, जैसे ISRO satellite trajectory calculation
  3. Multiple Operations in Single Hardware
    1. Multiplexer और Control Logic की मदद से एक ही unit में Addition, Subtraction, Increment और Decrement perform किए जा सकते हैं।
    2. Hardware efficiency बढ़ती है।
  4. Flexible Design
    • Arithmetic Unit को program-controlled बनाया जा सकता है।
    • Different operations dynamically select किए जा सकते हैं।
  5. Low Power for Optimized Circuits
    • Advanced designs (CLA, optimized MUX) में redundant operations कम होते हैं | 
  6. Status Indication through Flags
    • Zero, Carry, Overflow flags automatically set होते हैं।
    • Program flow और decision-making आसान हो जाता है।
  7. Essential for Modern CPUs
    • Modern CPUs बिना Arithmetic Unit के काम नहीं कर सकते।
    • Applications जैसे banking, e-commerce, AI, robotics, spacecraft calculations depend करते हैं।

Limitations of Arithmetic Unit (अर्थमैटिक यूनिट की सीमाएँ)

  1. Complexity in Design
    • Advanced units जैसे Carry Look Ahead Adder या multi-bit multiplexer complex होते हैं।
    • Design और fabrication costly हो जाता है।
  2. Hardware Cost Increase
    • High-speed computation के लिए more gates और components चाहिए।
    • ASIC/FPGA design expensive हो जाता है।
  3.  Power Consumption
    • High-speed operations और multiple adders के उपयोग से power अधिक लगती है।
    • Large CPUs में thermal issues हो सकते हैं।
  4. Propagation Delay
    • Ripple Carry Adder में sequential carry होने के कारण computation slow होता है।
    • High bit-width numbers के लिए noticeable delay आता है।
  5. Limited by Word Length
    • Fixed bit-width Arithmetic Unit केवल fixed size numbers handle कर सकता है।
    • Large numbers के लिए multiple cycles या extended hardware चाहिए।
  6. Error Detection Required
    • Overflow या underflow situations handle करनी पड़ती हैं।
    • Especially signed numbers में carefuly design करना पड़ता है।
  7. Technology Dependent
    • Faster और power-efficient Arithmetic Unit technology (CMOS, TTL, FPGA) पर depend करता है।

Conclusion (निष्कर्ष)

  • Division Algorithm CPU को binary numbers को efficiently divide करने में मदद करता है, जिससे सही Quotient और Remainder मिलते हैं।
  • Restoring Division Algorithm simple और easy-to-understand है, लेकिन slow होता है।
  • Non-Restoring Division Algorithm modern CPUs में preferred है क्योंकि यह faster और hardware-efficient है।
  • Arithmetic Unit (AU) ALU का core part है और binary arithmetic operations (Addition, Subtraction, Multiplication, Division, Increment, Decrement) perform करता है।
  • Arithmetic Unit के design में Logic Gates, Half/Full Adders, Multiplexers, Registers, Control Signals का उपयोग होता है।
  • Optimized AU high-speed computation, multiple operations, low power, और accurate results provide करता है।
  • Limitations में hardware complexity, power consumption, propagation delay, word-length restrictions, error handling और technology dependence शामिल हैं।

अक्सर पूछे जाने वाले प्रश्न (FAQ)

Q1. Division Algorithm क्या है?

  • Binary numbers को step-by-step divide करने का procedure, जिससे CPU correct Quotient और Remainder निकाल सके।

Q2. Restoring और Non-Restoring Division में क्या difference है?

  • Restoring: Negative result पर accumulator restore होता है ।
  • Non-Restoring: Negative result पर restore skip होता है।

Q3. Arithmetic Unit में कौन-कौन से operations perform होते हैं?

  • Addition, Subtraction, Multiplication, Division, Increment, Decrement

Q4. Arithmetic Unit क्यों जरूरी है?

  • Modern CPUs के लिए core hardware है। High-speed calculation, accurate binary operations, और multiple arithmetic tasks handle करता है।

Q5. Arithmetic Unit के main components कौन से हैं?

  • Logic Gates (AND, OR, XOR, NOT)
  • Half Adder और Full Adder
  • Multiplexer (MUX)
  • Registers (A, Q, M)
  • Control Signals

Q6. Division Algorithm real-life में कहाँ use होता है?

  • Banking & Finance (EMI, Interest, GST), Scientific calculations (ISRO), Stock Market, Traffic management, Online gaming, Cloud computing

Q7. Arithmetic Unit के advantages और limitations क्या हैं?

  • Advantages: High-speed computation, accurate operations, multiple operations in single hardware, flexible design, low power, flags indication

  • Limitations: Complex design, high hardware cost, power consumption, propagation delay, limited by word length, error detection required, technology dependent

error: Content is protected !!