

|
 |
| Electronic Equipment > VHDL > Re: Signed, Uns... |
|
| << Topic |
< Post |
Post 15 of 49 Topic 6057 of 6417
|
Post > |
Topic >> |
Re: Signed, Unsigned syntax issues. Please help, I'm stumped
by rickman <gnuarm@[EMAIL PROTECTED]
>
Jun 11, 2008 at 08:52 AM
| On Jun 10, 5:59 pm, Andy <jonesa...@[EMAIL PROTECTED]
> wrote:
> On Jun 9, 6:55 pm, rickman <gnu...@[EMAIL PROTECTED]
> wrote:
>
>
>
> > On Jun 9, 2:28 pm, Mike Treseler <mike_trese...@[EMAIL PROTECTED]
> wrote:
>
> > > rickman wrote:
> > > > ---No matching overload for "/="---
>
> > > > DataOutReg is slv and CTPCurCmd is unsigned. I thought that the
two
> > > > types were "closely related" which means I don't have to use
> > > > conversions to intermix them.
>
> > > No, closely related means I can use
> > > a cast instead of a conversion as in:
>
> > > unsigned(DataOutReg) /= CTPCurCmd(DAT_RNG)
>
> > > Let's look up the "/=" functions available
> > > in the numeric_std source here:
>
> > >http://www.cs.umbc.edu/help/VHDL/packages/numeric_std.vhd
>
> > > function "/=" (L,R: UNSIGNED ) return BOOLEAN;
> > > function "/=" ( L,R: SIGNED) return BOOLEAN;
> > > function "/=" ( L: NATURAL; R: UNSIGNED) return BOOLEAN;
> > > function "/=" ( L: INTEGER; R: SIGNED) return BOOLEAN;
> > > function "/=" ( L: UNSIGNED; R: NATURAL) return BOOLEAN;
> > > function "/=" ( L: SIGNED; R: INTEGER) return BOOLEAN;
>
> > > For your example, a cast is needed to match the first signature.
>
> > > -- Mike Treseler
>
> > I have seen to_unsigned(), unsigned() and unsigned'. I understand
> > that the first to are conversion and type casting respectively. What
> > is the third called? I expect this is only for use where a literal or
> > expression can be interpreted more than one way and explains to the
> > tool what is intended, right?
>
> > I read back a bit and see that it is a "type qualification". I think
> > I got all that now. So even when types are closely related, you still
> > have to explicitly tell the tool to change the interpretation.
>
> > I think I wish I had started with Verilog instead of VHDL. At least
> > now if I start coding in Verilog, it will be an informed decision.
> > The little Verilog I have coded was very easy to do and I did it with
> > *no* additional training. I just picked up a little from a book and
> > the rest came pretty easy.
>
> > Does Verilog sup****t user libraries in a similar manner to VHDL?
>
> > Rick
>
> A long time ago there was a live design/coding contest between being
> Verilog and VHDL to code a small module that had a few strange
> requirements, but was otherwise pretty straight forward. Verilog
> trounced VHDL. But if you stopped there, and assumed Verilog was
> better than VHDL for most digital design, you missed the point.
> Anything that can be converted from spec to synthesized gates in an
> hour or two will almost necessarily be the easiest/quickest to design
> in the simplest, most constrained language capable of doing that
> simple job, namely verilog. Is that the basis upon which you want to
> choose your development language?
I recall that competition and I seem to recall that it was *very*
inconclusive. Although the Verilog teams seemed to be further along,
not one team produced working code in the time alloted. I guess this
could be a different contest though.
> To keep Mike an honest man: VHDL synthesis tools sup****t arithmetic
> for integers without additional libraries. However, bit-wise logic
> operations on integers are not sup****ted without custom libraries, and
> standard ranges for integers limit data widths to 31 bits unsigned and
> 32 bit signed.
I don't care if libraries are required for various features. I was
asking about sup****t for user libraries in Verilog. I believe the
answer was no. Is that still valid?
> One more point: just try to design a fixed or floating point
> arithmetic design with verilog!
Is that a point? What was the point? Are you trying to say that
users don't design arithmetic circuits in Verilog??? I am pretty sure
that the limited work I have done in Verilog has included arithmetic.
I must be missing your point.
BTW, here is one of the reasons I am getting tried of using VHDL. I
have coded FPGAs in VHDL off and on for some 10 years. Every time I
start a new design (sometimes as long as 18 months since the last one)
I have to pick up all of my books again to remember the details and to
read my notes on the various shortcuts to efficient use. I typically
find that the shortcuts are not very short and look for new ones. The
notation is just so verbose for simple things. Here is an example.
CTPBitCnt is an unsigned.
What I mean...
CTPBitCnt <= 1;
What I have to write...
CTPBitCnt <= to_unsigned(1, CTPBitCnt'length);
Doesn't that seem a bit wordy? I guess this example goes back to the
inability to overload the assignment operator which someone has
indicated may be changed in the next revision of the language.
Rick


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

|
|
|
|