Week 8 Challenges - zanzibarcircuit/ECE510 GitHub Wiki

Note

Unfortunately, the admin of the BrainScaleS-2 is on leave until early June according to the email requesting a collaboration, so in the spirit of finishing a challenge every week, I decided to do the crossbar project I wanted to do but missed a while ago. This will be Challenge 20.

Challenge 20

In implementing the crossbar below, I decided to use ngspice in Colab. image

MATLAB

First we need to define exactly what operation we're trying to do. Since we have a 4×4 array, we'll be doing a vector × matrix operation with the vectors defined as the voltages v = [v1 v2 v3 v4] and the conductance defined as the following:

[g11 g12 g13 g14]
[g21 g22 g23 g24]
[g31 g32 g33 g34]
[g41 g42 g43 g44]

For the sake of ease, we'll define the following in MATLAB to check the results:

v = [1 1 1 1];
g = [
    1,   1/5,  1/9,  1/13;
    1/2, 1/6,  1/10, 1/14;
    1/3, 1/7,  1/11, 1/15;
    1/4, 1/8,  1/12, 1/16
];
i = v*g;

This gives us [1.388034188034188, 0.838095238095238, 0.633766233766234, 0.520833333333333].

NGSPICE

We'll define the following in ngspice. Note that the conductance is defined in terms of the resistance, so each element is its inverse. This results in the following netlist:

V1 row1 0 DC 1
V2 row2 0 DC 1
V3 row3 0 DC 1
V4 row4 0 DC 1
* bit-line measurement elements: zero-volt sources to ground
Vb1 col1 0 DC 0
Vb2 col2 0 DC 0
Vb3 col3 0 DC 0
Vb4 col4 0 DC 0
* memristors as resistors: R = 1/G
R11 row1 col1 1
R12 row1 col2 2
R13 row1 col3 3
R14 row1 col4 4
R21 row2 col1 5
R22 row2 col2 6
R23 row2 col3 7
R24 row2 col4 8
R31 row3 col1 9
R32 row3 col2 10
R33 row3 col3 11
R34 row3 col4 12
R41 row4 col1 13
R42 row4 col2 14
R43 row4 col3 15
R44 row4 col4 16
* print the DC currents through each VbX
.print DC I(Vb1) I(Vb2) I(Vb3) I(Vb4)
* run operating-point analysis
.op
.end

Results

The current at each output resistor gives us the following, which perfectly aligns. I don't totally understand why we don't see the sneak paths here, but that's a problem for another day. Refer to the Colab notebook W8_Challenge.ipynb for the implementation.

vb1#branch                       1.388034e+00
vb2#branch                       8.380952e-01
vb3#branch                       6.337662e-01
vb4#branch                       5.208333e-01