move prescaler calculation here and add unit test add ability to find closest matching frequency in prescaler calculation account for bit widths in prescaler tests