title: Create Pattern 2^34 and store data
body: <p>We have written script which 2^n pattern(create truth table) and check with output.it is mainly use for determine circuit behavior. if you have 2^n input what should be output in those case.(based on some logic operation)</p>
  
  <p>it was working fine till 2^16 but As complexity increase Input has increase from 2^16 to 2^34.
  So We need to create truth table for such a big number and process data. </p>
  
  <p>The issue here,When I tried to traverse data but after 1 day application got crash with printing any thing. it may be stack overflow or memory error.</p>
  
  <p>My question is, Can we store such a big number in Python data. or Can we create truth table for such a big number.(using sympy or other library).</p>
  
  <p>One solution suggest us, Store into database or file for 2^34 number truth table and read from database and process it.So we can save time for generating truth table.</p>
  
  <p>is it possible to store such huge number. </p>
  
  <p>let me know if I need to provide more info or code snippets</p>
  
  <pre><code>  #here is in_ary is :[CK,Q0,Q1......Q32]
      def input_patterns(io_ary,in_ary):
          Num_patterns = pow(2,34)
          fn_patt = fn_patt = lambda i: i
          patts = {}
  
          i = 0
              while i &lt; Num_patterns:
                  i = i +1
                  io_patt, in_patt = [], []
                  while (1):
                      ii = fn_patt(i)
                      if not patts.has_key(ii):
                          patts[ii] = ii
                          break
                  for j in range(num_ins):
                      state = ii &amp; 1
                      globals()[in_ary[j]] = state
                      in_patt.append(state)
                      ii = ii &gt;&gt; 1
                  if Invalid_equation and eval(Invalid_equation) &amp; 1 == 1:
                      Num_patterns = Num_patterns - 1
                      continue        # if Qualifier is false do not include this pattern
                  patterns.append(io_patt + in_patt)
                  return patterns
  </code></pre>
  
  <p><strong>Output</strong>
  *<em>This is not of 2^34 bit but 2^16 out</em>*</p>
  
  <pre><code> &lt;Input Pin&gt;                             &lt;output pin&gt;
   1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |  1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
   0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |  1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
   1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |  0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
  </code></pre>