title: Generate Binary Data Array From a Range of Numbers
body: <p>I need to create Boolean/Binary arrays with rows representing the binary form of each number in given a range. Each column hold values for a given bit position. The range is determined by the bit-width and binary encoding scheme. Then I need to count the number of cells in a column that do not match the preceding cell.  </p>
  
  <p>I believe the counting process is simply XORing the array with itself shifted down one row. The sum of each column in the XOR result is my transition count.</p>
  
  <p>I need to do this for each combination of [signed, unsigned] values encoded as [hexadecimal, octal, decimal]. Mismatches between the encoding scheme and available bits results in unusable bits.<br>
   <em>e.g. A 4-bit unsigned octal array would still only have 8 rows. However, if it is signed then that 4th bit is used for sign and the array is the full 16 rows.</em></p>
  
  <p>The ultimate goal is to create labeled set of summary n-grams for the number of transitions at each bit position for various bit widths, encoding, and use of sign. The summary n-gram for example 1 would be {3-bit, octal, unsigned, [1, 3, 7]}. The summary n-gram for example 3 is {4-bit, octal, signed, [1, 2, 6, 13]}. Example 4 is {4-bit, hexadecimal, signed, [1, 2, 6, 13]}.</p>
  
  <p><strong>Examples:</strong><br>
  <strong>1)</strong> 8x3 Binary array of all possible 3-bit unsigned octal values:<br>
  0   0   0<br>
  0   0   1<br>
  0   1   0<br>
  0   1   1<br>
  1   0   0<br>
  1   0   1<br>
  1   1   0<br>
  1   1   1</p>
  
  <p><strong>2)</strong> 8x4 Binary array of all possible 4-bit unsigned octal values:<br>
  Same as #1 except with an additional leftmost column of all zeros</p>
  
  <p><strong>3)</strong> 16x4 Binary array of all possible 4-bit signed octal values:<br>
  Note: It's ok to double count zero (-0 and +0)
  1   1   1   1<br>
  1   1   1   0<br>
  1   1   0   1<br>
  1   1   0   0<br>
  1   0   1   1<br>
  1   0   1   0<br>
  1   0   0   1<br>
  1   0   0   0<br>
  0   0   0   0<br>
  0   0   0   1<br>
  0   0   1   0<br>
  0   0   1   1<br>
  0   1   0   0<br>
  0   1   0   1<br>
  0   1   1   0<br>
  0   1   1   1  </p>
  
  <p><strong>4)</strong> 16x4 Binary array of all possible 4-bit signed hexadecimal values:<br>
  Same as #3</p>