Talk About Network

Google





Programming > Ada > Bit operations ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 5716 of 6006
Post > Topic >>

Bit operations in Ada

by Dennis Hoppe <dennis.hoppe@[EMAIL PROTECTED] > May 23, 2008 at 11:19 PM

Hello,

I'm new to Ada and bitwise operations is a new challenge in this realm. 
My objective is to manipulate some bit strings in Ada, especially:

a) addition/subtraction mod 2**n,
b) change bits directly (e.g, via array access)
c) ****ft operations
d) rotate operations
e) and, xor, not, or

I started with an array of booleans of size 2**n, that provides neat 
access to individual bits by means of an index. Unfortunately, 
addition/subtraction mod 2**n is not sup****ted, but essential for me.

Next, I tried modular types (mod 2**n), but ended up with not having 
direct access to individual bits. My last attempt was to use 
Interfaces.Unsinged_n. It is a solid package that simplifies the usage 
of bitwise operations for me by adding ****ft and rotate operations. 
Addition modulo n works well, but I have to dispense with direct bit 
access, too.

So, what is coming next? Should I go with Interfaces.Unsinged_n and
provide a suitable function that converts the used type into an array of 
boolean? Maybe, I'm ought to use directly an array of boolean and try to 
convert the array into an Unsigned_n; if required to add two bit-strings.

I'm looking forward for some answers.

Best regards,
   Dennis

Best regards,
   Dennis
 




 11 Posts in Topic:
Bit operations in Ada
Dennis Hoppe <dennis.h  2008-05-23 23:19:25 
Re: Bit operations in Ada
Ludovic Brenta <ludovi  2008-05-24 00:08:11 
Re: Bit operations in Ada
Simon Wright <simon.j.  2008-05-24 16:36:13 
Re: Bit operations in Ada (endianness)
Dennis Hoppe <dennis.h  2008-06-02 15:27:32 
Re: Bit operations in Ada (endianness)
"(see below)" &  2008-06-02 15:01:19 
Re: Bit operations in Ada (endianness)
"Jeffrey R. Carter&q  2008-06-02 18:22:48 
Re: Bit operations in Ada (endianness)
Ludovic Brenta <ludovi  2008-06-02 19:38:15 
Re: Bit operations in Ada
Robert A Duff <bobduff  2008-05-23 18:38:50 
Re: Bit operations in Ada
"Randy Brukardt"  2008-05-23 19:27:48 
Re: Bit operations in Ada (Thank you)
Dennis Hoppe <dennis.h  2008-05-24 11:40:17 
Re: Bit operations in Ada
"Jeffrey R. Carter&q  2008-05-23 23:25:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 11:11:56 PST 2009.