zoom/firmware/gen-dac-lookup.pl
jim 5cb6542c7e add lookup table for DAC mapping
git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8026 ddd99763-3ecb-0310-9145-efcb8ce7c51f
2009-11-03 22:31:47 +00:00

14 lines
237 B
Perl
Executable File

#!/usr/bin/perl
srand(1337);
# constant bits, the rest are filled with random data
$bits = $ARGV[0] || 10;
$rem = 16 - $bits;
for ($i = 0; $i < 2**$bits; $i++)
{
$out = $i * 2**$rem + int(rand(2**$rem));
print $out . ",\n";
}