#!/usr/bin/env python2
# I, Danny Milosavljevic, hereby place this file into the public domain.

# not a chip

BCD_values = [((value // 10) << 4) | (value % 10) for value in range(256)]

def to_BCD(value):
    assert(value >= 0 and value < 0x100)
    return(BCD_values[value])
    # 10 => $10
    #return ((value // 10) << 4) | (value % 10)
