How Do Memristor Crossbars Compute Matrix-Vector Products?
Memristor crossbars perform analog matrix-vector multiplication in a single step by exploiting fundamental electrical laws rather than executing sequential digital instructions. By arranging programmable resistive devices at the intersections of a grid, these arrays encode matrix elements as electrical conductance and input vectors as voltages. When voltages are applied to the rows, Ohm's law governs the current flowing through each device, and Kirchhoff's current law naturally sums those currents along each column to produce the final output vector.
Architecture of a Memristor Crossbar Array
A memristor crossbar consists of two sets of parallel conductive wires arranged perpendicularly in a two-dimensional grid. The horizontal wires are typically called wordlines or rows, while the vertical wires are called bitlines or columns. At every intersection where a row crosses a column, a memristor—a two-terminal passive circuit element whose resistance can be programmed and retained—connects the two lines.
In classical digital computing, matrix-vector multiplication requires fetching weights and inputs from memory, multiplying them in an arithmetic logic unit, and accumulating the results over many clock cycles. A memristor crossbar eliminates this data movement bottleneck by performing computation directly inside the memory array itself, an approach known as compute-in-memory.
Encoding Matrices and Vectors Physically
To compute the product \(y = W x\), where \(W\) is an \(M \times N\) matrix and \(x\) is an \(N\)-element input vector, the mathematical values must be mapped to physical electrical quantities:
- Matrix weights as conductance: Each element \(W_{ij}\) of the matrix is programmed as the electrical conductance \(G_{ij} = 1 / R_{ij}\) of the memristor located at row \(i\) and column \(j\). Programming is achieved by applying controlled voltage pulses that alter the internal physical state of the memristor, such as the distribution of oxygen vacancies in a metal-oxide film.
- Input vector as voltage: Each element \(x_i\) of the input vector is converted into an analog voltage \(V_i\) and applied simultaneously to row \(i\) of the crossbar.
Because conductance is strictly non-negative, representing signed matrix weights (positive and negative values) typically requires a differential pair of crossbars or two memristors per weight, where the effective weight is proportional to the difference in conductance, \(G_{ij}^+ - G_{ij}^-\).
Multiplication via Ohm's Law
Once the input voltages are applied to the rows and the columns are held at a virtual ground (\(0\text{ V}\)), a voltage drop \(V_i\) appears across every memristor in row \(i\). According to Ohm's law, the current \(I_{ij}\) flowing through the memristor at row \(i\) and column \(j\) is directly proportional to the applied voltage and the device's conductance:
\[I_{ij} = G_{ij} V_i\]
This physical relationship performs the scalar multiplication between the input element and the matrix weight instantaneously and in parallel across all \(M \times N\) intersections in the array.
Summation via Kirchhoff's Current Law
Each column wire collects the currents from all memristors connected along that column. According to Kirchhoff's current law, the total current \(I_j\) exiting column \(j\) is the algebraic sum of all individual currents entering that node:
\[I_j = \sum_{i=1}^{N} I_{ij} = \sum_{i=1}^{N} G_{ij} V_i\]
This equation is mathematically identical to the dot product of the input vector \(V\) and the \(j\)-th column of the conductance matrix \(G\). Because all columns operate simultaneously, the entire matrix-vector multiplication completes in the time it takes for the electrical signals to settle, giving an effective \(O(1)\) time complexity independent of the matrix dimensions.
Peripheral Circuitry and Practical Challenges
While the core multiplication and addition occur in the analog domain, memristor crossbars rely on peripheral circuits to interface with digital systems:
- Digital-to-Analog Converters (DACs) translate digital input vectors into the analog row voltages \(V_i\).
- Transimpedance Amplifiers (TIAs) hold the columns at virtual ground and convert the summed column currents \(I_j\) into proportional voltages.
- Analog-to-Digital Converters (ADCs) digitize the resulting column voltages back into binary values for downstream processing.
In practice, achieving high computational accuracy requires managing non-idealities. Parasitic wire resistance causes voltage drops along long rows and columns, known as the IR drop, which distorts the applied voltages. Additionally, sneak-path currents, device-to-device variability, and conductance drift can introduce noise, often necessitating selector devices (such as a 1-transistor-1-memristor, or 1T1R, cell structure) and calibration algorithms to maintain precision.