circle generation algorithm

Feb 02, 2007 8 Replies

Hi, Does anyone know how to implemtent circle generation algorithm in verilog? i want to implement it in spartan 3 kit,for VGA pattern generator. i don't want to use ROM and RAM. please, reply as soon as possible



There was a thread in this newsgroup titled Video Circle Generator

Try Google groups...

I drove a plotter head with Bresenham's line and circle algorithms. They require very simple math and could be easily implemented with FPGAs either.

Have a look at the algorithm in "Computer Principles and Practices" Foley, Van Dam, et al. The circle drawing algorithm is implemented in the C programming language but you should be able to convert it into verilog.

Hi,

I got it working OK with my Spartan-3 Starter Kit-200K a while ago when I was experimenting with VGA graphics and the start of a vector engine. I was really outside the timing limits but it looked good anyway.

The advise I could give you to follow my example (not to blow the actual joy of implementing it) is to do Pyhtagoras Thorem:

formatting link

using the hardware multiplier..

Well I'm just a newbie so someone can probably think of a more effective way..

Seems like you could use a CORDIC, giving it the angle as an input and getting the coordinates of the circle out.

Check out:

formatting link

There are several decent free sources for CORDIC IP out there.

Tom

Bresenham's circle drawing algorithm is far simpler to implement. It was originally developed for exactly this application. Google "bresenham circle" to get all the info you'll need.

This is a great algorithm and each and every engineer should read it up and understand it's workings.

But as most FPGA designs have no use for the amount of hardware multipliers available in todays FPGAs, x*x + y*y < r*r might actually be a lot simpler.

Kolja Sulima

yes, it's lot easier and works fine... Thank you all for all your answers. i am still working on Bresenham's algorithm, just for the sake of implementing circle in a another way. Thank you again.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required