Flash memory top-level architecture