Architecture of FPGAs and CPLDs A Tutorial