(a) Algorithm for carry calculation. First, the input carry is read and OFFSET is adjusted correspondingly. Next, the logic operation is conducted and high resistive states >R2 are mapped to R1 otherwise to R0. (b) Algorithm for sum calculation. The OFFSET evaluation and logic signal application is the same as for carry. The mapping is as follows: R3 → R0, R4 → R1 and R5 → R2. Start and stop of the algorithm are marked by light blue color, Read by blue color, and logic and RESET steps by yellow color.