variables with a big number of bit and bit operation

Discussion in 'C Programming' started by none, Jan 3, 2006.

  1. none

    none Guest

    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,


    --
     
    none, Jan 3, 2006
    #1
    1. Advertising

  2. In article <43b9c070$0$1079$>,
    none <> 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
     
    Walter Roberson, Jan 3, 2006
    #2
    1. Advertising

  3. none

    Guest

    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).
     
    , Jan 3, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaguf
    Replies:
    0
    Views:
    561
    Shaguf
    Dec 24, 2008
  2. Shaguf
    Replies:
    0
    Views:
    508
    Shaguf
    Dec 26, 2008
  3. Shaguf
    Replies:
    0
    Views:
    277
    Shaguf
    Dec 26, 2008
  4. Shaguf
    Replies:
    0
    Views:
    259
    Shaguf
    Dec 24, 2008
  5. Jeff.M
    Replies:
    6
    Views:
    204
    Lasse Reichstein Nielsen
    May 4, 2009
Loading...

Share This Page