def from_bin(bin_array):
width = len(bin_array)<EOL>bin_wgts = <NUM_LIT:2>**np.arange(width-<NUM_LIT:1>,-<NUM_LIT:1>,-<NUM_LIT:1>)<EOL>return int(np.dot(bin_array,bin_wgts))<EOL>
Convert binary array back a nonnegative integer. The array length is 
the bit width. The first input index holds the MSB and the last holds the LSB.