A method of handling a stuck bit in a directory of a cache memory, by
defining multiple binary encodings to indicate a defective cache state,
detecting an error in a tag stored in a member of the directory (wherein
the tag at least includes an address field, a state field and an
error-correction field), determining that the error is associated with a
stuck bit of the directory member, and writing new state information to
the directory member which is selected from one of the binary encodings
based on a field location of the stuck bit within the directory member.
The multiple binary encodings may include a first binary encoding when
the stuck bit is in the address field, a second binary encoding when the
stuck bit is in the state field, and a third binary encoding when the
stuck bit is in the error-correction field. The new state information may
also further be selected based on the value of the stuck bit, e.g., a
state bit corresponding to the stuck bit is assigned a bit value from the
new state information which matches the value of the stuck bit.