Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20641 Discussions

help to rectify the error

Altera_Forum
Honored Contributor II
1,032 Views

architecture Behavioral of hamming is 

signal f : integer ; 

signal i : real := 0.0 ; 

signal Pi : real := 3.14159; 

 

begin 

f <= (passband)+ (transition_width /2) ; 

l1 : for i in (N-1)/2 downto (1-N)/2 generate 

w <= 0.54 + ( 0.46 *(COS((2*i*Pi)/(N-1)))); 

end generate ; 

l2 : for i in (N-1)/2 downto (1-N)/2 generate 

x<= 2*f*(SIN (i*wc)/i*Pi); 

end generate ; 

l3 : for i in (N-1)/2 downto (1-N)/2 generate 

h <= w and x ; 

end generate ; 

end Behavioral; 

ERRORS :  

"C:/.Xilinx/gateor/hamming.vhd" Line 51. * can not have such operands in this context. 

ERROR:HDLParsers:808 - "C:/.Xilinx/gateor/hamming.vhd" Line 54. * can not have such operands in this context. 

I AM USING  

use IEEE.MATH_REAL.ALL; 

use IEEE.NUMERIC_STD.ALL;
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
333 Views

what are you compiling this code in? If it's a synthesizer then it won't work, reals aren't synthesizable.

0 Kudos
Altera_Forum
Honored Contributor II
333 Views

sir,i am constructing hamming window for speech recognition system.can plz suggest me now anything on my program.

0 Kudos
Altera_Forum
Honored Contributor II
333 Views

dont use real type? use fixed point instead.

0 Kudos
Altera_Forum
Honored Contributor II
333 Views

and it could be a good idea to have a look at cosine/sine generation algorithms, or use a table to store precalculated values.

0 Kudos
Reply