Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Integer Division

 
Thread Tools Search this Thread
Old 02-26-2008, 09:05 PM   #1
Default Integer Division


I am a complete novice to this language. Although I searched a lot for
division of integers in VHDL I couldn't find much. The previous posts
in this group were helpful but since I don't know much at this stage I
couldn't get them fully. Please guide me and suggest some sites which
can provide algorithms and related text regarding integer division.

Another query - does the / sign work in VHDL?


Bliss
  Reply With Quote
Old 02-26-2008, 11:36 PM   #2
Dwayne Dilbeck
 
Posts: n/a
Default Re: Integer Division
"/" works if you have defined a procedure or loaded the appropriate IEEE
library.


As for division
http://courses.cs.vt.edu/~cs1104/Bui...ivide.030.html

"binary" "division" "algorithm " "RTL" turns up some interesting hits on
google.

Were you planing to divide by a constant, a constant power of 2, or some
variable value?
Each can be optimized and instituted differently.

"Bliss" <> wrote in message
news:a9e76d87-abd3-43c5-9947-...
>I am a complete novice to this language. Although I searched a lot for
> division of integers in VHDL I couldn't find much. The previous posts
> in this group were helpful but since I don't know much at this stage I
> couldn't get them fully. Please guide me and suggest some sites which
> can provide algorithms and related text regarding integer division.
>
> Another query - does the / sign work in VHDL?





Dwayne Dilbeck
  Reply With Quote
Old 02-26-2008, 11:40 PM   #3
Duane Clark
 
Posts: n/a
Default Re: Integer Division
Bliss wrote:
> I am a complete novice to this language. Although I searched a lot for
> division of integers in VHDL I couldn't find much. The previous posts
> in this group were helpful but since I don't know much at this stage I
> couldn't get them fully. Please guide me and suggest some sites which
> can provide algorithms and related text regarding integer division.


Integer division by its very nature requires a lot of logic to
implement. Therefore, doing an integer division requires that you
balance the factors of:
Required resolution
Required latency time/clocks
Required division time/clocks
Resource utilization

The solution you pick is going to depend on how you balance those factors.

>
> Another query - does the / sign work in VHDL?


In simulation, yes. But generally not in synthesis, because the
synthesis tool does not know how to balance your design requirements.


Duane Clark
  Reply With Quote
Old 02-27-2008, 12:55 AM   #4
KJ
 
Posts: n/a
Default Re: Integer Division
>> Another query - does the / sign work in VHDL?
>
> In simulation, yes. But generally not in synthesis, because the synthesis
> tool does not know how to balance your design requirements.


Synthesis sure does support division (depending on the tool). Try
implementing a<= b / c with Quartus and it will synthesize just fine. You
make not like the performance because it is a hunk-o-logic but when you say
you want "a<= b / c" that combinatorially implements that logic that you
requested.

Kevin Jennings




KJ
  Reply With Quote
Old 02-27-2008, 01:32 AM   #5
Duane Clark
 
Posts: n/a
Default Re: Integer Division
KJ wrote:
>>> Another query - does the / sign work in VHDL?

>> In simulation, yes. But generally not in synthesis, because the synthesis
>> tool does not know how to balance your design requirements.

>
> Synthesis sure does support division (depending on the tool). Try
> implementing a<= b / c with Quartus and it will synthesize just fine. You
> make not like the performance because it is a hunk-o-logic but when you say
> you want "a<= b / c" that combinatorially implements that logic that you
> requested.


Hmm.. a combinatorial implementation. A somewhat scary thought But
yea, I could see synthesis tools supporting division, especially if it
would support absorbing registers following the division into a pipeline
(something like XST does already with multipliers). That would be a
useful feature.


Duane Clark
  Reply With Quote
Old 02-27-2008, 09:39 AM   #6
Philip Herzog
 
Posts: n/a
Default Re: Integer Division
Duane Clark wrote:
> In simulation, yes. But generally not in synthesis, because the
> synthesis tool does not know how to balance your design requirements.


Xilinx ISE 9.2 does synthesize it - if the divisor is a constant and a
power of 2, that is. It is synthesized as a shift then.

- Philip
--
When all questions of space, time, matter and the
nature of being have been resolved, only one question
remains - "Where shall we have dinner?"
(Douglas Adams)


Philip Herzog
  Reply With Quote
Old 03-10-2008, 09:24 PM   #7
jeppe
Senior Member
 
Join Date: Mar 2008
Location: Denmark
Posts: 245
Default
Check this page: Division

This gives a more interactive presentation of division: Opar1
Jeppe


jeppe
jeppe is offline   Reply With Quote
Old 04-15-2008, 07:06 AM   #8
Bliss
 
Posts: n/a
Default Re: Integer Division
On Feb 27, 4:36 am, "Dwayne Dilbeck" <ddilb...@yahoo.com> wrote:
> "/" works if you have defined a procedure or loaded the appropriate IEEE
> library.
>
> As for divisionhttp://courses.cs.vt.edu/~cs1104/BuildingBlocks/divide.030.html
>
> "binary" "division" "algorithm " "RTL" turns up some interesting hits on
> google.
>
> Were you planing to divide by a constant, a constant power of 2, or some
> variable value?
> Each can be optimized and instituted differently.
>
> "Bliss" <enjoywithn...@gmail.com> wrote in message
>
> news:a9e76d87-abd3-43c5-9947-...
>
> >I am a complete novice to this language. Although I searched a lot for
> > division of integers in VHDL I couldn't find much. The previous posts
> > in this group were helpful but since I don't know much at this stage I
> > couldn't get them fully. Please guide me and suggest some sites which
> > can provide algorithms and related text regarding integer division.

>
> > Another query - does the / sign work in VHDL?


Thanks for replies. The binary division link was of great help.
Actually I don't need a hefty and precise code for the division, just
a simple and approx. one. It's a small part of our big final year
project. So, at the Under grad level a not so accurate code would do.


Bliss
  Reply With Quote
Old 04-15-2008, 01:02 PM   #9
Dal
 
Posts: n/a
Default Re: Integer Division
On Feb 27, 7:05 am, Bliss <enjoywithn...@gmail.com> wrote:
> I am a complete novice to this language. Although I searched a lot for
> division of integers in VHDL I couldn't find much. The previous posts
> in this group were helpful but since I don't know much at this stage I
> couldn't get them fully. Please guide me and suggest some sites which
> can provide algorithms and related text regarding integer division.
>
> Another query - does the / sign work in VHDL?


Note if by simple you mean your dividend or divisor is constant and/or
your integers have a small range it may be efficient to implement the
divide as a look up table.


Dal
  Reply With Quote
Old 04-15-2008, 05:43 PM   #10
Bliss
 
Posts: n/a
Default Re: Integer Division
On Apr 15, 5:02 pm, Dal <darrin.n...@gmail.com> wrote:
> On Feb 27, 7:05 am, Bliss <enjoywithn...@gmail.com> wrote:
>
> > I am a complete novice to this language. Although I searched a lot for
> > division of integers in VHDL I couldn't find much. The previous posts
> > in this group were helpful but since I don't know much at this stage I
> > couldn't get them fully. Please guide me and suggest some sites which
> > can provide algorithms and related text regarding integer division.

>
> > Another query - does the / sign work in VHDL?

>
> Note if by simple you mean your dividend or divisor is constant and/or
> your integers have a small range it may be efficient to implement the
> divide as a look up table.


No they are variables. By simple I mean that I can compromise on
accuracy and the result needn't be a floating point no.


Bliss
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert string contain Hex data into integer asifjavaid Software 0 09-09-2008 08:50 AM
Gi Hold Retail Division cafemingle@yahoo.se DVD Video 0 01-08-2008 01:21 AM
Fast Integer Division In Vhdl Vitrion Hardware 0 11-01-2007 07:33 AM
getting integer values from electronic weigh scale through serial port dotnet_smart Software 2 09-17-2006 05:24 AM
getting integer values from electrolnic weigh scale through serial port dotnet_smart Hardware 0 07-28-2006 11:54 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46