  In this work, we study a new model of defect memory cells, called partially
stuck-at memory cells, which is motivated by the behavior of multi-level cells
in non-volatile memories such as flash memories and phase change memories. If a
cell can store the $q$ levels $0, 1, \dots, q-1$, we say that it is partially
stuck-at level $s$, where $1 \leq s \leq q-1$, if it can only store values
which are at least $s$. We follow the common setup where the encoder knows the
positions and levels of the partially stuck-at cells whereas the decoder does
not.
  Our main contribution in the paper is the study of codes for masking $u$
partially stuck-at cells. We first derive lower and upper bounds on the
redundancy of such codes. The upper bounds are based on two trivial
constructions. We then present three code constructions over an alphabet of
size $q$, by first considering the case where the cells are partially stuck-at
level $s=1$. The first construction works for $u<q$ and is asymptotically
optimal if $u+1$ divides $q$. The second construction uses the reduced row
Echelon form of matrices to generate codes for the case $u\geq q$, and the
third construction solves the case of arbitrary $u$ by using codes which mask
binary stuck-at cells. We then show how to generalize all constructions to
arbitrary stuck levels. Furthermore, we study the dual defect model in which
cells cannot reach higher levels, and show that codes for partially stuck-at
cells can be used to mask this type of defects as well. Lastly, we analyze the
capacity of the partially stuck-at memory channel and study how far our
constructions are from the capacity.
