Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to write vhdl program for 1-d trigonometric function

Status
Not open for further replies.

rajeswari01

Junior Member level 3
Joined
Oct 13, 2010
Messages
26
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,438
hi,
I am new in vhdl, how to write vhdl program in 1-d trigonometric function using real value encoding,how to learn vhdl code for "conversion from integer to std_logic_vector" and vice versa. 1-D trigonometric function is f(x)=21.5+xsin(4Πx)+xcos(20Πx).
 

You need to read about Cordic Algorithms and their implementations in HDL.
--
Amr
 

If you've never done any VHDL coding (and I suspect, any digital design before), this is quite a hard one to start with.

But you will need sin and cos look-up tables generated in something like matlab.
Your whole design should be fixed point (not floating).
Why do you need to convert to std_logic_vector? why not keep it all integers or unsigned/signed types (or even better, use ufixed and sfixed).

Now come back when you've had a go.
 
ok,i keep only integer,hoew to write vhdl program for converting 01111111 (binary) into integer number(127)?

---------- Post added at 11:33 ---------- Previous post was at 11:30 ----------

how to learn vhdl code? which book will refer?
 
Last edited:

ok,i keep only integer,hoew to write vhdl program for converting 01111111 (binary) into integer number(127)?

the question is, is it signed or unsigned?
for unsigned:

u <= to_integer( unsigned(s));

or signed:
u <= to_integer( signed(s));
 

ok, thanks,

entity rr is
port(a:in std_logic_vector(7 downto 0);
b;out integer range 0 to 255);
end ff;
architecture behavioral of ff is
begin
b<=to_integer(unsigned(a);
end behavioral;
is this program is correct?
 

Then how will write vhdl code for converting binary number to integer number

---------- Post added at 15:32 ---------- Previous post was at 15:25 ----------

Any idea give for write this code
 

how will write program for convert (01111111)this binary number into integer number(127)
 

b<=to_integer(unsigned(a));

converts a to an integer type
This really means nothing, as at the end of the day, it is still binary in the FPGA. It is just to make your life easier in the code.

Do you understand digital electronics?
 

yes understand,but i simulated this code,i got one error in this program that is type 'a' incompatable with 'b',how will remove this error.
 

no, you need the following line at the top of the file:

use ieee.numeric_std.all;

Delete the following lines if you have them:
ieee.std_logic_arith.all;
ieee.std_logic_unsigneda.all;
 

ok, thanks,what is meaning for numeric_std.all,after synthesized, how will see behavioral simulation in xilinx
 

it is just a library of types and functions. It doesnt do anything itself.
 

ok,thanks,how will learn vhdl code

---------- Post added at 17:05 ---------- Previous post was at 17:04 ----------

which book refer for learn VHDL
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top