#!/usr/bin/perl -w use strict; for my $zahl ( 0 .. 65535 ) { my $binary16 = sprintf( "%016b", $zahl ); if ($binary16 =~ tr/1/1/ == 6) { if ($binary16 =~ m/[1]{4}/) { next; } elsif ($binary16 =~ m/[1]{3}/) { printf "%s => %s\n", $zahl, $binary16; } } }