Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs