  Decreasing the number of cables that bring heat into the cryostat is a
critical issue for all cryoelectronic devices. Especially, arrays of
superconducting nanowire single-photon detectors (SNSPDs) could require more
than $10^6$ readout lines. Performing signal processing operations at low
temperatures could be a solution. Nanocryotrons, superconducting nanowire
three-terminal devices, are good candidates for integrating sensing and
electronics on the same technological platform as SNSPDs in photon-counting
applications. In this work, we demonstrated that it is possible to read out,
process, encode, and store the output of SNSPDs using exclusively
superconducting nanowires. In particular, we present the design and development
of a nanocryotron ripple counter that detects input voltage spikes and converts
the number of pulses to an $N$-digit value. The counting base can be tuned from
2 to higher values, enabling higher maximum counts without enlarging the
circuit. As a proof-of-principle, we first experimentally demonstrated the
building block of the counter, an integer-$N$ frequency divider with $N$
ranging from 2 to 5. Then, we demonstrated photon-counting operations at 405 nm
and 1550 nm by coupling an SNSPD with a 2-digit nanocryotron counter partially
integrated on-chip. The 2-digit counter could operate in either base 2 or base
3 with a bit error rate lower than $2 \times 10^{-4}$ and a count rate of
$10^7\,$s$^{-1}$. We simulated circuit architectures for integrated readout of
the counter state, and we evaluated the capabilities of reading out an SNSPD
megapixel array that would collect up to $10^{12}$ counts per second. The
results of this work, combined with our recent publications on a nanocryotron
shift register and logic gates, pave the way for the development of
nanocryotron processors, from which multiple superconducting platforms may
benefit.
