comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: implementing software unsigned divide
Date: Tue, 08 May 2001 08:04:05 +0200
Date: 2001-05-08T08:04:05+02:00	[thread overview]
Message-ID: <3AF78C54.DEA3DAB2@nbi.dk> (raw)
In-Reply-To: uae4oomya.fsf@gsfc.nasa.gov

Stephen:

> I'm porting GNAT to a 16 bit microprocessor that does not provide a
> hardware instruction for unsigned divide (it has multiply and signed
> divide, both 16 and 32 bit). Can anyone provide a reference to a book
> that discusses how to do this, and/or an algorithm that does it? I've
> looked in Knuth, and did an initial web search, and haven't found
> anything.

I have heard that there exists a free (Open Source) library for doing
calculations with very long integers. I suppose that you could find
something useful there.

A "cheap" solution could be to limit unsigned integers to the range
0 .. 2**31-1, but I am not sure this is allowed by the LRM.

Jacob
-- 
"... det er ul�kkert, at man selektivt vil t�mme
 ulande/�steuropa for velkvalificerede mennesker."
 Christian Mikkelsen



  reply	other threads:[~2001-05-08  6:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-07 21:42 implementing software unsigned divide Stephen Leake
2001-05-08  6:04 ` Jacob Sparre Andersen [this message]
2001-05-08  7:44 ` Tarjei T. Jensen
2001-05-08 13:18 ` Ted Dennison
2001-05-08 15:24 ` Tucker Taft
2001-05-08 21:20   ` Stephen Leake
2001-05-09 18:00     ` Tucker Taft
2001-05-10 15:54       ` Stephen Leake
2001-05-13 23:17       ` Kenneth Almquist
replies disabled

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