Nanocryotron ripple counter integrated with a superconducting nanowire single-photon detector for megapixel arrays | Synapse