FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-21-2003, 07:34 PM
Valentin Tihomirov
Guest
 
Posts: n/a
Default what's bad in this declaratio of time constant?

constant BIT_TIME: time := 1/9600 sec;


???


Reply With Quote
  #2 (permalink)  
Old 10-21-2003, 07:40 PM
Jim Lewis
Guest
 
Posts: n/a
Default Re: what's bad in this declaratio of time constant?

In your example, sec is associated with
9600, so you actually wrote 1/time which
will not work.

Try this:
constant BIT_TIME: time := (1/9600) * 1 sec;

You may not need the parentheses, but it is more
readable with them.

Cheers,
jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training mailto:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


Valentin Tihomirov wrote:

> constant BIT_TIME: time := 1/9600 sec;
>
>
> ???
>
>


Reply With Quote
  #3 (permalink)  
Old 10-22-2003, 08:56 AM
Jonathan Bromley
Guest
 
Posts: n/a
Default Re: what's bad in this declaratio of time constant?

"Jim Lewis" <[email protected]> wrote in message
news:[email protected]

YES! SUCCESS! I caught Jim Lewis out!!!

> Try this:
> constant BIT_TIME: time := (1/9600) * 1 sec;


Bad plan. 1/9600 is evaluated as an integer, yielding
the value 0.

How about
constant BIT_TIME: time := 1 sec / 9600;

This will work because 1 sec == 10^15 fs, and arithmetic
on physical units is always scaled to the base unit,
which is fs in the case of time.

That comes close to paying you back for catching me
out with a cunning type conversion at your tutorial
in Lyon :-)
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: [email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.



Reply With Quote
  #4 (permalink)  
Old 10-23-2003, 10:13 AM
Jim Lewis
Guest
 
Posts: n/a
Default Re: what's bad in this declaratio of time constant?

> How about
> constant BIT_TIME: time := 1 sec / 9600;


Good point.
Serves me right for typing without thinking.


> That comes close to paying you back for catching me
> out with a cunning type conversion at your tutorial
> in Lyon :-)


You have a long memory. I will have to remember not
to what I did at FDL again - if only I could remember
what it was.

Cheers,
Jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training mailto:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


Jonathan Bromley wrote:

> "Jim Lewis" <[email protected]> wrote in message
> news:[email protected]
>
> YES! SUCCESS! I caught Jim Lewis out!!!
>
>
>>Try this:
>> constant BIT_TIME: time := (1/9600) * 1 sec;

>
>
> Bad plan. 1/9600 is evaluated as an integer, yielding
> the value 0.
>
> How about
> constant BIT_TIME: time := 1 sec / 9600;
>
> This will work because 1 sec == 10^15 fs, and arithmetic
> on physical units is always scaled to the base unit,
> which is fs in the case of time.
>
> That comes close to paying you back for catching me
> out with a cunning type conversion at your tutorial
> in Lyon :-)
> --
> Jonathan Bromley, Consultant
>
> DOULOS - Developing Design Know-how
> VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
>
> Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
> Tel: +44 (0)1425 471223 mail: [email protected]
> Fax: +44 (0)1425 471573 Web: http://www.doulos.com
>
> The contents of this message may contain personal views which
> are not the views of Doulos Ltd., unless specifically stated.
>
>
>


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which terms include the setup time and hold time in Xilinx ISE timinganalysis? [email protected] FPGA 0 12-04-2008 10:02 AM
If the input of the register will be intrigated by two signal time to time, how can i sovle this singal-conflicting project? GarderPains Verilog 0 11-12-2007 03:24 AM
A constant value of 0 in block YiQi FPGA 3 05-08-2006 02:22 AM
Rise time/fall time for Spartan3 clock inputs [email protected] FPGA 9 11-17-2005 03:54 PM
ModelSim & Constant Alexis GABIN FPGA 2 01-23-2005 08:38 PM


All times are GMT +1. The time now is 11:20 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved