Behavioral Modeling of Flash Memories