adg712 (switch) in VHDL

Guest #3452786
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 ?
Attached files:
Moderator (Company: Titel) #3452805
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...
Guest #3452823
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
Moderator (Company: Titel) #3452963
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").

Reply

A question of your own? This thread is over 12 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.