Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > how to pass input values to procedure

Reply
Thread Tools

how to pass input values to procedure

 
 
JSreeniv
Guest
Posts: n/a
 
      08-24-2009
Hi all,

I wrote a package for converting binary to Manchester format with
"wait" delays and the procedure looks like this

procedure HDR2MANCHESTER(Hdr_Word : in std_logic_vector(4 downto
0);
Hdr_Manch : out
std_logic_vector(9 downto 0));

variable hdr_i : integer;
variable manch_i : integer;
begin
hdr_i:= 5;
manch_i:= 10;
while(hdr_i<=0) loop
while(manch_i<=0) loop

--for hdr_i in 4 downto 0 loop
-- for manch_i in 9 downto 0 loop
if(Hdr_Word(hdr_i) = '0') then

wait for 50 ns;
Hdr_Manch(manch_i):= '0';
wait for 50 ns;
Hdr_Manch(manch_i-1):= '1';
else
wait for 50 ns;
Hdr_Manch(manch_i):= '1';
wait for 50 ns;
Hdr_Manch(manch_i-1):= '0';

hdr_i := hdr_i-1;
manch_i:= manch_i-1;
end if;
end loop;
end loop;
end HDR2MANCHESTER;

My query is if i want give input to Hdr_Word: 00001 (binary) and the
converting that function and assign to a signal which takes final
output.
so how to do:
what to put or how to pass real values
r_out <=HDR2MANCHESTER(??????)....

Please suggest me ....

Thanks
Sreeniv
 
Reply With Quote
 
 
 
 
Tricky
Guest
Posts: n/a
 
      08-24-2009
On Aug 24, 7:08*am, JSreeniv <(E-Mail Removed)> wrote:
> Hi all,
>
> I wrote *a package for converting binary to Manchester format with
> "wait" delays and the procedure looks like this
>
> procedure HDR2MANCHESTER(Hdr_Word * * : in std_logic_vector(4 downto
> 0);
> * * * * * * * * * * * * * * * * * * * * * * * Hdr_Manch * *: out
> std_logic_vector(9 downto 0));
>
> * variable hdr_i * : integer;
> * * * * * * * * * * * *variable manch_i : integer;
> * * * * * * begin
> * * * * * * * hdr_i:= 5;
> * * * * * * * manch_i:= 10;
> * * * * * * * while(hdr_i<=0) loop
> * * * * * * * * while(manch_i<=0) loop
>
> * * * * * * * --for hdr_i in 4 downto 0 loop
> * * * * * * * *-- for manch_i in 9 downto 0 loop
> * * * * * * * * * if(Hdr_Word(hdr_i) = '0') then
>
> * * * * * * * * * * *wait for 50 ns;
> * * * * * * * * * * *Hdr_Manch(manch_i):= '0';
> * * * * * * * * * * *wait for 50 ns;
> * * * * * * * * * * *Hdr_Manch(manch_i-1):= '1';
> * * * * * * * * * *else
> * * * * * * * * * * *wait for 50 ns;
> * * * * * * * * * * *Hdr_Manch(manch_i):= '1';
> * * * * * * * * * * *wait for 50 ns;
> * * * * * * * * * * *Hdr_Manch(manch_i-1):= '0';
>
> * * * * * * * * * * hdr_i *:= hdr_i-1;
> * * * * * * * * * * manch_i:= manch_i-1;
> * * * * * * * * * end if;
> * * * * * * * *end loop;
> * * * * * * end loop;
> * * * end HDR2MANCHESTER;
>
> My query is if i want give input to Hdr_Word: 00001 (binary) and the
> converting that function and assign to a signal which takes final
> output.
> so how to do:
> *what to put or how to pass real values
> * r_out <=HDR2MANCHESTER(??????)....
>
> Please suggest me ....
>
> Thanks
> Sreeniv


A procedure is not a function call, so you dont assign anything to the
procedure directly. all you need to do when you call it is:

HDR2MANCHESTER( Hdr_word => input,
Hdr_manch => r_out);

Treat it like a port map. But remember the procedure has to be used
inside a process.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: Variable Input on procedure - pass by value or pass by reference? Reuven VHDL 0 03-19-2009 07:21 PM
Re: Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:59 PM
Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:58 PM
How to bind input text field to pass as parameter to stored procedure in BLL darren.murray2@cingular.com ASP .Net 2 05-24-2007 11:27 PM



Advertisments