Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > How to handle a real number in order to transport it to output in std_logic_vector

Reply
Thread Tools

How to handle a real number in order to transport it to output in std_logic_vector

 
 
thaosb thaosb is offline
Junior Member
Join Date: Mar 2009
Posts: 2
 
      04-10-2009
Hi everyone!

I am a beginner in VHDL. Im trying to write a program for my study but I encounter a problem about type of data in VHDL.

In my application, I have to convert a digital value to analog (specificly, convert digital value of current to analog (ampere)).

In my program, I wite a function using VHDL to calculate the value of current. All calculations are concerned with REAL values. I want to use the return value of this function as the input of D to A converter. I know that the input of D to A converter must be an INTEGER. Therefore, the return value of my function should be STD_LOGIC_VECTOR or have the type suitable for D to A converter input.

I really don't know how to handle the REAL values in my function in order to make the return value suitable for the input of D to A converter without losing the accuracy of the result of calculations. If I fail in handle the type of data, I can not get the correct conversion with D to A converter.

Can anybody tell me the method to deal wiht my problem?

Please help me.

Thank you very much.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How could I output a real signal to std_logic_vector? Will VHDL 3 03-20-2009 12:46 PM
inout std_logic_vector to array of std_logic_vector of generic length conversion... Thomas Rouam VHDL 6 11-09-2007 11:49 AM
Convert Real number to Std_logic_vector Sudhir VHDL 2 03-10-2007 05:18 PM
want to replace a read only cd transport with read / write transport larya Computer Support 7 09-11-2006 10:21 PM



Advertisments
 



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 57