Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
 
EE Times-Asia > FPGAs/PLDs
 
 
FPGAs/PLDs  

Performing math operations in FPGAs (Part 5)

Posted: 05 Mar 2014  Print Version  Bookmark and Share

Keywords:binary math  integer division  dividend  divisor  remainder 

I am afraid to say that I lied to you in my previous article.

I said in that instalment would be the last of these rantings about binary math. But then I realised that I had no good references on performing binary division (especially in fixed-point), so I decided to dedicate this installment to binary division. I apologise in advance for the long-windedness of my pontifications. Fasten your seat belts!

Let's first refresh ourselves on the "long division" that we learned in grade school. Let's say we want to find how many threes are in 136 (136 ÷ 3)—I don't know why we'd ever want to do this, but I'm sure there's a good application for it somewhere. First, we set up our long division table as illustrated below.

Starting from the left (the higher-order digits), and working towards the right, we test how many times we can fit our divisor into our dividend. So, left-aligning the two numbers, we see that 3 will go into 1 zero times (or, more correctly, 300 will go into 100 zero times).

Next, we multiply the zero and our divisor, and put the properly-aligned result into the table beneath the dividend.

Now we subtract the results of the multiplication and place the result of the subtraction in the table—perhaps carrying down only the next digit in significance.

Using the next-lower-ordered bit, we see that 3 will go into 13 four times (or, more correctly, 30 will go into 130 four times).

We repeat this subtraction process until we've progressed through all of the digits.


1 • 2 • 3 Next Page Last Page



Article Comments - Performing math operations in FPGAs ...
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 
 
Back to Top