Designing ad-hoc codes for the realization of fault tolerant CMOS networks