Store four bits in a 2 × 2 crossbar without disturbing the neighbours, then see what a careless write does to them. You only ever need to click whatever is inside the red box, or type exactly what is in a black box.
Do Store a bit first: same moves (Netlist, Simulate, Edit Properties).
click hereClick any screenshot to see it full sizeKeys in the player: ←→SpaceEsc
About 10 minutes
Step by step
One bit isn't much. Put memristors where rows and columns of wire cross and you get a crossbar: 4 bits in a 2 × 2 grid, 16 in 4 × 4. You'll write the pattern 1 0 / 0 1 into four HfO₂ memristors, read it back, and then see how a careless write ruins it.
1
How you pick one cell
Each memristor sits between one column wire (its BE) and one row wire (its TE). It feels the column voltage minus the row voltage. To write one cell with 1.2 V, the testbench shares the voltage: +0.6 V on its column and −0.6 V on its row. All other wires stay at 0 V.
Writing cell 11
Column
Row
It feels
Switches?
cell 11 (the one we want)
+0.6 V
−0.6 V
1.2 V
yes
cell 12 (same row)
0 V
−0.6 V
0.6 V
no, below 0.8 V
cell 21 (same column)
+0.6 V
0 V
0.6 V
no, below 0.8 V
cell 22
0 V
0 V
0 V
no
The trickThe neighbours only get half the write voltage, and half is below the +0.8 V threshold. That is why a memristor with a clear threshold, like the HfO₂ one, is good for memories.
2
Pick the crossbar testbench
In the Library Manager, with openmemristorpdk_pr still selected, click memristor_hfo2_al_crossbar2x2_tb in the Cells list.
3
Open it in xschem
On the Schematic row, click Open in xschem.
4
The crossbar
Box 1 is the crossbar: two columns (be1, be2) going down, two rows (te1, te2) going across, and a memristor at each crossing, named after its row and column. Each wire has its own voltage source. Box 2 is how the write voltage is shared.
Time
What happens
0–100 ns
write a 1 into cell 11
100–200 ns
write a 1 into cell 22
200–600 ns
read cells 11, 12, 21 and 22, one every 100 ns, with 0.2 V on one column
colpart
The part of the 1.2 V that goes on the column. 0.5 means half: vcol = +0.6 V, vrow = −0.6 V.
i1, i2
The current flowing out of row 1 and row 2, in µA. A read measures the row of the cell being read.
5
Netlist, then Simulate
Click Netlist (1), then Simulate (2), and wait about 10 seconds.
6
The result
One plot window opens, plus the ngspice window.
7
The read current
The plot shows only the four reads, 100 ns each: cell 11, 12, 21 and 22.
How to read itHigh, low, low, high: 1 0 0 1. The pattern is stored.
8
The four reads
The ngspice window prints them as a little 2 × 2 table, in µA.
The patternRow 1 reads 1 0, row 2 reads 0 1, exactly what was written. Cells 12 and 21 felt 0.6 V twice and didn't change.
Why ground the other wires?During a read, the unused row and column sit at 0 V. If they were left unconnected, current could sneak through the other memristors (column → cell → other row → cell → …) and make a 0 look like a 1. Real chips fight these sneak paths by grounding wires like here, or by adding a transistor to every cell (1T1R).
9
Close the plot
Click Quit in the plot window.
10
Close the simulator
Click inside the white ngspice window, type quit and press Enter. Keep xschem open.
11
Edit the code block
Now the careless write. Double-click on the text of the code block.
12
The colpart line
The line to change is .param colpart = 0.5.
13
Go to the end of the line
Click on the colpart line, then press End.
14
Type 1
Press Backspace three times, type 1 (box 1), then click OK (box 2). Now the whole 1.2 V goes on the column and the row stays at 0 V.
15
Netlist, then Simulate
Click Netlist (1), then Simulate (2).
16
The new result
The same windows open again.
17
Every cell reads 1
Four high reads: 1 1 1 1. The two zeros are gone.
18
What went wrong
ngspice agrees: 400 µA everywhere.
Write disturbWriting cell 11 put 1.2 V on column 1. Cell 21 is on the same column, and its row was at 0 V, so it felt the full 1.2 V too and switched on.Writing cell 22 did the same to cell 12. A write that only looks at the cell you want can change its neighbours: sharing the voltage between column and row is what keeps them safe.
Try itcolpart = 0.75 puts 0.9 V on the column: just above the threshold, and the neighbours on the same column get written too. Every value between 0.34 and 0.66 keeps both neighbours below 0.8 V.
19
Close the plot and the simulator
As in steps 9–10: Quit in the plot window, then quit in the ngspice window.
20
Close xschem
Click the X at the top-right of the xschem window.
21
Don't save
Click OK to close without saving: the testbench keeps colpart = 0.5.