Modeling NAND Flash Memories for IC Design