revathivenkat
Newbie level 5
if i execut this program
i am getting error during run of this code in the lne which is represented in red.....
any one clear that......
i am getting error during run of this code in the lne which is represented in red.....
Code VHDL - [expand] 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 47 48 49 50 51 52 53 54 55 56 library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; package math_complex is type complex is record r :real; i :real; end record; function CMPLX(x,y: in complex ) return complex; function mul(x, y: in complex ) return complex; end math_complex; package body math_complex is function CMPLX(x,y: in complex ) return complex is variable f:complex; begin f.r:=x.r + y.r; f.i:=x.i + y.i; return f; end CMPLX ; function mul(x, y: in complex) return complex is variable k:complex; begin [COLOR=#ff0000][B]k.r:=(x.r * y.r) - (x.i * y.i); k.i:=(x.r * y.i) + (x.i * y.r);[/B][/COLOR] return k; end mul ; end math_complex; library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use work.math_complex.all; entity mathS is port(g,h:in complex; j,l:in complex; c,d:inout complex; y:out complex); end mathS; architecture data of mathS is begin c <= CMPLX(g,j); d <= CMPLX(h,l); y <= mul(c,d); end data;
any one clear that......
Last edited: