![]() |
|
|
|
#1 |
|
In my design I have a parametrizable counter.
Then I use a package to define the number of bits of the counter: constant Nbit_cont : integer :=8; I also need to define the value of the max countable value+1: For example, if Nbit_cont is 8, then I define: constant Count_max : integer :=256; But I'd want to make this last assignment dependent from the constant Nbit_cont, with an expression like this: constant Count_max : integer :=2^Nbit_cont; ....but the " ^ " operator is not recognized by my VHDL compiler. Is there a solution to this problem? -- Per rispondermi via email sostituisci il risultato dell'operazione (in lettere) dall'indirizzo -*- To reply via email write the correct sum (in letters) in the email address Fabio G. |
|
|
|
|
#2 |
|
Posts: n/a
|
In VHDL there is no ^ operator; It's **, so 2**Nbit_cont should do the trick. Greetings, CM Wintersteiger On Sun, 30 May 2004 20:39:46 GMT, 7+ (Fabio G.) wrote: >In my design I have a parametrizable counter. >Then I use a package to define the number of bits of the counter: > >constant Nbit_cont : integer :=8; > >I also need to define the value of the max countable value+1: > >For example, if Nbit_cont is 8, then I define: > >constant Count_max : integer :=256; > >But I'd want to make this last assignment dependent from the constant >Nbit_cont, with an expression like this: > >constant Count_max : integer :=2^Nbit_cont; > >...but the " ^ " operator is not recognized by my VHDL compiler. >Is there a solution to this problem? Christoph M. Wintersteiger |
|
|
|
#3 |
|
Posts: n/a
|
Hi.
Left-Shift by N will do the trick. Cheers, Hernán Sánchez "Fabio G." <7+> escribió en el mensaje news:... > In my design I have a parametrizable counter. > Then I use a package to define the number of bits of the counter: > > constant Nbit_cont : integer :=8; > > I also need to define the value of the max countable value+1: > > For example, if Nbit_cont is 8, then I define: > > constant Count_max : integer :=256; > > But I'd want to make this last assignment dependent from the constant > Nbit_cont, with an expression like this: > > constant Count_max : integer :=2^Nbit_cont; > > ...but the " ^ " operator is not recognized by my VHDL compiler. > Is there a solution to this problem? > > > -- > Per rispondermi via email sostituisci il risultato > dell'operazione (in lettere) dall'indirizzo > -*- > To reply via email write the correct sum (in letters) > in the email address Hernán Sánchez |
|
|
|
#4 |
|
Posts: n/a
|
Christoph M. Wintersteiger <> ha scritto:
>In VHDL there is no ^ operator; It's **, so 2**Nbit_cont should do the >trick. Ok, it works! -- Per rispondermi via email sostituisci il risultato dell'operazione (in lettere) dall'indirizzo Fabio G. |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to execute an external software from VHDL? And how to interface VHDL with JAVA? | becool_nikks | Software | 0 | 03-06-2009 07:08 PM |
| Help on auto conversion from Matlab to vhdl on filter design | hardheart | Hardware | 0 | 12-07-2007 09:19 AM |
| VHDL RAM help!:) | lastval | Hardware | 0 | 11-09-2007 01:40 PM |
| ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL | freitass | Hardware | 0 | 11-01-2007 03:44 PM |
| vhdl code | amirster | Hardware | 0 | 05-10-2007 07:28 AM |