EmbDev.net

Forum: FPGA, VHDL & Verilog assign generic value to an output vhdl


von guy (Guest)


Rate this post
useful
not useful
Hi everyone,

I'm a newbie in vhdl and I would like to know if is it possible to 
assign a generic value to an output in vhdl.

For instance:
1
entity xxx is
2
3
    generic(value : real);
4
5
    port (a : in real;
6
          b : in real;
7
          s : out real);
8
9
end xxx;
10
11
archi archi of xxx is
12
begin
13
14
      s <= value;
15
16
end archi;

If it is not can you help me to find an other way please ?

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


Rate this post
useful
not useful
guy wrote:
> I would like to know if is it possible to assign a generic value to an
> output in vhdl.
It is.

> If it is not can you help me to find an other way please ?
A way to where?

: Edited by Moderator
von guy (Guest)


Rate this post
useful
not useful
Ahah, what is the way to do what I want? I tried as I have wrote it 
above but in simulation I have not the good value.

von Bitflüsterer (Guest)


Rate this post
useful
not useful
guy wrote:
> Ahah, what is the way to do what I want? I tried as I have wrote it
> above but in simulation I have not the good value.

As Lothar already wrote: Your code is sufficient to do what you want. If 
there is still a problem, please show the context (i.e. the testbench) 
and tell us in detail how and by what means you came to the conclusion, 
that the result is not what you expect.

von guy (Guest)


Rate this post
useful
not useful
You're right, my code was good indeed. I don't know why I had wrong 
values earlier. It is ok now. Thank you

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.