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

Reply

VHDL - strange function"std_logic_vector"

 
Thread Tools Search this Thread
Old 09-03-2008, 10:36 AM   #1
Default strange function"std_logic_vector"


hi,every one. I found a strange funtion in package "ieee.unsigned_std ";
like following:
----------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;

package STD_LOGIC_UNSIGNED is
.....
function "+"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR is
-- pragma label_applies_to plus
constant length: INTEGER := maximum(L'length, R'length);
variable result : STD_LOGIC_VECTOR (length-1 downto 0);
begin
result := UNSIGNED(L) + UNSIGNED(R);-- pragma label plus
return std_logic_vector(result);
end;
.......
----------------------------------------------------------------
do you notice the line"return std_logic_vector(result);"? "result" is the type of unsigned,and it is converted to the type of std_logic_vector.But, where does the function "std_logic_vector(arg: unsigned)" come from?
I have looked for it in IEEE.std_logic_1164 and IEEE.std_logic_arith,
and did not found it.
If I want to convert unsigned type to std_logic_vector,can I just do it in this way " std_logic_vector(result)", and needn't to use the function of conv_std_logic_vector which is in the package of ieee.std_logic_arth?


guaji

Last edited by guaji : 09-03-2008 at 10:40 AM.
guaji is offline   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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DOCTOR STRANGE on DVD TODD TAMANEND CLARK DVD Video 8 08-25-2007 12:34 PM
Re: Strange E-mail Problem SBFan2000 A+ Certification 0 09-14-2005 03:30 AM
DVD Verdict reviews: THE STRANGE VICE OF MRS. WARDH and more! DVD Verdict DVD Video 0 07-01-2005 09:11 AM
Strange DVD Diagnostic Problem... Jack DVD Video 11 12-19-2004 02:43 PM
Strange windows problem Paul C A+ Certification 1 05-21-2004 11:22 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46