zoom/firmware/gen-dac-lookup.pl

14 lines
237 B
Perl
Raw Permalink Normal View History

#!/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";
}