Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > DAC implementation via VHDL within a CPLD

Reply
Thread Tools

DAC implementation via VHDL within a CPLD

 
 
AlfonsoGarcia
Guest
Posts: n/a
 
      06-14-2004
Hi all,
I am curious about how a implemenation of a digital to Analog converter
could work within a CPLD. From the knowledge I gained in the last few
weeks, a CPLD can be only used for digital communications. The internal
signals are either HIGH or LOW. I saw the following vhdl code:

process (d2a_reg)
variable d2a_int : integer;
variable d2a_real : real;
begin
d2a_int := CONV_INTEGER(d2a_reg);
d2a_real := (real (d2a_int)) / scale;
-- overflow
if (d2a_real > (real (overflow)) ) then
d2a_out <= real (overflow);
else
d2a_out <= d2a_real;
end if;
end process; -- d2a conversion block

But all what it does is, to convert the digital values to a real value.
How can I create an analog voltage dependend signal out of it. I guess I
would need external circuitry around my CPLD for my application.
Any help or explanation about this issue will be very much appreciated.

Alfons

 
Reply With Quote
 
 
 
 
Wallclimber
Guest
Posts: n/a
 
      06-14-2004
Hi Alfonso,

the VHDL code below was most likely part of a testbench or part of a
behavioral model of a chip that contains a DA convertor. Maybe it's a
CPLD that also contains a DA convertor?

Tom


"AlfonsoGarcia" <> wrote in message news:< alkaboutprogramming.com>...
> Hi all,
> I am curious about how a implemenation of a digital to Analog converter
> could work within a CPLD. From the knowledge I gained in the last few
> weeks, a CPLD can be only used for digital communications. The internal
> signals are either HIGH or LOW. I saw the following vhdl code:
>
> process (d2a_reg)
> variable d2a_int : integer;
> variable d2a_real : real;
> begin
> d2a_int := CONV_INTEGER(d2a_reg);
> d2a_real := (real (d2a_int)) / scale;
> -- overflow
> if (d2a_real > (real (overflow)) ) then
> d2a_out <= real (overflow);
> else
> d2a_out <= d2a_real;
> end if;
> end process; -- d2a conversion block
>
> But all what it does is, to convert the digital values to a real value.
> How can I create an analog voltage dependend signal out of it. I guess I
> would need external circuitry around my CPLD for my application.
> Any help or explanation about this issue will be very much appreciated.
>
> Alfons

 
Reply With Quote
 
 
 
 
Nicolas Matringe
Guest
Posts: n/a
 
      06-15-2004
AlfonsoGarcia a écrit:
[...]
> But all what it does is, to convert the digital values to a real value.
> How can I create an analog voltage dependend signal out of it. I guess I
> would need external circuitry around my CPLD for my application.
> Any help or explanation about this issue will be very much appreciated.


Hi
Forget about this code, type 'real' is NOT synthesizable.
You can make a very simple DAC with a few resistors and an op amp as
shown here for example: http://www.allaboutcircuits.com/vol_4/chpt_13/3.html

--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/

 
Reply With Quote
 
AlfonsoGarcia
Guest
Posts: n/a
 
      06-15-2004
That's what I mean. I need external circuitry in order to make the DA
converter reality. Only through a CPLD or FPGA it is not possible.
Thanks for the hints and help.
Alfonso

 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      06-15-2004
"AlfonsoGarcia" <> wrote:
> How can I create an analog voltage dependend signal out of it. I guess I
> would need external circuitry around my CPLD for my application.
> Any help or explanation about this issue will be very much appreciated.


Your right, you can't create an useful analog voltage only using
digital outputs. You need at least some resistors outside the
fpga/cpld.
A typical DAC using an fpga consists either of paralell outputs and a
resistor network, or does some PWM filtering with a lowpass.
Of course you could also use a ready DAC-IC and controll it by the
fpga.

bye Thomas
 
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
interface DAC in VHDL dptmt VHDL 0 07-01-2010 12:45 PM
confusion with ADC/DAC interface implementation alkosd@yahoo.co.uk VHDL 6 04-27-2010 04:05 AM
ADC and DAC Converters VHDL model Xabier Iturbe VHDL 6 05-16-2008 07:03 AM
Vhdl - Xc95108 CPLD A2K VHDL 8 02-27-2005 06:10 PM
Slightly OT: 12 bit DAC vs. 10 bit DAC br2001@webtv.net DVD Video 1 08-03-2003 05:40 AM



Advertisments