SlideShare a Scribd company logo
1 of 19
Computer Organization
and Architecture
Topic: Division Non-Restoring
Method
by
Upendra Mishra
(M. Tech., Ph.D.*)
KIET Group of Institutions
Prerequisites
 Shifting of Bits(Left or Right)
 Addition
 Subtraction
 2’s Complement
Division of unsigned binary integers
 Paper Pencil method
 Example:
 (Dividend)10/ (Divisor) 4 =(Quotient)2; (Remainder)2
Dividend
Divisor Quotient
Remainder
4 10 2
8
2
 Division of unsigned binary integers is
instructive method. There are two methods:
 Restore Method
 Non - Restore Method
Division of unsigned binary integers
Flowchart for Unsigned
Binary Division-
Non-Restore Method
start
nno of bits
M Divisor
A 0
Q Dividend
A < 0
Shift left AQ
A= A + M
Shift left AQ
A= A - M
A < 0
Q[0] = 0 Q[0] = 1
n=n-1
n=0
A < 0
Stop
A=A+M
Yes
No
Yes
No
No
No
Yes
Yes
Flowchart for Unsigned
Binary Division-
Non-Restore Method
start
nno of bits
M Divisor
A 0
Q Dividend
A < 0
Shift left AQ
A= A + M
Shift left AQ
A= A - M
A < 0
Q[0] = 0 Q[0] = 1
n=n-1
n=0
A < 0
Stop
A=A+M
Yes
No
Yes
No
No
No
Yes
Yes
Division by Non-Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
N M A Q ACTION
4 00011 00000 1011 Start
00001 011_ Left shift AQ
11110 011_ A=A-M
3 11110 0110 Q[0]=0
11100 110_ Left shift AQ
11111 110_ A=A+M
2 11111 1100 Q[0]=0
11111 100_ Left Shift AQ
00010 100_ A=A+M
1 00010 1001 Q[0]=1
00101 001_ Left Shift AQ
00010 001_ A=A-M
0 00010 0011 Q[0]=1
start
nno of bits
M Divisor
A 0
Q Dividend
A < 0
Shift left AQ
A= A + M
Shift left AQ
A= A - M
A < 0
Q[0] = 0 Q[0] = 1
n=n-1
n=0
A < 0
Stop
A=A+M
Yes
No
Yes
No
No
No
Yes
Yes
M = 00011
M’ = 11100
M’+1 = 11101
-M = 11101
-M = 11101
Division by Non-Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
N M A Q ACTION
4 00011 00000 1011 Start
00001 011_ Left shift AQ
11110 011_ A=A-M
3 11110 0110 Q[0]=0
11100 110_ Left shift AQ
11111 110_ A=A+M
2 11111 1100 Q[0]=0
11111 100_ Left Shift AQ
00010 100_ A=A+M
1 00010 1001 Q[0]=1
00101 001_ Left Shift AQ
00010 001_ A=A-M
0 00010(2)(R) 0011(3)(Q) Q[0]=1
start
nno of bits
M Divisor
A 0
Q Dividend
A < 0
Shift left AQ
A= A + M
Shift left AQ
A= A - M
A < 0
Q[0] = 0 Q[0] = 1
n=n-1
n=0
A < 0
Stop
A=A+M
Yes
No
Yes
No
No
No
Yes
Yes
10
Question
• Try dividing 13/4 and 15/3
11
Divide Overflow
Condition:
1. The number of bits in dividend is twice as the number of bits in the divisor. AND
2. The higher order half bits of the dividend have a value more than or equal to the value of the
total bits of the divisor.
OR
1. The divide overflow also checks that whether the divisor is zero or not.
• All these conditions are checked before the division process starts.
• Let dividend(Q) = 1010 1100 (length 8 bit)
Divisor(M) is 0111 (length 4 bit)
Here, the number of bits in Q is twice the number of bits in M
Higher order half bits of Q is 1010 value 10
total bits value of M is 0111 value 7 so Q>M
OR check whether M is 0000 or not
if yes also indicate Divide Overflow
12
Reference
1.Computer System Architecture - Morris Mano
2.William Stallings, Computer Organization and Architecture-Designing for Performance,
Pearson Education, Seventh edition, 2006.
Thank
You
Thank
You
Division by Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
Start
nno of bits
M Divisor
A 0
Q Dividend
Shift left AQ
A= A - M
MSB
of A
Q[0] = 1
Q[0] = 0
Restore A
n = n-1
Is n = 0
Quotient in Q
Remainder in A
Stop
=1
=0
Yes
No
n M A Q Operation
4 00011 (3) 00000 (0) 1011 (11) initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100
Q[0]=0And
restore A
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 (2) 0011 (3) Q[0]=1
M = 00011
M’ = 11100
M’+1 = 11101
-M = 11101
-M = 11101
Division by Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
n M A Q Operation
4 00011 (3) 00000 (0) 1011 (11) initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100
Q[0]=0And
restore A
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 (2) 0011 (3) Q[0]=1
Division by Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
Start
nno of bits
M Divisor
A 0
Q Dividend
Shift left AQ
A= A - M
MSB
of A
Q[0] = 1
Q[0] = 0
Restore A
n = n-1
Is n = 0
Quotient in Q
Remainder in A
Stop
=1
=0
Yes
No
n M A Q Operation
4 00011 (3) 00000 (0) 1011 (11) initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100
Q[0]=0And
restore A
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 (2) 0011 (3) Q[0]=1
M = 00011
M’ = 11100
M’+1 = 11101
-M = 11101
-M = 11101
Division by Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
n M A Q Operation
4 00011 (3) 00000 (0) 1011 (11) initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100
Q[0]=0And
restore A
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 (2) 0011 (3) Q[0]=1
Division by Restore Method
11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder)
Start
nno of bits
M Divisor
A 0
Q Dividend
Shift left AQ
A= A - M
MSB
of A
Q[0] = 1
Q[0] = 0
Restore A
n = n-1
Is n = 0
Quotient in Q
Remainder in A
Stop
=1
=0
Yes
No
n M A Q Operation
4 00011 (3) 00000 (0) 1011 (11) initialize
00011 00001 011_ shift left AQ
00011 11110 011_ A=A-M
00011 00001 0110
Q[0]=0 And
restore A
3 00011 00010 110_ shift left AQ
00011 11111 110_ A=A-M
00011 00010 1100
Q[0]=0And
restore A
2 00011 00101 100_ shift left AQ
00011 00010 100_ A=A-M
00011 00010 1001 Q[0]=1
1 00011 00101 001_ shift left AQ
00011 00010 001_ A=A-M
00011 00010 (2) 0011 (3) Q[0]=1

More Related Content

Recently uploaded

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Division method Non Restoring.ppt

  • 1. Computer Organization and Architecture Topic: Division Non-Restoring Method by Upendra Mishra (M. Tech., Ph.D.*) KIET Group of Institutions
  • 2. Prerequisites  Shifting of Bits(Left or Right)  Addition  Subtraction  2’s Complement
  • 3. Division of unsigned binary integers  Paper Pencil method  Example:  (Dividend)10/ (Divisor) 4 =(Quotient)2; (Remainder)2 Dividend Divisor Quotient Remainder 4 10 2 8 2
  • 4.  Division of unsigned binary integers is instructive method. There are two methods:  Restore Method  Non - Restore Method Division of unsigned binary integers
  • 5.
  • 6. Flowchart for Unsigned Binary Division- Non-Restore Method start nno of bits M Divisor A 0 Q Dividend A < 0 Shift left AQ A= A + M Shift left AQ A= A - M A < 0 Q[0] = 0 Q[0] = 1 n=n-1 n=0 A < 0 Stop A=A+M Yes No Yes No No No Yes Yes
  • 7. Flowchart for Unsigned Binary Division- Non-Restore Method start nno of bits M Divisor A 0 Q Dividend A < 0 Shift left AQ A= A + M Shift left AQ A= A - M A < 0 Q[0] = 0 Q[0] = 1 n=n-1 n=0 A < 0 Stop A=A+M Yes No Yes No No No Yes Yes
  • 8. Division by Non-Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) N M A Q ACTION 4 00011 00000 1011 Start 00001 011_ Left shift AQ 11110 011_ A=A-M 3 11110 0110 Q[0]=0 11100 110_ Left shift AQ 11111 110_ A=A+M 2 11111 1100 Q[0]=0 11111 100_ Left Shift AQ 00010 100_ A=A+M 1 00010 1001 Q[0]=1 00101 001_ Left Shift AQ 00010 001_ A=A-M 0 00010 0011 Q[0]=1 start nno of bits M Divisor A 0 Q Dividend A < 0 Shift left AQ A= A + M Shift left AQ A= A - M A < 0 Q[0] = 0 Q[0] = 1 n=n-1 n=0 A < 0 Stop A=A+M Yes No Yes No No No Yes Yes M = 00011 M’ = 11100 M’+1 = 11101 -M = 11101 -M = 11101
  • 9. Division by Non-Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) N M A Q ACTION 4 00011 00000 1011 Start 00001 011_ Left shift AQ 11110 011_ A=A-M 3 11110 0110 Q[0]=0 11100 110_ Left shift AQ 11111 110_ A=A+M 2 11111 1100 Q[0]=0 11111 100_ Left Shift AQ 00010 100_ A=A+M 1 00010 1001 Q[0]=1 00101 001_ Left Shift AQ 00010 001_ A=A-M 0 00010(2)(R) 0011(3)(Q) Q[0]=1 start nno of bits M Divisor A 0 Q Dividend A < 0 Shift left AQ A= A + M Shift left AQ A= A - M A < 0 Q[0] = 0 Q[0] = 1 n=n-1 n=0 A < 0 Stop A=A+M Yes No Yes No No No Yes Yes
  • 11. 11 Divide Overflow Condition: 1. The number of bits in dividend is twice as the number of bits in the divisor. AND 2. The higher order half bits of the dividend have a value more than or equal to the value of the total bits of the divisor. OR 1. The divide overflow also checks that whether the divisor is zero or not. • All these conditions are checked before the division process starts. • Let dividend(Q) = 1010 1100 (length 8 bit) Divisor(M) is 0111 (length 4 bit) Here, the number of bits in Q is twice the number of bits in M Higher order half bits of Q is 1010 value 10 total bits value of M is 0111 value 7 so Q>M OR check whether M is 0000 or not if yes also indicate Divide Overflow
  • 12. 12 Reference 1.Computer System Architecture - Morris Mano 2.William Stallings, Computer Organization and Architecture-Designing for Performance, Pearson Education, Seventh edition, 2006.
  • 15. Division by Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) Start nno of bits M Divisor A 0 Q Dividend Shift left AQ A= A - M MSB of A Q[0] = 1 Q[0] = 0 Restore A n = n-1 Is n = 0 Quotient in Q Remainder in A Stop =1 =0 Yes No n M A Q Operation 4 00011 (3) 00000 (0) 1011 (11) initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0And restore A 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 (2) 0011 (3) Q[0]=1 M = 00011 M’ = 11100 M’+1 = 11101 -M = 11101 -M = 11101
  • 16. Division by Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) n M A Q Operation 4 00011 (3) 00000 (0) 1011 (11) initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0And restore A 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 (2) 0011 (3) Q[0]=1
  • 17. Division by Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) Start nno of bits M Divisor A 0 Q Dividend Shift left AQ A= A - M MSB of A Q[0] = 1 Q[0] = 0 Restore A n = n-1 Is n = 0 Quotient in Q Remainder in A Stop =1 =0 Yes No n M A Q Operation 4 00011 (3) 00000 (0) 1011 (11) initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0And restore A 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 (2) 0011 (3) Q[0]=1 M = 00011 M’ = 11100 M’+1 = 11101 -M = 11101 -M = 11101
  • 18. Division by Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) n M A Q Operation 4 00011 (3) 00000 (0) 1011 (11) initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0And restore A 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 (2) 0011 (3) Q[0]=1
  • 19. Division by Restore Method 11(Dividend)/3(Divisor) 3(Quotient) and 2(Remainder) Start nno of bits M Divisor A 0 Q Dividend Shift left AQ A= A - M MSB of A Q[0] = 1 Q[0] = 0 Restore A n = n-1 Is n = 0 Quotient in Q Remainder in A Stop =1 =0 Yes No n M A Q Operation 4 00011 (3) 00000 (0) 1011 (11) initialize 00011 00001 011_ shift left AQ 00011 11110 011_ A=A-M 00011 00001 0110 Q[0]=0 And restore A 3 00011 00010 110_ shift left AQ 00011 11111 110_ A=A-M 00011 00010 1100 Q[0]=0And restore A 2 00011 00101 100_ shift left AQ 00011 00010 100_ A=A-M 00011 00010 1001 Q[0]=1 1 00011 00101 001_ shift left AQ 00011 00010 001_ A=A-M 00011 00010 (2) 0011 (3) Q[0]=1