How do processors divide




















Active 1 year, 11 months ago. Viewed 17k times. Improve this question. Peter Cordes k 39 39 gold badges silver badges bronze badges. Joan Venge Joan Venge k gold badges silver badges bronze badges. You will have to ask an electronics engineer, it is a circuit design problem. Creating a hardware multiplier is pretty easy, a hardware divider is not.

Practical divider circuits are iterative and therefore take longer. Ask at electronics. Wikipedia cf. This seems to be regardless of the type. Who is volunteering to do a benchmark? In short: quotient estimate and correction steps. You're right that multiplication breaks down into multiple additions and division breaks down into multiple subtractions. The difference is that the additions in multiplication can be done in parallel, whereas in division, you can't do the next subtraction until finish the previous one and do a comparison.

So a hardware multiplier will exploit this inherent parallelism by computing and summing up many sub-products simultaneously at the cost of increased area real-estate. Division does not have this luxury. Show 3 more comments. Active Oldest Votes. Improve this answer. TheCodeArtist Lior Kogan Lior Kogan Add a comment. Lets consider a long multiplication of two n bit binary numbers. We can add the numbers in groups rather than sequentially.

You compute 0. Your adjusted guess is 0. Already pretty close! Repeat the process, and you get 0. There are some shortcuts. In floating point, you can extract powers of ten or powers of two, depending on the number base of your machine. And, for speed at the expense of greater memory use, you can use a pre-computed table for numbers in the range of 1 to b where b is your number base to get a guess that is immediately close to the required reciprocal and save one or two refinement steps.

Keep in mind that, as with multiplication and Kolmogorov's embarrassment by his student Anatoly Karatsuba, you never know when a faster or better method will be found. Never surrender your curiosity. Computers don't do iterative addition to multiply numbers - it would be really slow.

In stead, there are some fast multiplication algorithms. Sign up to join this community. The best answers are voted up and rise to the top.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How does division occur in our computers? Ask Question. Asked 9 years, 11 months ago. Active 8 months ago.

Viewed 41k times. What is the algorithm for it? You won't get a "simple" flowchart. There are fast ways and slow ways of doing it. Slow ways are easier to understand but the fast ways are used in modern CPUs what specifically do you want to know about? Do you just want a basic understanding of the principles or a detailed analysis of modern CPUs?

This question could use some help to make it much more clear of what is wanted like what konsalik is asking about but that doesn't make it off-topic. Show 6 more comments.

Active Oldest Votes. However, in the fused operation, the floating-point values are not rounded between the multiply and the add, they are rounded afterwards. For more information about floating-point rounding, see Floating Point. From Wikibooks, open books for an open world. Microprocessor Design. Category : Book:Microprocessor Design. Namespaces Book Discussion. Views Read Edit Edit source View history.

Reading room forum Community portal Bulletin Board Help out! Policies and guidelines Contact us.



0コメント

  • 1000 / 1000