comp.lang.ada
 help / color / mirror / Atom feed
From: Colin Paul Gloster <Colin_Paul_Gloster@ACM.org>
Subject: Re: Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH
Date: Thu, 3 Nov 2005 10:46:51 +0000 (UTC)
Date: 2005-11-03T10:46:51+00:00	[thread overview]
Message-ID: <dkcpqr$bol$1@hudsucker.umdac.umu.se> (raw)
In-Reply-To: m2veza9s3k.fsf@grendel.local

Simon Wright posted at Thu, 03 Nov 2005 06:13:19 +0000:

"[..]

I'm not sure what is actually required for portability here. AARM95
3.5.9(22-24) says

   The base range of an ordinary fixed point type need not include the
   specified bounds themselves so that the range specification can be
   given in a natural way, such as:

   type Fraction is delta 2.0**(-15) range -1.0 .. 1.0;

   With 2's complement hardware, such a type could have a signed
   16-bit representation, using 1 bit for the sign and 15 bits for
   fraction, resulting in a base range of -1.0 .. 1.0-2.0**(-15)."

I was unaware of this.

Simon Wright posted at Thu, 03 Nov 2005 06:13:19 +0000:

"[..]
      type F3 is delta 2.0**(-11) range -1.0 .. 1.0 - 2.0**(-11);
      type F4 is delta 2.0**(-14) range -2.0 .. 2.0 - 2.0**(-14);
[..]
[..] the output is
[..]
   F3's size is 12
   F4's size is 16

I'm not sure why F4's size is 16, though; is this a bug?"

No, the size of F4 should be 16 bits. Note that the smallest number F4 
can have is -2.0 as opposed to -1.0.

Remember, on 30 Oct 2005 08:41:38 -0800, Mnamky posted:

"[..]

[..] x is 12-bit wordlength and 11-bit fraction
and b is 16-bit wordlength and 14-bit fraction

[..]"

P.S. I apologize for distorting the References field in 
news:dka579$8fc$1@hudsucker.umdac.umu.se . The second entry in that 
field should of course not have been a copy of the first, but 
news:43653F2C.B20F75B5@fakeaddress.nil instead.



  reply	other threads:[~2005-11-03 10:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-30 16:41 Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH mnamky
2005-10-30 17:00 ` Dmitry A. Kazakov
2005-10-30 21:46 ` Gautier Write-only
2005-11-01  2:50 ` Steve
2005-11-02 10:42 ` Colin Paul Gloster
2005-11-02 20:43   ` Gautier Write-only
2005-11-03  6:13   ` Simon Wright
2005-11-03 10:46     ` Colin Paul Gloster [this message]
2005-11-03 13:47     ` Robert A Duff
2005-11-03 14:33       ` Dmitry A. Kazakov
2005-11-03 18:19         ` Jeffrey R. Carter
2005-11-03 20:55         ` Simon Wright
2005-11-02 10:57 ` Colin Paul Gloster
2005-11-02 14:49   ` Martin Krischik
2005-11-02 20:40   ` Gautier Write-only
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox