Fast CMOS nonbinary divider and counter