The present invention discloses an N-ary mask-programmable memory (N-MPM). N-MPM cells can have N cell-states, with N>2. N-MPM cells could be geometry-defined, junction-defined, or both. Based on an nF-opening process (n≧1), partial-contacts with feature size <1F can be implemented with an nF-opening mask with feature size ≧1F. N can be a non-integral power of 2. In this case, each memory cell represents fractional bits.