Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > variables with a big number of bit and bit operation

Reply
Thread Tools

variables with a big number of bit and bit operation

 
 
none
Guest
Posts: n/a
 
      01-03-2006

sorry for my bad english.

i'm trying to create variables made by a number of bit rounding about 500
bit, on which i can perform bit operations like & and |.
the problem is that i'm unable to resolve this problem without chunking the
variable in smaller parts, and this is a solution that i wouldn't use.

so everything you can say for helping me is wellcome.

thanks in advance,


--

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-03-2006
In article <43b9c070$0$1079$(E-Mail Removed)>,
none <(E-Mail Removed)> wrote:

>i'm trying to create variables made by a number of bit rounding about 500
>bit, on which i can perform bit operations like & and |.
>the problem is that i'm unable to resolve this problem without chunking the
>variable in smaller parts, and this is a solution that i wouldn't use.


If you refuse to chunking of the variable into smaller parts, then
you will need to:

a) find some very specific hardware that supports large bit operations
and code only for that; or

b) use a different programming language which will hide the chunking
from your sight; or

c) give up.


There is nothing you can do in standard C that can extend the
number of bits that the hardware itself can operate on at one time.
If the maximum word size that a particular compiler can use on
a particular machine is 32 bits, then there is not going to be anything
you can do to force the hardware to operate on 33 or 48 or 64 bits.
All you -can- do is write software routines that operate on a chunk
at a time.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
 
Reply With Quote
 
 
 
 
mensanator@aol.com
Guest
Posts: n/a
 
      01-03-2006


none wrote:
> sorry for my bad english.
>
> i'm trying to create variables made by a number of bit rounding about 500
> bit, on which i can perform bit operations like & and |.
> the problem is that i'm unable to resolve this problem without chunking the
> variable in smaller parts, and this is a solution that i wouldn't use.
>
> so everything you can say for helping me is wellcome.
>
> thanks in advance,
>
>
> --


Try using

GNU MP
The GNU Multiple Precision Arithmetic Library

This will give you bit operations on unlimited precision integers
along with some other interesting functions like scanning for the
least significant 1 or 0 bit, population count (number of 1 bits)
and Hamming distance (count of bit differences).

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
32-bit Number * 32-bit Number = 64-bit result Jeff.M Javascript 6 05-04-2009 09:21 PM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
Does bit operation always work more efficiently than math operation? david ullua C Programming 13 03-01-2006 11:02 PM



Advertisments