  Digital processing-in-memory (PIM) architectures are rapidly emerging to
overcome the memory-wall bottleneck by integrating logic within memory
elements. Such architectures provide vast computational power within the memory
itself in the form of parallel bitwise logic operations. We develop novel
algorithmic techniques for PIM that, combined with new perspectives on computer
arithmetic, extend this bitwise parallelism to the four fundamental arithmetic
operations (addition, subtraction, multiplication, and division), for both
fixed-point and floating-point numbers, and using both bit-serial and
bit-parallel approaches. We propose a state-of-the-art suite of arithmetic
algorithms, demonstrating the first algorithm in the literature of digital PIM
for a majority of cases - including cases previously considered impossible for
digital PIM, such as floating-point addition. Through a case study on
memristive PIM, we compare the proposed algorithms to an NVIDIA RTX 3070 GPU
and demonstrate significant throughput and energy improvements.
