that there is software involved

It could be done entirely in hardware. A bunch of shift registers, some latches, some SRAM, a few other bits and bobs. It'd be pointless when a PIC is cheaper, but it could be done.
_________________________
-- roger