Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > Re: Signed, Uns...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 41 of 49 Topic 6057 of 6417
Post > Topic >>

Re: Signed, Unsigned syntax issues. Please help, I'm stumped

by "MikeWhy" <boat042-nospam@[EMAIL PROTECTED] > Jun 14, 2008 at 02:30 AM

"rickman" <gnuarm@[EMAIL PROTECTED]
> wrote in message 
news:bdf4e73d-f1d1-460d-a92c-be0518f01f56@[EMAIL PROTECTED]
>> > I specified that CTPBitCnt was an unsigned signal in the declaration.
>> > Does it make any sense to assume that I mean the literal 1 to be
>> > anything other than an unsigned equivalent?
>>
>> I hate having to flip back to the declaration to see what the type of a
>> particular signal is.
>
> Then how would you know to write unsigned(... rather than
> signed(... ?  Once the code is written, the meaning is obvious, assign
> the numerical value 1 to the signal in whatever format is
> appropriate.  Do you need to know that the signal is signed or
> unsigned to understand this assignment?

In C/C++, "promotion" of signed integer values is sign-bit extension; 
unsigned promotion is zero-extension. It seems a resaonable enough
approach 
to the problem you define. You only need to clearly establish whether your

literal constant is signed or unsigned.

>> > Maybe my software courses
>> > in college were too long ago for me to have learned why strong typing
>> > has to be so ***bersome.

C++ clearly defines type coercions, but we needn't go there on this, I 
think. I can tell you that allowing C-style typecasts, similar to VHDL 
typecasts, defeats its type system. VHDL, by not allowing more reasonable 
constructs, encourages the same abuse and misuse.

>> It needn't be...overrides for "<=" and ":=" would solve the wordiness
>> problem and still provide for the strong type checking....as someone
else
>> stated, other languages have it.

Yikes. Are there times when the two would be defined differently?

>> The needed conversion function can be the
>> function that provides an operator overload....just like how one can
>> overload "and", "or", etc. to work with custom types today.
>
> Yes, I think we all agree that would be a good idea.  I just don't
> understand why it has taken the experts over 20 years to figure this
> out.  I have only worked with this stuff part of the time and even
> then I was just trying to get something done with it, not invent the
> language... and I can clearly see the need.

I can see some issues. But so far, it sounds like you only want to better 
define assignment of signed/unsigned integer values and literal constants.

Size promotion rules will cover it without fighting that battle.

What other use would you have for assignment overload?
 




 49 Posts in Topic:
Signed, Unsigned syntax issues. Please help, I'm stumped
nitrogenocide@[EMAIL PROT  2008-05-31 11:58:04 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mtresel  2008-05-31 12:41:27 
Re: Signed, Unsigned syntax issues. --typo
Mike Treseler <mtresel  2008-05-31 12:43:10 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-05-31 15:41:06 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jonathan Bromley <jona  2008-05-31 20:43:17 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-05-31 19:53:08 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Andy Peters <google@[E  2008-06-02 15:04:56 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-09 11:06:36 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mike_tr  2008-06-09 11:28:44 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Andy <jonesandy@[EMAIL  2008-06-09 12:42:54 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-09 16:55:47 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-09 17:14:34 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mike_tr  2008-06-09 17:26:13 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Andy <jonesandy@[EMAIL  2008-06-10 14:59:39 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-11 08:52:56 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mike_tr  2008-06-11 11:14:07 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Brian Drummond <brian_  2008-06-12 14:02:55 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Brian Drummond <brian_  2008-06-16 11:43:24 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jonathan Bromley <jona  2008-06-16 12:45:30 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Brian Drummond <brian_  2008-06-17 12:18:49 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-12 11:42:18 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-12 21:41:42 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-15 10:38:11 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-15 20:25:41 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-16 09:22:19 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-16 07:35:46 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-11 09:17:20 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-11 11:41:59 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-12 00:11:48 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mike_tr  2008-06-12 09:51:58 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-12 04:58:01 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-12 21:02:00 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Mike Treseler <mike_tr  2008-06-13 10:31:24 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-12 21:10:12 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-13 05:24:59 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-15 10:06:35 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-13 17:05:12 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-13 17:25:08 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-13 22:35:18 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
rickman <gnuarm@[EMAIL  2008-06-13 20:58:54 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"MikeWhy" <b  2008-06-14 02:30:44 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jonathan Bromley <jona  2008-06-14 11:27:40 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jim Lewis <jim@[EMAIL   2008-06-15 10:32:43 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Jonathan Bromley <jona  2008-06-15 21:25:43 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-15 20:43:25 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-14 12:52:42 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
"KJ" <kkjenn  2008-06-14 12:47:00 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
Andy <jonesandy@[EMAIL  2008-06-16 06:08:33 
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
KJ <kkjennings@[EMAIL   2008-06-16 07:16:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 15:32:43 CST 2008.