A method for counting events, comprising: detecting a first event, the first event being a pulse type event and being an optical signal comprising one or more photons, wherein the first event is digital in nature; in response to detecting the first event, setting a state of a first switch, at a first time, storing the state of the first switch at the first time in a first cell of a first memory comprising a first M-bit shift register; resetting the state of the first switch, wherein, at a second time, moving the stored state of the first switch at the first time to a second cell of the first memory, and storing the state of the first switch at the second time in the first cell of the first memory, wherein the second time occurs after the first time and after resetting the state of the first switch, wherein the digital nature of the first event is preserved and neither a digital to analog nor an analog to digital conversion is involved, characterized by detecting a second event, the second event being a pulse type event and being an optical signal comprising one or more photons, wherein the second event is digital in nature, and wherein the second event is received after a first clock pulse and before a second clock pulse, and wherein the second event is received after the state of the first switch has been reset; in response to detecting the second event and prior to the second clock pulse, setting the state of the first switch; in response to the second clock pulse, clocking the first memory, wherein the state of the first switch at the first time is stored in the second cell of the first memory, and wherein the state of the first switch at the second time is stored in the first cell of the first memory. detecting a first event, the first event being a pulse type event and being an optical signal comprising one or more photons, wherein the first event is digital in nature; in response to detecting the first event, setting a state of a first switch, at a first time, storing the state of the first switch at the first time in a first cell of a first memory comprising a first M-bit shift register; resetting the state of the first switch, wherein, at a second time, moving the stored state of the first switch at the first time to a second cell of the first memory, and storing the state of the first switch at the second time in the first cell of the first memory, wherein the second time occurs after the first time and after resetting the state of the first switch, wherein the digital nature of the first event is preserved and neither a digital to analog nor an analog to digital conversion is involved, characterized by detecting a second event, the second event being a pulse type event and being an optical signal comprising one or more photons, wherein the second event is digital in nature, and wherein the second event is received after a first clock pulse and before a second clock pulse, and wherein the second event is received after the state of the first switch has been reset; in response to detecting the second event and prior to the second clock pulse, setting the state of the first switch; in response to the second clock pulse, clocking the first memory, wherein the state of the first switch at the first time is stored in the second cell of the first memory, and wherein the state of the first switch at the second time is stored in the first cell of the first memory.