f



What differences are for type qualifier and type casting?

Hi,

I see the following on a tutorial, but it is not clear about the difference=
s=20
between type qualifier and type casting.

How do I use either one from "1010" and B_slv?

Thanks,


=E2=97=8F VHDL type qualifier (type_name') is a mechanism that specifies th=
e type
of an operand or return value of a subprogram (or operator).
 Z_sv <=3D A_sv + signed'("1010") ;=20

=E2=97=8F Without ', it is type casting. Use type casting for:
Z_sv <=3D A_sv +  signed(B_slv) ;=20


0
fl
9/28/2015 1:41:17 PM
comp.lang.vhdl 6430 articles. 2 followers. Post Follow

2 Replies
508 Views

Similar Articles

[PageSpeed] 26

On Monday, September 28, 2015 at 9:41:21 AM UTC-4, fl wrote:
> Hi,
>=20
> I see the following on a tutorial, but it is not clear about the differen=
ces=20
> between type qualifier and type casting.
>=20
> How do I use either one from "1010" and B_slv?
>=20
> Thanks,
>=20
>=20
> =E2=97=8F VHDL type qualifier (type_name') is a mechanism that specifies =
the type
> of an operand or return value of a subprogram (or operator).
>  Z_sv <=3D A_sv + signed'("1010") ;=20
>=20
> =E2=97=8F Without ', it is type casting. Use type casting for:
> Z_sv <=3D A_sv +  signed(B_slv) ;

After read previous posts of KJ and Rick, I am clear about my question now.=
 Types are now and then confusing.
0
fl
9/28/2015 4:24:32 PM
On 9/28/2015 12:24 PM, fl wrote:
> On Monday, September 28, 2015 at 9:41:21 AM UTC-4, fl wrote:
>> Hi,
>>
>> I see the following on a tutorial, but it is not clear about the differences
>> between type qualifier and type casting.
>>
>> How do I use either one from "1010" and B_slv?
>>
>> Thanks,
>>
>>
>> ● VHDL type qualifier (type_name') is a mechanism that specifies the type
>> of an operand or return value of a subprogram (or operator).
>>   Z_sv <= A_sv + signed'("1010") ;
>>
>> ● Without ', it is type casting. Use type casting for:
>> Z_sv <= A_sv +  signed(B_slv) ;
>
> After read previous posts of KJ and Rick, I am clear about my question now. Types are now and then confusing.

Lol!  That is like saying Godzilla was a rather large lizard!

-- 

Rick
0
rickman
9/28/2015 5:59:40 PM
Reply:

Similar Artilces:

Casting between const type** and type**
I have a function declared as such: void func(const int** p) { } If I have calling body void callfunc() { int** p; func(p); } VS.NET (2002) fails to compile: error C2664: 'const_test' : cannot convert parameter 1 from 'int ** ' to 'const int ** ' Is this expected behavior? I can resolve this error by using const_cast to force the type change. So I'm asking out of curiosity since I see nothing wrong with the code as is intuitively. when you have to use a cast between const and non-const variables you always have a design flaw. but in your example you only ...

Do different types of mathematicians prefer different types of functional languages?
Greetings, I am assuming that there is a sufficient overlap between the mathematical community and the FP community for the question to make sense. The world of functional programming seems divided into different communtities along language lines with occasional religious overtones. Similarly, mathematicians interested in foundational issues are also divided into different communities. My background is in one of those communities - namely Universal Algebra. Universal Algebra has an interesting relationship to another approach - Category Theory. They have common historical roots a...

What is the purpose of type() and the types module and what is a type?
The type() builtin according to python docs, returns a "type object". http://docs.python.org/2/library/types.html And in this module is bunch of what I assume are "type objects". Is this correct? http://docs.python.org/2/library/functions.html#type And type(), aside from being used in as an alternative to a class statement to create a new type, really just returns the object class, doesn't it? >>> import types >>> a = type(1) >>> b = (1).__class__ >>> c = int >>> d = types.IntType >>> a is b is c is...

Can *common* struct-members of 2 different struct-types, that are the same for the first common members, be accessed via pointer cast to either struct-type?
Assume identical common top struct members: struct a { int i1; char c1; short sa1[3]; }; struct b { int i2; char c2; short sa2[3]; int differ_here; }; struct a tmp; Are the following 2 line always equivalent (as in: yielding the same lvalue) and allowed: tmp.c1 ((struct b*)&tmp)->c1 Thanks. - John. In article <37f36566-0b91-4ee4-9135-6890c7c8de7a@12g2000vba.googlegroups.com>, John Reye <jononanon@googlemail.com> wrote: > Are the following 2 line always equivalent (as in: yielding the same > lvalue) and allowed: Maybe not. The guarantee only ...

type casting vs. type converting
type casting vs. type converting... what is the difference? which is better? any examples would be helpful. more specifically i am interested in changing between std_logic_vectors and signed and unsigned types (i.e. from std_logic_vector to unsigned and from unsigned to std_logic_vector). there doesnt seem to be any to_unsigned(std_logic_vector) function in the numeric_std library, why is that? is there any way around that? Hi Toby, > there doesnt seem to be any to_unsigned(std_logic_vector) function > in the numeric_std library, why is that? is there any way around that? The...

Different fundamental types for derived types
Hi all, On 64-bit capable versions of Solaris, we have constructs like this in /usr/include/sys/types.h: #if defined(_LP64) || defined(_I32LPx) typedef int uid_t; /* UID type */ #else typedef long uid_t; /* (historical version) */ #endif And similar statements for things like pid_t and so on. The question is this: given that an int and a long are the same size in a 32-bit Solaris process, why aren't they just defined as ints, and be done with it--why the conditionally compiled code? Given that no standard madates this, I'd like to know why this is so....

Why type hint when you can type cast
Hi Apart from the fatal error generated by type hinting when not passed values as array or object as described on the php manual, is there any thing else that will make me use type hinting over type casting? Thanks On 7/31/13 7:12 AM, Bruce Lee wrote: > Hi > > Apart from the fatal error generated by type hinting when not passed > values as array or object as described on the php manual, is there > any thing else that will make me use type hinting over type casting? > > > Thanks > The major purpose of type hinting IS to get the fatal error t...

Type casting using type name
I'm working in Delphi 2. I wanted to cause a program to select a cell of a stringgrid, i.e.... sgMyStringGrid.selection:=...... But I was havning trouble finding the right thing to go on the right hand side of the assignment. Thank you, Alan Lloyd, for the post that said the following would work: sgMyStringGrid.selection:=TGridRect(Rect(0,0,0,0)); (That selects the stringgrid's upper left cell.) I write to ask about the use of TGridRect in the above. It is the name for a type. I've only seen type names used with "var", or in the parameter declarat...

Type information in structs of different types
Is it well-defined and portable to do something like: typedef struct { int type; char c; } S1; typedef struct { int type; float f; } S2; void f(void* p) { S1* p1 = (S1*) p; S2* p2 = (S2*) p; if (p1->type == 1) { printf("%c\n", p1->c); } else { printf("%f\n", p2->f); } } int main(void) { S1 s1; s1.type = 1; s1.c = 'a'; S2 s2; s2.type = 2; s2.f = 42.0; f(&s1); f(&s2); } ? If so, are there any constraints (the "shared" fields of the struct...

Different types of cast
What is the difference between static cast and reinterpret cast? Ravi wrote: > What is the difference between static cast and reinterpret cast? With static_cast you may only cast within the same inheritance hierarchy, i.e. it is more restrictive and thus somewhat safer. dynamic_cast is similar, adding run-time checking and making the cast really safe. reinterpret_cast allows any cast. On 2009-12-24, Christof Warlich <cwarlich@gmx.de> wrote: > Ravi wrote: >> What is the difference between static cast and reinterpret cast? > > With static_cast you ma...

file types/data types/mime types
I am puzzled about something with osX. Why does it use the file extension for determining file type instead of looking into the file for the type? My Amiga used datatypes 15 years ago to determine what kind of file it was. If it was jpeg but named .gif, no problem. The jpeg program loaded it. For instance, I had a file on my desktop, an html file of instructions. It had no file extension so appeared on the desktop as a blank white rectangle. Re-named it 'html' so firefox showed up on the icon. I just renamed it 'jpg' and GraphicConverter tried to open it. It reported &q...

casting matrix from type logical to type double?
hi! is there any way to cast a matrix from one datatype to another? i need to cast a 'logical' matrix to 'double' matrix. a=im2bw(imread('pout.tif')); minmax(a) ??? Error using ==> minmax Argument has illegal type. minmax() function requires argument of type double while 'a' is of type logical. can anyone help me? Hi, help double J�r�me cherry: <SNIP logica-to-double... one of the solutions alog=true(3); adbl=double(alog); us ...

Casting from pointer types to non-pointer types
I am interfacing with a third party API (written in C, if that matters) that has an "event handler" function with the following definition: void event_handler(int event_code, unsigned long user_data); The function takes an event code along with the user data but does not act on or change the user data. In my application, I want to pass a pointer as the user data. This pointer is to an array allocated with new, say, as follows: char *array = new char[100]; and passed to the event handler as follows: event_handler(1, reinterpret_cast<unsigned long>(array)); My question is ...

Difference between Type 6 and Type 7 keyboards?
So what is the difference between Sun Type 6 and Type 7 keyboards? This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C90531.E9100F50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable "SQ" <onestatusquo@yahoo.com> wrote in message = news:aee4991d-4c3c-4e6f-a936-e6c71d686f32@m36g2000hse.googlegroups.com...= >=20 > So what is the difference between Sun Type 6 and Type 7 keyboards? Type 6 Type 7 No longer manufactured Currently being sold No USB ports on keyboard ...

Web resources about - What differences are for type qualifier and type casting? - comp.lang.vhdl

Difference - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

3Q EARNINGS: Mark Zuckerberg on the Differences Between Messenger and WhatsApp
When Facebook announced its intent to acquire cross-platform messaging application WhatsApp in February, questions surfaced on whether WhatsApp ...

Facebook Tips: What’s the Difference between Top News and Most Recent?
The following is part of our series, Facebook Tips, which answers some of the most commonly asked questions about using Facebook. While we hope ...

Sole difference in tourism stakes
A GIANT blue stiletto heel dubbed Taiwan’s “shoe church” is bringing a touch of oversized glamour to the island’s southern coast.

Women and weed: the gender differences in cannabis use and abuse
For a growing number of women, smoking dope every day is becoming a worrying habit.

iOS App Store brings in 75% more revenue than Play Store despite difference in downloads
... app store. The iOS App Store now earns 75 percent more revenue than the Google Play Store. This is an increase over the 70 percent difference ...

Is There Much Difference, Policy-Wise, Between Cruz, Rubio, Herr Trumpf And Ryan?
... Cruz or Rubio gets into the White House, we are in deep, deep trouble. Time to redouble our efforts for the one candidate who can make a difference ...

Sex Assault, Rapes At European Swimming Baths Blamed On 'Cultural Differences'
Public pools in Sweden and Germany are tightening security after a spate of sexual assaults and suspected rapes by migrant bathers on European ...

Sanders on differences with Clinton highlighted in campaign ad - Videos - CBS News
Democratic presidential candidate Bernie Sanders joins “CBS This Morning” from Burlington, Vermont, to discuss his latest campaign ad that explains ...

In year one, Rauner learned difference between statehouse and boardroom
One year after Republican Gov. Bruce Rauner took over as Illinois' chief executive, the private equity investor and rookie politician who pledged ...

Resources last updated: 1/25/2016 4:46:52 AM