[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [oc] VHDL code for following condition needed



rshlp@indiainfo.com wrote:
> 
> Hi,
> 
> Assume you have a control pin A [Integer], a clk and output CNT.
> Now, depending on the value of A, CNT should count from A value.
> 
> That is,
> if A = 0, the counter should count from 0 to 3.
> if A = 1, the counter should count from 4 to 7.
> if A = 5, the counter should count from 20 to 23.
> if A = 2, the counter should count from 8 to 11.
> .. and so on.
> 
> Is there any way to write a general code for the above condition.
> Thanks in advance.
Ummm, yeah, its fairly obvious that the counter really only exists in 2
bits implying 0,1,2,3 and
you use the bits following that to be the value of A.
A=0 -> 000xx
A=1 -> 001xx
A=2 -> 010xx
etc.
where xx is the counted value.

Ali

> 
> RV
> --
> To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml
--
To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml