Digital circuit design with an introduction to CPLDs and FPGAs