thermocode to binary converter with bubble error correction (inputs are inverted, so 1111 is binary 00)