adg712 (switch) in VHDL

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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

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.