{Masking faults in memories by using spares or by reconfiguring using programmable devices with improved layout using a flexible replacement scheme}