scorpiosidewinder
Technical User
I have real data that has to be used in a VHDL program.
For Example: If A, B and C are real data types. How do I use them in a VHDL program to perform arithmetic operations on them.
If A, B and C were integers then... this below program works..
------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity circuit1 is
Port ( A : in integer;
B : in integer;
C : in integer;
Y : out integer);
end circuit1;
architecture Behavioral of circuit1 is
begin
y <= (A + B) * (C);
end Behavioral;
------------------------------------------------------------
How would i make the same program work if A, B and C were real data types...
I tried using "real" instead of "integer".. but it did not work...
Also could someone please give a program to find the cosine value of an angle?? Pleaseeee....
Thank you... I really appreciate it...
For Example: If A, B and C are real data types. How do I use them in a VHDL program to perform arithmetic operations on them.
If A, B and C were integers then... this below program works..
------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity circuit1 is
Port ( A : in integer;
B : in integer;
C : in integer;
Y : out integer);
end circuit1;
architecture Behavioral of circuit1 is
begin
y <= (A + B) * (C);
end Behavioral;
------------------------------------------------------------
How would i make the same program work if A, B and C were real data types...
I tried using "real" instead of "integer".. but it did not work...
Also could someone please give a program to find the cosine value of an angle?? Pleaseeee....
Thank you... I really appreciate it...