EmbDev.net

Forum: FPGA, VHDL & Verilog adg712 (switch) in VHDL


von sebgimi (Guest)


Attached files:

Rate this post
useful
not useful
Hi everyone!

I would like to right the code of the component ADG712 (datasheet in 
attachment), but I don't know how to do...

This is my code below (simplified):
1
entity adg712 is
2
     port(In1: in std_logic;
3
          S1: inout std_logic;
4
          D1: inout std_logic);
5
end adg712;
6
7
architecture archi of adg712 is
8
9
     signal out_gate: std_logic;
10
11
begin
12
13
     out_gate <= not(In1);
14
15
     S1 <= out_gate when In1 = '1' else 'z'; -- I think this part
16
     D1 <= out_gate when In1 = '1' else 'z'; -- is wrong
17
18
end archi;

The part I don't understand is the connection between the invert gate 
ouput and the wire S1 and D1.


Can you help me please ?

: Edited by Moderator
von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
sebgimi wrote:
> The part I don't understand is the connection between the invert gate
> ouput and the wire S1 and D1.
The INx pin of the ADG is a control pin for the behaviour between the 
two switch terminals Sx and Dx. The INx pin determines whether the two 
switch terminals are connected together or they are 'Z'...

> S1 <= out_gate when In1 = '1' else 'z'; -- I think this part
> D1 <= out_gate when In1 = '1' else 'z'; -- is wrong
You are very right.

> Can you help me please ?
Try google with "VHDL zero ohm". Thats a model for a bidirectional 
interconnection between two ports. You just have to tune it up a little 
and involve the control input INx...

: Edited by Moderator
von sebgimi (Guest)


Rate this post
useful
not useful
Thank you for your answer!

So if I understood right, I should write a thing like this:

  S1 <= D1 when In1 = '1' else 'Z';

I never use inout signal, so is this line enough or it will be better 
like this:

         S1 <= D1 when In1 = '1' else 'Z';
         D1 <= S1 when In1 = '1' else 'Z';

Thx

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Try it. Nothing of your proposals will work. It is a little more 
difficult. Thats why I added the search words for google (if you don't 
find anything try to add "Ben Cohen").

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.