comp.lang.ada
 help / color / mirror / Atom feed
From: The Ludwig Family <ludwigs@bellsouth.net>
Subject: Re: Bit manipulation facilities in Ada
Date: 1998/11/22
Date: 1998-11-22T00:00:00+00:00	[thread overview]
Message-ID: <36575D47.43905794@bellsouth.net> (raw)
In-Reply-To: 36573C4D.DA431821@physics.purdue.edu

Look in the index for "modular integers" and look under "arrays", in 
particular one-dimensional boolean arrays.  For both of these categories, 
the operators "and", "or", "xor", and "not" are available.

If you cannot directly use either of these categories of types, you will 
need either to use Unchecked_Conversion (look up in the index) between your 
types and one of these types or to overload the "and", "or", "xor", and 
"not" operators to apply to your own types (the definitions of the over-
loadings perhaps using Unchecked_Conversion and the modular or boolean-array 
operators).

This is not particularly difficult, and the type-checking helps you keep 
straight what you are working with, whereas C basically allows you to hack 
around at the bits in a rather uncontrolled (and less safe) fashion.

Howard W. LUDWIG, Ph.D.

Robert T. Sagris wrote:
> 
> I'm thinking about taking an Data Security and Encryption course.
> The language for programming projects is open to the students.
> 
> I was wondering if any one could recommend any books that demonstrate
> low level bit manipulation in Ada.
> 
> I already have
> 
>     Ada as a Second Language
>     By: Cohen
> 
>     Ada 95: Problem Solving and Program Design
>     By: Feldman and Koffman
> 
>     Ada Programming and Methodology
>     By: Findlay etc.
> 
> None of which seem to cover this in any detail.
> 
> The Professor has already recommended C for its built in Bit operators.
> But I would like to try it in Ada, as I've never used in a class.
> I could use the practice.
> 
> Robbi Sagris




  parent reply	other threads:[~1998-11-22  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-21  0:00 Bit manipulation facilities in Ada Robert T. Sagris
1998-11-21  0:00 ` Srinivasan, R
1998-11-22  0:00   ` dewarr
1998-11-22  0:00     ` Simon Wright
1998-11-23  0:00       ` dewarr
1998-11-24  0:00         ` P.S. Norby
1998-11-23  0:00     ` Marin David Condic
1998-11-24  0:00     ` Ole-Hjalmar Kristensen
1998-11-24  0:00       ` John McCabe
1998-11-22  0:00 ` Matthew Heaney
1998-11-22  0:00   ` dewarr
1998-11-22  0:00 ` Robert T. Sagris
1998-11-22  0:00 ` The Ludwig Family [this message]
1998-11-23  0:00   ` dennison
1998-11-23  0:00 ` Robert I. Eachus
1998-11-24  0:00 ` Stephen Leake
replies disabled

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