From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,509f8e43dc081fde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!news.umu.se!not-for-mail From: Colin Paul Gloster Newsgroups: comp.lang.ada Subject: Re: Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH Date: Thu, 3 Nov 2005 10:46:51 +0000 (UTC) Organization: News UmU SE Message-ID: References: <1130690498.388857.225170@g49g2000cwa.googlegroups.com> <43653F2C.B20F75B5@fakeaddress.nil> NNTP-Posting-Host: ryp76.ryp.umu.se X-Trace: hudsucker.umdac.umu.se 1131014811 12053 130.239.11.76 (3 Nov 2005 10:46:51 GMT) X-Complaints-To: newsmaster@umu.se NNTP-Posting-Date: Thu, 3 Nov 2005 10:46:51 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:6139 Date: 2005-11-03T10:46:51+00:00 List-Id: 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.