canadianJaouk said:
does anyone know if it would be possible to implement an "analog" (real
number) version of Ben Cohen's bidirectional switch in VHDL?
Yes, I have done it. Maybe I can provide the source code soon - have to
ask my boss.
The idea is simple: You need a resolved data type, but real is not
resolved. Furthermore you need something to describe the driving
strength similar to std_logic.
Ok, then define a new type that is a record out of one signal std_logic
(to describe the driving strength) and one signal real (to hold the
analog value). I have called this type uanalog (unresolved analog).
Then you need a resolution function making out of uanalog a new resolved
type (called analog). Make it similar to the resolution function that is
used for std_logic.
Put the definitions of the record uanalog, the resolution function and
the derived type analog into a package, include it where ever you want
and you are done.
And if you want to use Ben Cohens transfer gate model, have a look at my
modified version
http://www.ralf-hildebrandt.de/publication/transfergate/transfergate.vhd
http://www.ralf-hildebrandt.de/publication/transfergate/tbench_transfergate.vhd
The Problem of the transfergate in VHDL is, that it "fires" only once.
My modified version fires as often as you wish.
I have used my modified transfer gate model together with the uanalog /
analog types to model a network of analog switches to test purpose. It
was a testbench for a DAC with multiple selectable inputs. Several
simulted analog switches in a chain was not a problem with the modification.
Ralf