Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | dakupoto@gmail.com |
|---|---|
| Newsgroups | comp.arch |
| Subject | Re: IEEE-754-2008 2's complement question |
| Date | 2012-03-04 19:40 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <18115254.3613.1330918840191.JavaMail.geo-discussion-forums@pbcwi5> (permalink) |
| References | <999f8083-6a41-4c59-b42f-883d8c8e9192@pz2g2000pbc.googlegroups.com> <9410230.2390.1330891506752.JavaMail.geo-discussion-forums@vbw15> |
On Sunday, March 4, 2012 3:05:06 PM UTC-5, bert wrote: Thank you very much for clarifying the sequence of steps. I fully agree that first of all the exponents have to be matched. The part that was confusing me was when would the 2's complement operation occur, that is given two numbers one with sign bit 0, and the other with sign bit 1, when in the sequence of steps would the 2's complement occur, before or after radix point alignment ? > No. Back around 1981 I wrote microcode to implement > this floating-point representation on a bit-slice > processor, so it goes (as far as I remember now): > > (a) the exponent of your 100.0 is way way bigger > than the exponent of 0.25, so to align the exponents:- > > (b) logically shift the 0.25 fraction and its hidden > bit 9 places to the right, and (notionally only) > increment its exponent by 9. > > (c) the exponents now match, so according to the > signs of the fractions and the specified operation > (+ or -), add or subtract them, including the hidden > bit of the larger fraction. When it's subtraction > instead of addition, then of course the smaller > fraction will be fully 2's complemented. > > (d) in this case we will just re-hide the hidden > bit of the result fraction, but ... > > (e) in other subtraction cases we may have to > shift the result fraction up 1 or more places, > and in the case of addition we may have to shift > the result fraction down 1 place, adjusting the > exponent appropriately in either case. > > That's it, apart from correct result rounding > (can be quite a pain) and underflow and overflow. > --
Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar
IEEE-754-2008 2's complement question Daku <dakupoto@gmail.com> - 2012-03-04 05:12 -0800
Re: IEEE-754-2008 2's complement question Mark Thorson <nospam@sonic.net> - 2012-03-04 10:37 -0800
Re: IEEE-754-2008 2's complement question BGB <cr88192@hotmail.com> - 2012-03-04 13:21 -0700
Re: IEEE-754-2008 2's complement question BGB <cr88192@hotmail.com> - 2012-03-04 13:49 -0700
Re: IEEE-754-2008 2's complement question Quadibloc <jsavard@ecn.ab.ca> - 2012-03-04 13:08 -0800
Re: IEEE-754-2008 2's complement question BGB <cr88192@hotmail.com> - 2012-03-04 14:43 -0700
Re: IEEE-754-2008 2's complement question Mark Thorson <nospam@sonic.net> - 2012-03-04 16:35 -0800
Re: IEEE-754-2008 2's complement question John Levine <johnl@iecc.com> - 2012-03-05 01:39 +0000
Re: IEEE-754-2008 2's complement question Mark Thorson <nospam@sonic.net> - 2012-03-04 18:53 -0800
Re: IEEE-754-2008 2's complement question John Levine <johnl@iecc.com> - 2012-03-05 04:04 +0000
Re: IEEE-754-2008 2's complement question Mark Thorson <nospam@sonic.net> - 2012-03-04 21:13 -0800
Re: IEEE-754-2008 2's complement question Terje Mathisen <"terje.mathisen at tmsw.no"> - 2012-03-05 08:27 +0100
Re: IEEE-754-2008 2's complement question BGB <cr88192@hotmail.com> - 2012-03-05 01:21 -0700
Re: IEEE-754-2008 2's complement question Jean-Marc Bourguet <jm@bourguet.org> - 2012-03-08 16:57 +0100
Re: IEEE-754-2008 2's complement question Terje Mathisen <"terje.mathisen at tmsw.no"> - 2012-03-08 18:55 +0100
Re: IEEE-754-2008 2's complement question Stefan Monnier <monnier@iro.umontreal.ca> - 2012-03-05 17:01 -0500
Re: IEEE-754-2008 2's complement question Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-03-04 22:32 -0700
Re: IEEE-754-2008 2's complement question MitchAlsup <MitchAlsup@aol.com> - 2012-03-04 11:46 -0800
Re: IEEE-754-2008 2's complement question bert <bert.hutchings@btinternet.com> - 2012-03-04 12:05 -0800
Re: IEEE-754-2008 2's complement question dakupoto@gmail.com - 2012-03-04 19:40 -0800
Re: IEEE-754-2008 2's complement question Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-03-04 22:33 -0700
Re: IEEE-754-2008 2's complement question bert <bert.hutchings@btinternet.com> - 2012-03-05 02:16 -0800
Re: IEEE-754-2008 2's complement question Quadibloc <jsavard@ecn.ab.ca> - 2012-03-04 13:09 -0800
csiph-web