1. An integrated circuit, comprising: a plurality of memory segments each comprising at least one memory cell that is configurable in at least first and second states to store data, wherein an erased memory segment includes no memory cells in the first state and a programmed memory segment includes at least one memory cell in the first state; and a controller configured to control programming and erasing of memory segments, wherein the controller is configured to identify programmed memory segments to be erased and to control selective erasure of the identified programmed memory segments.