EmbDev.net

Forum: FPGA, VHDL & Verilog VHDL Generic Counter with Clocked Rise OutPut


von Alexander S. (Company: Home) (alex_isr)


Attached files:

Rate this post
0 useful
not useful
Attached ModelSim VHDL design of Generic Counter with Clocked Rise 
OutPut.

 Regards Alex

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
Alexander S. wrote:
> design of Generic Counter with Clocked Rise OutPut.
All in all I see a very laborious way to generate a clock enable. Whats 
the advantage prior to a simple counter?

One word to this:
GENERIC (DivideRange  : integer);
:
signal ClockDivider, DividerFactor : integer range 0 to DivideRange;
:
begin
:
       DividerFactor <= DivideRange - 1;
:
       ClockDivider <= ClockDivider + 1 mod DividerFactor;
As "mod" implements a divider, this design will lead to extensive logic 
with some values for "DivideRange". Because only values in (2**x+1) will 
be easily synthesizable.

von Alexander S. (Company: Home) (alex_isr)


Rate this post
0 useful
not useful
Lothar M. wrote:
> As "mod" implements a divider, this design will lead to extensive logic
> with some values for "DivideRange". Because only values in (2**x+1) will


> be easily synthesizable.

-----------
https://www.ics.uci.edu/~jmoorkan/vhdlref/vhdl_golden_reference_guide.pdf

The
VHDL
Golden
Reference
Guide

Page 80 :

Operator

Synthesis

 The operators / mod ... ** are not synthesizable

 Regards Alex.

: Edited by User
von daniel__m (Guest)


Rate this post
0 useful
not useful
Alexander S. wrote:
> The operators / mod ... ** are not synthesizable

That's not true, at least not in all cases. Nor it is limited to trivial 
cases (eg. 2^n). I used it a few times.

The statement may be correct in 1995, but not nowadays.

greeting

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
Alexander S. wrote:
> The operators / mod ... ** are not synthesizable
Of  course x/(2**n) is synthesizable, because it's only some rewiring.
E.g. for x/4 just the lowest 2 bits are skipped.

And when a division is synthesizable, then "mod" is also, because that's 
only to ignore the upper bits.

von Alexander S. (Company: Home) (alex_isr)


Rate this post
0 useful
not useful
> Alexander S. wrote:
>> The operators / mod ... ** are not synthesizable

 So, synthesis tools is ignore mod statement and really no problem in 
the hardware ?

 Regards Alex.

: Edited by User

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig