SlideShare a Scribd company logo
1 of 15
RESTORING DIVISION &
NON-RESTORING DIVISION
ALGORITHMS
COMPUTER ARCHITECTURE
MADE BY : SANIA NISAR
Restoring Division Algorithm For Unsigned Integer
• A division algorithm provides a quotient and a remainder when we divide two
number.
• They are generally of two type slow algorithm and fast algorithm.
• Slow division algorithm are
 Restoring,
 non-restoring,
 non-performing restoring,
 SRT algorithm
• Under fast comes
 Newton–Raphson and
 Goldschmidt
Restoring Division Algorithm For Unsigned Integer
Restoring term is due to fact that value of register A is restored after each iteration.
Here, register Q contain quotient
and
register A contain remainder.
Here,
n-bit dividend is loaded in Q and
divisor is loaded in M.
Value of Register is initially kept 0
and this is the register whose value
is restored during iteration due to which it is
named Restoring.
Start
C , AC  0
M  Divisor
Q  Dividend
Count  n
Shift Left
AC , C , Q
AC  AC – M
Q0  1
C = 1 ?
Q0  0
AC  AC + M
Count= Count – 1
C > 0 ENDYes No
Yes
No
Restoring Division Flowchart
Example:
Perform Non-Restoring Division for Unsigned Integer.
Dividend =11 Divisor =3 -M =11101
 Step-1: First the registers are initialized with corresponding values (Q = Dividend, M =
Divisor, A = 0, n = number of bits in dividend)
 Step-2: Then the content of register A and Q is shifted right as if they are a single unit
 Step-3: Then content of register M is subtracted from A and result is stored in A
 Step-4: Then the most significant bit of the A is checked if it is 0 the least significant bit of
Q is set to 1 otherwise if it is 1 the least significant bit of Q is set to 0 and value of register
A is restored i.e the value of A before the subtraction with M
 Step-5: The value of counter n is decremented
 Step-6: If the value of n becomes zero we get of the loop otherwise we repeat from step 2
 Step-7: Finally, the register Q contain the quotient and A contain remainder
N M A Q OPERATION
4 00011 00000 1011 initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
N M A Q OPERATION
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100 Q[0]=0
00011 00010 110_ shift left AQ
N M A Q OPERATION
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
00011 00101 100_ shift left AQ
N M A Q OPERATION
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 0011 Q[0]=1
00011 00101 001_ shift left AQ
Non-Restoring Division For Unsigned Integer
• Non-Restoring division is less complex than the restoring one because simpler
operation are involved i.e. addition and subtraction, also now restoring step is
performed.
• In this method, rely on the sign bit of the register which initially contain zero named as
A.
• The advantage of using non-restoring arithmetic over the standard restoring
division is that a test subtraction is not required; the sign bit determines whether an
addition or subtraction is used. The disadvantage, though, is that an extra bit must be
maintained in the partial remainder to keep track of the sign.
Start
AC  0
M  Divisor
Q  Dividend
Count  n
AC is
+ive ?
Shift Left
AC , C , Q
AC  AC + M
Shift Left
AC , C , Q
AC  AC – M
AC is
+ive ?
Q0  1
Q0  0
Count= Count – 1
Count=
0 ?
A
AC is
-ive ?
AC  AC + M
END
Yes
No
Yes
No
Yes
No
Non-Restoring Division Flowchart
• Step-1: First the registers are initialized with corresponding values (Q = Dividend,
M = Divisor, A = 0, n = number of bits in dividend)
• Step-2: Check the sign bit of register A
• Step-3: If it is 1 shift left content of AQ and perform A = A+M, otherwise shift left AQ
and perform A = A-M (means add 2’s complement of M to A and store it to A)
• Step-4: Again the sign bit of register A
• Step-5: If sign bit is 1 Q[0] become 0 otherwise Q[0] become 1 (Q[0] means least
significant bit of register Q)
• Step-6: Decrements value of N by 1
• Step-7: If N is not equal to zero go to Step 2 otherwise go to next step
• Step-8: If sign bit of A is 1 then perform A = A+M
• Step-9: Register Q contain quotient and A contain remainder
Example:
Perform Non-Restoring Division for Unsigned Integer
Dividend =11 Divisor =3 -M =11101
• Step-1: First the registers are initialized with corresponding values (Q = Dividend, M =
Divisor, A = 0, n = number of bits in dividend)
• Step-2: Check the sign bit of register A
• Step-3: If it is 1 shift left content of AQ and perform A = A+M, otherwise shift left AQ and
perform A = A-M (means add 2’s complement of M to A and store it to A)
• Step-4: Again the sign bit of register A
• Step-5: If sign bit is 1 Q[0] become 0 otherwise Q[0] become 1 (Q[0] means least
significant bit of register Q)
• Step-6: Decrements value of N by 1
Example:
Perform Non-Restoring Division for Unsigned Integer
Dividend =11 Divisor =3 -M =11101
• Step-7: If N is not equal to zero go to Step 2 otherwise go to next step
• Step-8: If sign bit of A is 1 then perform A = A+M
• Step-9: Register Q contain quotient and A contain remainder
N M A Q ACTION
4 00011 00000 1011 Start
00001 011_ Left shift AQ
11110 011_ A=A-M
N M A Q ACTION
3 11110 0110 Q[0]=0
11100 110_ Left shift AQ
11111 110_ A=A+M
N M A Q ACTION
2 11111 1100 Q[0]=0
11111 100_ Left Shift AQ
00010 100_ A=A+M
N M A Q ACTION
1 00010 1001 Q[0]=1
00101 001_ Left Shift AQ
00010 001_ A=A-M
N M A Q ACTION
0 00010 0011 Q[0]=1
From calculations we get
Quotient = 3 (Q)
Remainder = 2 (A)

More Related Content

What's hot

Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representationAnil Pokhrel
 
Bit pair recoding
Bit pair recodingBit pair recoding
Bit pair recodingBasit Ali
 
Floating point representation
Floating point representationFloating point representation
Floating point representationmissstevenson01
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)cs19club
 
Shift micro operations & 4 bit combinational circuit shifter
Shift micro operations &  4 bit combinational circuit shifterShift micro operations &  4 bit combinational circuit shifter
Shift micro operations & 4 bit combinational circuit shifterMonika Chauhan
 
Digital Electronics Question Bank
Digital Electronics Question BankDigital Electronics Question Bank
Digital Electronics Question BankMathankumar S
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorVikas Gupta
 
Moore and mealy machine
Moore and mealy machineMoore and mealy machine
Moore and mealy machineMian Munib
 
Computer Organization And Architecture lab manual
Computer Organization And Architecture lab manualComputer Organization And Architecture lab manual
Computer Organization And Architecture lab manualNitesh Dubey
 
Clocked Sequential circuit analysis and design
Clocked Sequential circuit analysis and designClocked Sequential circuit analysis and design
Clocked Sequential circuit analysis and designDr Naim R Kidwai
 

What's hot (20)

Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
 
Bit pair recoding
Bit pair recodingBit pair recoding
Bit pair recoding
 
Floating point representation
Floating point representationFloating point representation
Floating point representation
 
Sr Latch or Flip Flop
Sr Latch or Flip FlopSr Latch or Flip Flop
Sr Latch or Flip Flop
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
 
Shift micro operations & 4 bit combinational circuit shifter
Shift micro operations &  4 bit combinational circuit shifterShift micro operations &  4 bit combinational circuit shifter
Shift micro operations & 4 bit combinational circuit shifter
 
Digital Electronics Question Bank
Digital Electronics Question BankDigital Electronics Question Bank
Digital Electronics Question Bank
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessor
 
Encoder
EncoderEncoder
Encoder
 
Moore and mealy machine
Moore and mealy machineMoore and mealy machine
Moore and mealy machine
 
Computer Organization And Architecture lab manual
Computer Organization And Architecture lab manualComputer Organization And Architecture lab manual
Computer Organization And Architecture lab manual
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
 
Clocked Sequential circuit analysis and design
Clocked Sequential circuit analysis and designClocked Sequential circuit analysis and design
Clocked Sequential circuit analysis and design
 

Similar to Restoring & Non-Restoring Division Algorithm By Sania Nisar

Module 3 of computer organization and architecture
Module 3 of  computer organization and architectureModule 3 of  computer organization and architecture
Module 3 of computer organization and architecturekumarloresh143
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual Shankar Gangaju
 
Division method Non Restoring.ppt
Division method Non Restoring.pptDivision method Non Restoring.ppt
Division method Non Restoring.ppthimanshu2125cse1052
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptssuser2ae35a
 
Booth's Multiplication Algorithm.pptx
Booth's Multiplication Algorithm.pptxBooth's Multiplication Algorithm.pptx
Booth's Multiplication Algorithm.pptxSMohiuddin1
 
Data representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsData representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsMumthas Shaikh
 
Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and DivisionArithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and DivisionRNShukla7
 
UNSIGNED AND SIGNED BINARY DIVISION
UNSIGNED AND SIGNED BINARY DIVISIONUNSIGNED AND SIGNED BINARY DIVISION
UNSIGNED AND SIGNED BINARY DIVISIONciyamala kushbu
 
Cobb Douglas production function
Cobb Douglas production functionCobb Douglas production function
Cobb Douglas production functionSuniya Sheikh
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithmGaurav Subham
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).pptnamraashraf56
 
BOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationBOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationSnehalataAgasti
 

Similar to Restoring & Non-Restoring Division Algorithm By Sania Nisar (20)

Module 3 of computer organization and architecture
Module 3 of  computer organization and architectureModule 3 of  computer organization and architecture
Module 3 of computer organization and architecture
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
 
Division method Non Restoring.ppt
Division method Non Restoring.pptDivision method Non Restoring.ppt
Division method Non Restoring.ppt
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Lec20
Lec20Lec20
Lec20
 
Division
DivisionDivision
Division
 
Ch_10.pptx.pdf
Ch_10.pptx.pdfCh_10.pptx.pdf
Ch_10.pptx.pdf
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.ppt
 
Booth's Multiplication Algorithm.pptx
Booth's Multiplication Algorithm.pptxBooth's Multiplication Algorithm.pptx
Booth's Multiplication Algorithm.pptx
 
Counters r012
Counters  r012Counters  r012
Counters r012
 
Data representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsData representation and Arithmetic Algorithms
Data representation and Arithmetic Algorithms
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and DivisionArithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and Division
 
Handwritten unit 2 part 42
Handwritten unit 2   part 42Handwritten unit 2   part 42
Handwritten unit 2 part 42
 
UNSIGNED AND SIGNED BINARY DIVISION
UNSIGNED AND SIGNED BINARY DIVISIONUNSIGNED AND SIGNED BINARY DIVISION
UNSIGNED AND SIGNED BINARY DIVISION
 
Cobb Douglas production function
Cobb Douglas production functionCobb Douglas production function
Cobb Douglas production function
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
 
BOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationBOOTH Algorithm for Multiplication
BOOTH Algorithm for Multiplication
 

Recently uploaded

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Restoring & Non-Restoring Division Algorithm By Sania Nisar

  • 1. RESTORING DIVISION & NON-RESTORING DIVISION ALGORITHMS COMPUTER ARCHITECTURE MADE BY : SANIA NISAR
  • 2. Restoring Division Algorithm For Unsigned Integer • A division algorithm provides a quotient and a remainder when we divide two number. • They are generally of two type slow algorithm and fast algorithm. • Slow division algorithm are  Restoring,  non-restoring,  non-performing restoring,  SRT algorithm • Under fast comes  Newton–Raphson and  Goldschmidt
  • 3. Restoring Division Algorithm For Unsigned Integer Restoring term is due to fact that value of register A is restored after each iteration. Here, register Q contain quotient and register A contain remainder. Here, n-bit dividend is loaded in Q and divisor is loaded in M. Value of Register is initially kept 0 and this is the register whose value is restored during iteration due to which it is named Restoring.
  • 4. Start C , AC  0 M  Divisor Q  Dividend Count  n Shift Left AC , C , Q AC  AC – M Q0  1 C = 1 ? Q0  0 AC  AC + M Count= Count – 1 C > 0 ENDYes No Yes No Restoring Division Flowchart
  • 5. Example: Perform Non-Restoring Division for Unsigned Integer. Dividend =11 Divisor =3 -M =11101  Step-1: First the registers are initialized with corresponding values (Q = Dividend, M = Divisor, A = 0, n = number of bits in dividend)  Step-2: Then the content of register A and Q is shifted right as if they are a single unit  Step-3: Then content of register M is subtracted from A and result is stored in A  Step-4: Then the most significant bit of the A is checked if it is 0 the least significant bit of Q is set to 1 otherwise if it is 1 the least significant bit of Q is set to 0 and value of register A is restored i.e the value of A before the subtraction with M  Step-5: The value of counter n is decremented  Step-6: If the value of n becomes zero we get of the loop otherwise we repeat from step 2  Step-7: Finally, the register Q contain the quotient and A contain remainder
  • 6. N M A Q OPERATION 4 00011 00000 1011 initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A N M A Q OPERATION 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0 00011 00010 110_ shift left AQ
  • 7. N M A Q OPERATION 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 00011 00101 100_ shift left AQ N M A Q OPERATION 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 0011 Q[0]=1 00011 00101 001_ shift left AQ
  • 8. Non-Restoring Division For Unsigned Integer • Non-Restoring division is less complex than the restoring one because simpler operation are involved i.e. addition and subtraction, also now restoring step is performed. • In this method, rely on the sign bit of the register which initially contain zero named as A. • The advantage of using non-restoring arithmetic over the standard restoring division is that a test subtraction is not required; the sign bit determines whether an addition or subtraction is used. The disadvantage, though, is that an extra bit must be maintained in the partial remainder to keep track of the sign.
  • 9. Start AC  0 M  Divisor Q  Dividend Count  n AC is +ive ? Shift Left AC , C , Q AC  AC + M Shift Left AC , C , Q AC  AC – M AC is +ive ? Q0  1 Q0  0 Count= Count – 1 Count= 0 ? A AC is -ive ? AC  AC + M END Yes No Yes No Yes No Non-Restoring Division Flowchart
  • 10. • Step-1: First the registers are initialized with corresponding values (Q = Dividend, M = Divisor, A = 0, n = number of bits in dividend) • Step-2: Check the sign bit of register A • Step-3: If it is 1 shift left content of AQ and perform A = A+M, otherwise shift left AQ and perform A = A-M (means add 2’s complement of M to A and store it to A) • Step-4: Again the sign bit of register A • Step-5: If sign bit is 1 Q[0] become 0 otherwise Q[0] become 1 (Q[0] means least significant bit of register Q) • Step-6: Decrements value of N by 1 • Step-7: If N is not equal to zero go to Step 2 otherwise go to next step • Step-8: If sign bit of A is 1 then perform A = A+M • Step-9: Register Q contain quotient and A contain remainder
  • 11. Example: Perform Non-Restoring Division for Unsigned Integer Dividend =11 Divisor =3 -M =11101 • Step-1: First the registers are initialized with corresponding values (Q = Dividend, M = Divisor, A = 0, n = number of bits in dividend) • Step-2: Check the sign bit of register A • Step-3: If it is 1 shift left content of AQ and perform A = A+M, otherwise shift left AQ and perform A = A-M (means add 2’s complement of M to A and store it to A) • Step-4: Again the sign bit of register A • Step-5: If sign bit is 1 Q[0] become 0 otherwise Q[0] become 1 (Q[0] means least significant bit of register Q) • Step-6: Decrements value of N by 1
  • 12. Example: Perform Non-Restoring Division for Unsigned Integer Dividend =11 Divisor =3 -M =11101 • Step-7: If N is not equal to zero go to Step 2 otherwise go to next step • Step-8: If sign bit of A is 1 then perform A = A+M • Step-9: Register Q contain quotient and A contain remainder
  • 13. N M A Q ACTION 4 00011 00000 1011 Start 00001 011_ Left shift AQ 11110 011_ A=A-M N M A Q ACTION 3 11110 0110 Q[0]=0 11100 110_ Left shift AQ 11111 110_ A=A+M
  • 14. N M A Q ACTION 2 11111 1100 Q[0]=0 11111 100_ Left Shift AQ 00010 100_ A=A+M N M A Q ACTION 1 00010 1001 Q[0]=1 00101 001_ Left Shift AQ 00010 001_ A=A-M N M A Q ACTION 0 00010 0011 Q[0]=1
  • 15. From calculations we get Quotient = 3 (Q) Remainder = 2 (A)