Results 1 to 5 of 5

Thread: What is an X bit number?

  1. #1

    What is an X bit number?

    I am wondering what an X bit number is. Such as a 1024 bit number, how is that generated? And how can I create a 1024 or 2048 or even a 4096 bit prime number? I am trying to generate a 1024, 2048, or a 4096 bit prime number. How can I do this? I tried creating a program in C/C++ that started at 13 and multiplied that by 2 and then added 1 over and over but it doesn't go very high. Can someone define a whatever bit number?
    --------------------------------------------------------------------
    E, the modern pi.

  2. #2

    guess nobody knows

    I take it nobody knows?
    --------------------------------------------------------------------
    E, the modern pi.

  3. #3

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    I can't help you with the generating of the number but I can help explain it to you a little better.

    a X-bit number is simply what it says. A bit is a binary digit... A 1 or 0. So rather than use your large examples, let's use a small example (8-bit.. an octet). 8-bit means we have 8 binary digits (so 8, 1's or 0s). This means the largest number we could have is 11111111 which is 255 in decimal. With binary the lowest column is on the left and you work your way higher as you go right, the same as decimal. Each binary column represents 2^(column number - 1)

    2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
    1 1 1 1 1 1 1 1

    128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 == 255

    To figure out the number of possible combinations in an x-bit number you do 2^x, so for an 8 bit number you have 2^8 or 256 combinations ( 0 to 255). So a 1024 bit number would have 2^1024 or 1.797693134862315907729305190789e+308 combinations and would have binary places from 2^0 up to 2^1023. The numbers increase from there.

  5. #5
    AntiOnline Senior Member souleman's Avatar
    Join Date
    Oct 2001
    Location
    Flint, MI
    Posts
    2,883
    In other words, an X bit number is X 1's and 0's to create a binary number. So 1024 bits is 1024 1s and 0s making a possibly very large number.

    To use numbers like this, it requires pushing a lot of bits onto a stack. Basically, you maloc 1024 bits, then fill that space. To determine if that number is prime.... well, seach google for determining large prime numbers because its a pain to try to explain.

    Although..... if you have 1022 0's followed by two 1s (00000......00000011) you would have a 1024 bit prime number, although the number would be 3
    \"Ignorance is bliss....
    but only for your enemy\"
    -- souleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •