Manuscript Offprint
arXiv:2610.20109Cross-Layer Co-Design of Low-Latency Stateful Logic Adders with Printed Memristors
Fabian Seiler , Kerem Kagan Güclü , Hongrong Hu , Gabriel Cadilha Marques , Jasmin Aghassi-Hagmann , and Nima TaheriNejad
Heidelberg University, Karlsruhe Institute of Technology (KIT)
{firstname.lastname}@ziti.uni-heidelberg.de, {firstname.lastname}@kit.edu
These authors contributed equally
Abstract—Data movement between memory and processing units remains a major bottleneck in data-centric systems. Memristive Stateful Logic (SL) addresses this problem by performing Boolean operations directly on stored resistive states. However, arithmetic efficiency depends jointly on the device-supported logic primitive set, the dependency structure of the resulting operation sequence, and its mapping to datapath architectures. While prior designs typically optimize device, logic, and architecture layers separately, we jointly consider them to co-design a stateful adder. We experimentally demonstrate a mixed MAGIC and FELIX logic primitive set on printed Electrochemical Metallization (ECM) memristors and derive a full adder sequence optimized for inter-bit carry propagation. Mapping this sequence to bit-serial, bit-parallel, and bit-pipelined datapaths reduces the latter two to cycles for an n-bit addition. For 32-bit addition, this requires 60–88% fewer cycles than prior SL adders. Across four representative workloads, we achieve speedup over prior. These results show how cross-layer co-design can translate into improved workload-level performance.
I. INTRODUCTION
Modern data-centric workloads are increasingly constrained by the energy and latency costs of moving data between memory and processing units [1], [2]. In-Memory Computation (IMC) addresses this bottleneck by performing computation where data resides [3], [4]. Resistive Random Access Memory (RRAM) devices are particularly attractive for IMC, as their non-volatile resistive states provide both storage and computational functionality and enable parallel crossbar operations. While most memristive IMC systems target analog matrix-vector multiplication for neural-network acceleration [5], digital memristive IMC instead employs Stateful Logic (SL) primitives to manipulate stored states directly. This enables deterministic Boolean and arithmetic operations while retaining data inside memory [6]–[8]. Complex arithmetic in SL is decomposed into sequences of dependent Boolean operations. Logic families such as IMPLY [6], MAGIC [9], and FELIX [10] expose different logic primitives, and therefore different arithmetic decompositions. Combining primitives across families is only useful if they are compatible with the same physical device, making the supported primitive set a key constraint on the resulting dependency graph [11], [12]. Addition is particularly sensitive to this interaction because its latency is often dominated by inter-bit carry propagation [13], [14]. At the architectural level, SL datapaths range from bit-serial execution [15] to partitioned and pipelined organizations with different opportunities for parallelism [14], [16]. Consequently, adder efficiency depends not only on the number of operations, but also on how well its carry dependencies match the target datapath. Prior work typically either optimizes arithmetic sequences within a fixed logic family [17]–[22] or maps a fixed primitive set onto a target architecture [14], [16], [23]. This restricts both the available primitive set and the opportunity for datapath-aware sequence co-design. Here, we instead co-design the device-compatible primitive set, full adder sequence, and datapath mapping, and evaluate how these choices translate to workload-level performance.
The main contributions of this work are: i) experimental validation of a device-compatible mixed MAGIC and FELIX primitive set on printed Electrochemical Metallization (ECM) memristors, ii) a datapath-aware full adder algorithm with reduced inter-bit critical path, iii) mappings to bit-serial, bit-parallel, and bit-pipelined datapaths, reducing latency down to cycles for an n-bit addition, iv) a workload-level comparison showing speedup to comparable State-of-the-Art (SoA) adder.
A. Device Fabrication and Experimental Setup
Printed logic circuits based on ECM memristors were fabricated using laser ablation (Trumpf TruMicro 5000) for Au bottom electrode patterning and inkjet printing for the active layer deposition and the top electrode (Ag) deposition. Each memristor has an area of approximately .
The I–V curves of a representative device in Figure 1(c) show the typical bipolar resistive switching of the printed Ag/ZnO/Au ECM memristors. The switching voltage and resistance state statistics have been analyzed in detail in our previous work [24], where the ( V) is four times larger than the absolute value of ( V). This switching voltage asymmetry is crucial for the logic operations and is utilized as part of the cross-layer co-design [12].
MAGIC NOR, NOT, and FELIX XOR are crossbar compatible, which is demonstrated on one row of a crossbar as shown
This work was supported by the German Research Foundation (DFG) under Project 550835853 and Hector Stiftung.

Fig. 1: Experimental validation of the mixed stateful-logic primitive set on printed ECM memristors. (a) Schematic of one crossbar row with three Ag/ZnO/Au memristors. The boxes indicate the memristors used for XOR/NOR and NOT. (b) Top-view optical image of the printed crossbar row. (c) I–V curves of a representative device over 50 cycles. (d)–(f) Resistance of the input and output memristors for each input combination of (d) MAGIC NOR, (e) MAGIC NOT, and (f) FELIX XOR over 20 cycles.
TABLE I: Pulse amplitudes for the utilized SL operations.
| Operation | ||||||
|---|---|---|---|---|---|---|
| Amplitude (V) | 3.0 | -1.5 | 1.15 | 2.6 | -0.85 | 1.45 |
in Figure 1(a). The NOR and XOR circuits consist of three memristors (IN1, IN2, and OUT), whereas the NOT circuit consists of two memristors (IN1/IN2 and OUT). The pulse amplitudes for initialization and logic operations are listed in Table I, where each pulse has a width of , while the SET and XOR,1 pulses have a compliance current.
B. Validation of Stateful Logic Primitives
All operation voltages in Table I were determined experimentally by scanning the operation range, taking into account the boundary conditions proposed in [9] and [10]. Since the upper boundary of each operation is set by the input cases in which the output memristor must retain its initialized state, the operation voltages were kept as high as possible without erroneous switching in these cases: without erroneous SET of the output in input case 00, without erroneous RESET of the output in input cases 01/10, and and without input switching in input cases 00 and 0, respectively. Each input combination was tested for 20 repetitions, and resistance states before and after operation are shown in Figure 1(d)-(f). The logic threshold of was calculated as the geometric mean of (1933 ) and (174 ), and is used to map Low Resistance State (LRS) to logic 1 and High Resistance State (HRS) to logic 0.
In MAGIC NOR and NOT, the output memristor is initialized to LRS, and or is applied to the bit line (BL) of the each input memristor, while the BL of the output is grounded, so that the output is RESET to HRS as long as one input is in LRS. In FELIX XOR, the output is initialized to HRS and the operation is performed in two cycles while grounding the BL of each input memristor: is applied to the BL of the output memristor to SET it if at least one input is in LRS (OR), and subsequently RESETs the output only when both inputs are in LRS.
As shown in Figure 1(d)-(f), the NOR, NOT, and XOR circuits achieved overall success rates of , , and , respectively, where the failures mainly resulted from the output failing to RESET, particularly in input case 11 of XOR and input cases 01/10/11 of NOR. Input switching was observed in only of the tests for NOR and XOR, and not at all for NOT. In NOR and NOT, this input stability, which is difficult to achieve when implementing MAGIC NOR with Valence Change Mechanism (VCM) memristors [11], can be attributed to the asymmetric switching voltages of the printed ECM memristors. As NOT and NOR are based on RESET of the OUT, the operation voltages are not large enough to switch the ECM input memristors with a of 4.0.
Overall, the low input switching of MAGIC NOR (1.25%) and the error-free operation of MAGIC NOT constitute the main results of this experimental validation. Although the success rates of NOR and XOR are limited by device variability, the presented results are intended as a proof of concept that requires further device optimization. To the best of our knowledge, this is the first multi-cycle experimental demonstration of FELIX XOR and MAGIC NOR in the same memristor stack, which enables the cross-layer co-design of the carry-optimized full adder.
FELIX-XOR (OR, NAND) MAGIC-NOT MAGIC-NOR

Fig. 2: Proposed adder and datapath mappings. (a) Logic decomposition of a 1-bit full adder into stateful primitives. (b–d) Execution of four bit positions on serial, parallel, and pipelined datapaths. P denotes a computational region, while denotes the partition for bit i. The x-axis indicates execution cycles. (e–g) Corresponding hardware organizations and control periphery.
III. PROPOSED CROSS-LAYER MIXED-LOGIC ADDER
A. Carry-Optimized Full Adder Design
The physical demonstrated operations are abstracted here as single-cycle Micro-Operations ( OPs), hiding the underlying pulse conditions, device dynamics, and open reliability issues. The resulting set is . Their composition provides the functional set , with XOR implemented in two cycles by consecutive OR and NAND OPs using . A full adder can then be expressed as
The decomposition into sequentially arranged OPs is shown in Figure 2(a). The intermediate storage memristors are indicated by for bit i and memristor index j. Instead of simply optimizing cycle count, as in [10], [11], [17], [22], we deliberately focus on minimizing the inter-bit carry propagation. The corresponding sequence of stateful primitives is listed in Table II. Note that the updated state also depends on the initialization of the output memristor. Its structure is chosen such that Steps 1–4 depend only on and , while the inter-bit dependency is restricted to the two NOR operations in Steps 5–6. The final XOR in Steps 7–8 completes the sum after the incoming carry has been consumed. Consequently, the complete bit computation requires eight stateful OPs (and two cycles required for initialization), whereas the carry critical path has a depth of only two. The required complemented states are therefore generated before the carry arrives. This distinction between local pre-computation and carry-dependent computation is the basis for the considered datapath mappings.
B. Datapath-Aware Mapping
The proposed full adder sequence is mapped to bit-serial, bit-parallel, and bit-pipelined datapaths, as illustrated in Figure 2(b–d). These organizations expose different degrees of spatial and temporal parallelism and therefore exploit the shortened carry dependency differently. All reported latencies are in cycles to allow technology-agnostic comparison, and exclude the two pre-initialization cycles.
TABLE II: Stateful implementation of the proposed full adder.
| Step | Micro-Operation | Equivalent Logic |
|---|---|---|
| Init | RESET() | |
| Init | SET() | |
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 | ||
| 8 |
Bit-serial datapaths reuse a single computational region P across all bit positions, minimizing architectural overhead and commonly being used for SL arithmetic [10], [11], [17]–[19]. Since only one bit is processed at a time, this organization cannot exploit the shortened inter-bit dependency of the proposed algorithm. The complete eight-step sequence is therefore executed for bit i before continuing with bit , resulting in a latency of cycles for an n-bit addition.
Bit-parallel datapaths assign different bit positions i to separate partitions , allowing independent OPs to execute concurrently [16], [25]. For the proposed algorithm, execution is divided into two parts. First, steps 1–4 are broadcast and evaluated concurrently across all partitions, after which Steps 5–8 are staggered across consecutive bit positions. Since successive bits need to be displaced by only two cycles, the resulting latency is .
Bit-pipelined organizations similarly assign one bit position i to each partition and connect neighboring partitions through memristive buffers [14], [23]. Instead of independent partition schedules, a common instruction sequence is shifted by a delay between adjacent partitions, trading scheduling flexibility for regular pipelined execution. The carry-producing operation directly writes the inter-partition buffer, which is subsequently consumed by the following partition, avoiding dedicated buffer-transfer operations . This yields a latency of cycles.
RACER [14] uses a dedicated logic-0 column for NOR(0, x) buffer transfers, whereas our buffer is connected to the general column-selection network and can directly participate in regular operations.
TABLE III: Architectural trade-offs for datapath mappings.
| Bit-serial | Bit-parallel | Bit-pipelined | |
|---|---|---|---|
| Structure | Single array | partitions | partitions + buffers |
| Extra HW | - | switches | switches + memristors |
| Control (qual.) | Low | High | Medium |
indicates rows times partition interfaces .
TABLE IV: Comparison of proposed -bit adders with SoA.
| Design | SIMD | Compute Cycles | Num. Memristors | ||
|---|---|---|---|---|---|
| n-bit | n = 32 | n-bit | n = 32 | ||
| IMPLY Serial [17] | Yes | 18n - 1 | 575 | 2n + 4 | 68 |
| MAGIC Serial [18] | Yes | 12n + 1 | 385 | 14n + 1 | 449 |
| FELIX Serial [10] | Yes | 6n | 192 | 7n | 224 |
| NIMP-OR Serial [11] | Yes | 7n + 1 | 225 | 6n + 1 | 193 |
| IMPLY Parallel [26] | Yes | 5n + 15 | 175 | 4n + 1 | 129 |
| MAGIC Pipelined [14] | Yes | 11n | 352 | 10n | 320 |
| FELIX Pipelined [23] | Yes | 9n | 288 | 9n | 288 |
| IMPLY Semi-Serial [19] | No | 10n + 1 | 321 | 2n + 6 | 70 |
| IMPLY Semi-Parallel [20] | No | 17n - 1 | 543 | 2n + 3 | 67 |
| MAGIC Trans. I [21] | No | 10n + 2 | 322 | 16n - 1 | 511 |
| MAGIC Trans. II [22] | No | 7n + 4 | 228 | 16n | 512 |
| Proposed Serial | Yes | 8n | 256 | 8n + 1 | 257 |
| Proposed Parallel | Yes | 2n + 6 | 70 | 8n + 1 | 257 |
| Proposed Pipelined | Yes | 2n + 6 | 70 | 8n + 1 | 257 |
Pre-initialization steps are disregarded in this comparison.
Sequence reconstructed, since not directly reported by [14], [23].
C. Control and Hardware Trade-offs
The three datapaths use similar peripheral components, but differ in how computation is distributed and controlled [12], as shown in Figure 2(e–g). Bit-serial execution uses a single computational region and instruction stream, resulting in the lowest hardware and control overhead, but cannot exploit the parallelism of the proposed mapping. Bit-parallel execution adds partition switches for r rows and p partitions and allows partitions to be scheduled independently. This provides the highest execution flexibility, but also requires the most complex control [25]. Bit-pipelined execution instead adds 2X switches and X buffer memristors, while all partitions follow the same temporally shifted instruction stream [14]. It therefore trades additional communication hardware for more regular control and enables consecutive additions to overlap in the pipeline. These trade-offs are summarized in Table III.
IV. EVALUATION AND COMPARISON
A. Adder-Level Comparison
Table IV compares the proposed mappings with SoA stateful adders in terms of compute cycles and required memristors. Pre-initialization is excluded, and row-wise Single Instruction Multiple Data (SIMD) compatibility is reported since it determines whether independent additions can execute concurrently across crossbar rows. The proposed parallel and pipelined mappings require only cycles, or 70 cycles for n = 32, while retaining row-wise SIMD execution. This corresponds to approximately 60–88% fewer cycles than the considered SIMD-compatible baselines. The latency reduction comes at the cost of spatially replicating the bit-level computation, illustrating the trade-off established in Section III-B and Section III-C. Some transposed and semi-parallel designs achieve competitive cycle or device counts, but do not preserve the same row-wise SIMD execution model and are therefore less suitable for the following throughput-oriented comparison.

Fig. 3: Workload speedup comparison to [17]. Colors distinguish logic families. Hatching denotes datapath organization.
B. Workload-Level Throughput
To evaluate workload-level throughput, we use a custom cycle-accurate simulator in which workloads are represented as Directed Acyclic Graphs (DAGs), with scalar additions as nodes and data dependencies as edges. A common greedy scheduler packs ready additions across the available SIMD rows. A node becomes eligible once all of its predecessors have completed, while consecutive batches are issued according to the datapath-specific initiation interval. The resulting execution time therefore captures both single-add latency and sustained throughput under a common scheduling policy. Control and external data-transfer overheads are excluded for this comparison. Operands are assumed resident in the active tile, and intermediate results remain in memory. All mappings use a compute tile budget. Parallel and pipelined datapaths use 32 bit partitions, whereas the serial datapath uses a shared compute region. We evaluated four dependency structures that span throughput- to dependency-dominated execution: Vector Add with 4096 independent additions, GEMV64 accumulates 64 independent 64-term reductions, PrefixScan with a 1024-element stage-wise prefix scan, and Acc64 with 64 independent chains of 63 additions. Figure 3 reports speedup relative to the serial IMPLY mapping [17] for representative works from all three datapaths [10], [14], [17], [18], [23], [26]. The pipelined advantage is largest for Vector Add, where independent additions fully expose inter-add overlap, and decreases as dependencies constrain concurrency. For Acc64, each addition depends on the previous result, causing the proposed parallel and pipelined mappings to converge to the same latency. The proposed pipelined mapping achieves the highest speedup, improving over the proposed parallel mapping by approximately and over SoA mappings by . This shows that single-add latency alone does not determine workload performance. Sustained throughput also depends on the available dependency-level parallelism.
V. CONCLUSION
In this work, we presented a SL adder developed through cross-layer co-design. We experimentally demonstrated MAGIC and FELIX primitives using the same ECM device to derive a carry-optimized full adder sequence requiring only cycles for an n-bit addition on parallel and pipelined datapaths. This reduces latency by 60%–88% compared to SoA SL adders. For the evaluated workloads, our bit-pipelined approach exhibits a speedup of to the SoA baseline. These results highlight the importance of jointly considering device, logic, and datapath architecture layers when designing SL arithmetic.
REFERENCES
[1] O. Mutlu, S. Ghose, J. Gómez-Luna, R. Ausavarungnirun, M. Sadrosadati, and G. F. Oliveira, “A Modern Primer on Processing in Memory,” arXiv:2012.03112 [cs.AR], 2025. [Online]. Available: https://arxiv.org/abs/2012.03112
[2] A. Boroumand, S. Ghose, Y. Kim, R. Ausavarungnirun, E. Shiu, R. Thakur, D. Kim, A. Kuusela, A. Knies, P. Ranganathan, and O. Mutlu, "Google workloads for consumer devices: Mitigating data movement bottlenecks," in Proceedings of the Twenty-Third International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS '18. Association for Computing Machinery, 2018, p. 316–331.
[3] D. Ielmini and H.-S. P. Wong, “In-memory computing with resistive switching devices,” Nature Electronics, vol. 1, pp. 333 – 343, 2018.
[4] M. Lanza, S. Pazos, F. Aguirre, A. Sebastian, M. Le Gallo, S. M. Alam, S. Ikegawa, J. J. Yang, E. Vianello, M.-F. Chang et al., “The Growing Memristor Industry,” Nature, 2025.
[5] A. Sebastian, M. L. Gallo, R. Khaddam-Aljameh, and E. Eleftheriou, "Memory Devices and Applications for In-Memory Computing," Nature Nanotechnology, 2020.
[6] J. Borghetti, G. S. Snider, P. J. Kuekes, J. J. Yang, D. R. Stewart, and R. Stanley Williams, “‘Memristive’ Switches Enable ‘Stateful’ Logic Operations via Material Implication,” Nature, 2010.
[7] T. Neuner, H. Padberg, L. Kornblum, E. Yalon, P. K. Amiri, and S. Kvatinsky, “A comparative study of digital memristor-based processing-in-memory from a device and reliability perspective,” Advanced Electronic Materials, vol. 12, no. 1, p. e00348, 2026.
[8] N. Xu, T. Park, K. J. Yoon, and C. S. Hwang, “In-memory stateful logic computing using memristors: Gate, calculation, and application,” physica status solidi (RRL) – Rapid Research Letters, vol. 15, no. 9, p. 2100208, 2021.
[9] S. Kvatinsky, D. Belousov, S. Liman, G. Satat, N. Wald, E. G. Friedman, A. Kolodny, and U. C. Weiser, “MAGIC—Memristor-Aided Logic,” IEEE Transactions on Circuits and Systems II: Express Briefs, 2014.
[10] S. Gupta, M. Imani, and T. Rosing, “FELIX: Fast and Energy-Efficient Logic in Memory,” in ICCAD, 2018.
[11] B. Hoffer, V. Rana, S. Menzel, R. Waser, and S. Kvatinsky, “Experimental Demonstration of Memristor-Aided Logic (MAGIC) Using Valence Change Memory (VCM),” IEEE Transactions on Electron Devices, 2020.
[12] F. Seiler, H. Hu, R. Wong, K. K. Güclü, Y. Sun, S. Ghose, J. Aghassi-Hagmann, and N. TaheriNejad, “Cross-layer design approaches of stateful digital memristive in-memory computing,” in Proceedings of the IEEE 39th International System-on-Chip Conference (SOCC). IEEE, 2026, pp. 1–6.
[13] F. Seiler and N. TaheriNejad, “Accelerated Image Processing Through IMPLY-Based NoCarry Approximated Adders,” IEEE Transactions on Circuits and Systems I: Regular Papers, 2024.
[14] M. S. Q. Truong, E. Chen, D. Su, L. Shen, A. Glass, L. R. Carley, J. A. Bain, and S. Ghose, “RACER: Bit-Pipelined Processing Using Resistive Memory,” in MICRO, 2021.
[15] N. Talati, R. Ben-Hur, N. Wald, A. Haj-Ali, J. Reuben, and S. Kvatinsky, “mMPU—A Real Processing-in-Memory Architecture to Combat the von Neumann Bottleneck,” in Applications of Emerging Memory Technology: Beyond Storage. Springer Singapore, 2020.
[16] O. Leitersdorf, D. Leitersdorf, J. Gal, M. Dahan, R. Ronen, and S. Kvatinsky, “AritPIM: High-Throughput In-Memory Arithmetic,” IEEE Transactions on Emerging Topics in Computing, 2023.
[17] F. Seiler, Gulafshan, and N. TaheriNejad, “An efficient robust serial imply-based in-memristor adder,” in 2025 Cross-Disciplinary Conference on Memory-Centric Computing (CCMCC), 2025, pp. 1–7.
[18] R. Ben-Hur, R. Ronen, A. Haj-Ali, D. Bhattacharjee, A. Eliahu, N. Peled, and S. Kvatinsky, “SIMPLER MAGIC: Synthesis and Mapping of In-Memory Logic Executed in a Single Row to Improve Throughput,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2020.
[19] N. TaheriNejad, T. Delaroche, D. Radakovits, and S. Mirabbasi, “A semi-serial topology for compact and fast imply-based memristive full adders,” in 2019 17th IEEE International New Circuits and Systems Conference (NEWCAS), 2019, pp. 1–4.
[20] S. Ganjeheizadeh Rohani, N. Taherinejad, and D. Radakovits, “A semi-parallel full-adder in imply logic,” IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol. 28, no. 1, pp. 297–301, 2020.
[21] N. Talati, S. Gupta, P. Mane, and S. Kvatinsky, “Logic design within memristive memories using memristor-aided logic (MAGIC),” IEEE Transactions on Nanotechnology, vol. 15, no. 4, pp. 635–650, 2016.
[22] N. Kaushik, F. Seiler, N. Amirafshar, N. TaheriNejad, and B. Srinivasu, "High-speed magic-based exact and approximate adders for in-memory computing," IEEE Journal on Emerging and Selected Topics in Circuits and Systems, pp. 1–1, 2026.
[23] M. S. Q. Truong, L. Shen, A. Glass, A. Hoffmann, L. R. Carley, J. A. Bain, and S. Ghose, “Adapting the RACER Architecture to Integrate Improved In-ReRAM Logic Primitives,” IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 2022.
[24] G. Gulafshan, H. Hu, D. Raber-Radakovits, L. Vassallo, G. C. Marques, J. Aghassi-Hagmann, and N. Taherinejad, “Realistic Behavioral Model for ReRAMs Capturing Non-Idealities,” Communications Materials, 2025.
[25] O. Leitersdorf, R. Ronen, and S. Kvatinsky, “Partitionpim: Practical memristive partitions for fast processing-in-memory,” 2022. [Online]. Available: https://arxiv.org/abs/2206.04200
[26] A. Karimi and A. Rezai, “Novel design for a memristor-based full adder using a new imply logic approach,” Journal of Computational Electronics, vol. 17, 2018.