Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - newbe: how to print integer and real numbers?

 
Thread Tools Search this Thread
Old 06-27-2006, 11:13 PM   #1
Default newbe: how to print integer and real numbers?


Hello,

quick question
I am simulating some simple VHDL code and need to
print integer and real variables.
Can someone give me examples or introduction pages to
basic IO in VHDL?
What I am also looking for is, kind of table
what type conversion function are provided and what are not
provided.

Thx in advance.

--
Daniel


=?ISO-8859-1?Q?Sch=FCle_Daniel?=
  Reply With Quote
Old 06-28-2006, 06:55 AM   #2
dipesh.trivedi
 
Posts: n/a
Default Re: newbe: how to print integer and real numbers?

Hi Daniel.
i think that you can do it by using textIO statements. try this i hope
it will work.


Schüle Daniel wrote:
> Hello,
>
> quick question
> I am simulating some simple VHDL code and need to
> print integer and real variables.
> Can someone give me examples or introduction pages to
> basic IO in VHDL?
> What I am also looking for is, kind of table
> what type conversion function are provided and what are not
> provided.
>
> Thx in advance.
>
> --
> Daniel


  Reply With Quote
Old 06-28-2006, 07:34 AM   #3
Ralf Hildebrandt
 
Posts: n/a
Default Re: newbe: how to print integer and real numbers?

Schüle Daniel wrote:


> I am simulating some simple VHDL code and need to
> print integer and real variables.
> Can someone give me examples or introduction pages to
> basic IO in VHDL?



Have a look into the package std.textio and see the available functions.
See, which parameters can be given to the available functions.

If you want to have ANSI C like text-I/O, have a look at
http://bear.ces.cwru.edu/vhdl/ Note that there is also a paper
describing the files.

Ralf
  Reply With Quote
Old 06-28-2006, 06:11 PM   #4
Amal
 
Posts: n/a
Default Re: newbe: how to print integer and real numbers?

Include STD.textio.all and use the image attribute to convert from
real/integer to string.

process
variable l : line;
variable r : real;
variable i : integer;
begin
-- real
write( l, real'image(r) );
writeline( output, l );

-- integer
write( l, integer'image(i) );
writeline( output, l );
end process;

-- Amal

  Reply With Quote
Old 06-29-2006, 12:01 AM   #5
=?ISO-8859-1?Q?Sch=FCle_Daniel?=
 
Posts: n/a
Default Re: newbe: how to print integer and real numbers?

Amal schrieb:
> Include STD.textio.all and use the image attribute to convert from
> real/integer to string.
>
> process
> variable l : line;
> variable r : real;
> variable i : integer;
> begin
> -- real
> write( l, real'image(r) );
> writeline( output, l );
>
> -- integer
> write( l, integer'image(i) );
> writeline( output, l );
> end process;


thx, this is what i was looking for


--
Daniel
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump