Compensating Circuit to Reduce the Impact of Wire Resistance in a Memristor Crossbar-Based Perceptron Neural Network

Wire resistance in metal wire is one of the factors that degrade the performance of memristor crossbar circuits. In this paper, an analysis of the impact of wire resistance in a memristor crossbar is performed and a compensating circuit is proposed to reduce the impact of wire resistance in a memristor crossbar-based perceptron neural network. The goal of the analysis is to figure out how wire resistance influences the output voltage of a memristor crossbar. It emerges that the wire resistance on horizontal lines causes the neuron’s output voltage to vary more than the wire resistance on vertical lines. More interesting, the voltage variation caused by wire resistance on horizontal lines increases proportionally to the length of metal wire. The first column has small voltage variation whereas the last column has large voltage variation. In addition, two adjacent columns have almost the same amount of voltage variation. Under these observations, a memristor crossbar-based perceptron neural network with compensating circuit is proposed. The neuron’s outputs of two columns are put into a subtractor circuit to eliminate the voltage variation caused by the wire resistance. The proposed memristor crossbar-based perceptron neural network is trained to recognize the 26 characters. The proposed memristor crossbar shows better recognition rate compared to the previous work when wire resistance is taken into account. The proposed memristor crossbar circuit can maintain the recognition rate as high as 100% when wire resistance is as high as 2.5 Ω. By contrast, the recognition rate of the memristor crossbar without the compensating circuit decreases by 1%, 5%, and 19% when wire resistance is set to be 1.5, 2.0, and 2.5 Ω, respectively.


Introduction
Neuromorphic computing, inspired from biological perception, was introduced by C. Mead in the late 1980s [1]. It has been expected to become an alternative architecture to overcome the bottleneck of von Neumann computer architectures [1,2]. Neuromorphic computing refers to a hardware implementation of a brain-inspired system, which has the capabilities of parallel processing like a human brain. For realizing neuromorphic computing systems, various research activities, based on CPUs (Central Processing Units), GPUs (Graphics Processing Units), FPGAs (Field-Programmable Gate Arrays), analog circuits, memory circuits, etc., have been proposed in the past two decades [3][4][5][6][7][8]. These architectures are based on CMOS (Complementary-Metal-Oxide-Semiconductor) technology, which is approaching the end of their capabilities because scaling CMOS down faces several fundamental limiting factors stemming from electron thermal energy and quantum-mechanical tunneling [9,10]. The memristor crossbar array has been one of the promising candidates for realizing neuromorphic computing systems because crossbar architecture can be made with high density and low cost [11]. Memristor was postulated by Leon O. Chua in 1971 as the fourth basic circuit element and experimentally demonstrated by HP Lab in 2008 [12,13]. A memristor is a resistor with modifiable resistance, which makes it ideal for mimicking the synaptic plasticity of biological neurons [14]. The early memristor-based synaptic circuits are composed of memristors and CMOS transistors [15][16][17]. However, pure memristor crossbar arrays without CMOS devices seem to be more efficient in terms of their integration and power consumption [18][19][20][21][22][23]. Miao Hu et al. proposed a crossbar synaptic array that is composed of a plus and minus crossbar array representing plus-and minus-polarity connection matrices for analog neuromorphic computing [20]. Such a pure memristor crossbar array is very effective in realizing the bio-inspired systems in term of power consumption and area occupation. To reduce area and power consumption, S. N. Truong proposed a new memristor crossbar array architecture which is composed of a single memristor array and a constant-term circuit [21].
In a memristor array, some amount of voltage drop can be caused by interconnect resistance, also known as wire resistance along the row and the column lines [19,[24][25][26][27]. Wire resistance degrades the performance of the circuit more seriously when the array size increases [25]. To mitigate the impact of wire resistance, several interesting schemes were proposed [24][25][26][27]. These schemes are effective when they are applied to a memristor crossbar array, in which memristors are used as binary switches between two distinct high and low resistance states (HRS and LRS, respectively). However, the impact of wire resistance in an analog memristor crossbar array for realizing the synaptic weight matrix was not fully considered. In this work, we propose a memristor crossbar array with a compensating circuit for implementing the analog synaptic array of a perceptron neural network. The impact of wire resistance is mitigated by compensating the voltage variation of two adjacent columns.
In this work, the output voltages of columns are figured out with taking the existing of wire resistance into account. The mathematical analysis and the simulation result show that the output voltage of columns increase, which is caused by the amount of voltage lost from wire resistance. The column close to the first one has a small variation of voltage, compared to the one far from the first column. From these observations, we propose a compensating circuit to mitigate the voltage variation caused by the wire resistance in a memristor crossbar array. Figure 1 shows an interesting memristor array circuit for implementing the synaptic weight matrix of a perceptron neural network [21]. A single memristor array and a constant-term circuit are used for realizing the negative and positive synaptic weights, instead of using two complementary crossbar arrays [20,21].

Materials and Methods
In Figure 1, g j,k is the memristor's conductance at the crossing point between the jth row and the kth column. V IN,j is the input voltage applied to the jth row. V C,k is the column-line voltage on the kth column. The column line, V C,F , is added in Figure 1 instead of using another memristor array [21]. The column line, V C,F , is connected to the inputs, from V IN,1 to V IN,m . In Figure 1, V C,F enters G F that constitutes an inverting OP amp with the negative feedback resistor, R F1 . The output voltage of G F is V F that is connected to all the column lines from V C,1 to V C,n via R F2 , as shown in Figure 1. By applying Kirchhoff current law to the column line, V C,F , we can calculate V F and V O,k with Equations (1) and (2).
is defined as a synaptic weight of the jth row and kth column, w j,k , we can rewrite Equation (3) with Equation (4).
where w j,k = R 0 Micromachines 2019, 10, 671 3 of 11 If − R ⋅ g , − is defined as a synaptic weight of the jth row and kth column, wj,k, we can rewrite Equation (3) with Equation (4).
where w , = R − g , = R − , . Figure 1. The memristor-based crossbar architecture with a single memristor array and a constantterm circuit for realizing the synaptic matrix of a perceptron neural network [21].
Equation (4) is used for calculating the output voltage of the kth column. The output of each column is a summation of the weighted inputs, hence each column works as a perceptron neuron. In Equation (4), Mj,k is the memristance value of the crossing point between the jth row and kth column. RB is a constant. The synaptic weight, wj,k, can be decided to be either negative or positive by adjusting the memristance, Mj,k. The output of the perceptron neuron is decided by a threshold function which produces 0 or 1. By adding the comparator to the output voltage, VO,k, we can decide if the neuron's output of the kth column, OUTk, should be activated or not.
In previous work, the impact of wire resistance is ignored. However, in the crossbar array, the voltage drop along column and row lines cannot be omitted [19,[24][25][26][27]. It becomes more serious when the array size increases [24]. The wire resistance between two adjacent junctions is modeled by a small-value resistor, r, as shown in Figure 2. The memristor-based crossbar architecture with a single memristor array and a constant-term circuit for realizing the synaptic matrix of a perceptron neural network [21]. Equation (4) is used for calculating the output voltage of the kth column. The output of each column is a summation of the weighted inputs, hence each column works as a perceptron neuron. In Equation (4), M j,k is the memristance value of the crossing point between the jth row and kth column. R B is a constant. The synaptic weight, w j,k , can be decided to be either negative or positive by adjusting the memristance, M j,k . The output of the perceptron neuron is decided by a threshold function which produces 0 or 1. By adding the comparator to the output voltage, V O,k , we can decide if the neuron's output of the kth column, OUT k , should be activated or not.
In previous work, the impact of wire resistance is ignored. However, in the crossbar array, the voltage drop along column and row lines cannot be omitted [19,[24][25][26][27]. It becomes more serious when the array size increases [24]. The wire resistance between two adjacent junctions is modeled by a small-value resistor, r, as shown in Figure 2. For the sake of simplicity, in this section we analyze the circuit separately with respect to the wire resistance on horizontal lines and the wire resistance on vertical lines, as shown in Figure 2a,b, respectively. We define Vb1, Vb2 as the voltages of node b1, b2, which are on the first column. Generally, Vbj is the voltage of node bj on the first column. Similarly, Vkj is the voltage of node kj, which is on the jth column. Applying Kirchhoff current law for all nodes in Figure 2a, VF and VO,k can be estimated as follows: If we assume that RF1 = RF2, Equation (7) can be simplified as follow: By comparing Equation (8) and Equation (4), we can derive the variation of voltage, ∆V, which is caused by wire resistance on the vertical lines.
Here Mj,k is the memristance of the crossing point between the jth row and the kth column. Vbj and Vkj are the voltage at nodes bj and kj of the first column and the kth column, respectively, as shown in Figure 2a. Mj,k is calculated using Equation (4). It is possible to infer that the variation of voltage presented in Equation (9) can be very small because there are a negative term and a positive term in the right side of Equation (9). For the sake of simplicity, in this section we analyze the circuit separately with respect to the wire resistance on horizontal lines and the wire resistance on vertical lines, as shown in Figure 2a,b, respectively. We define V b1 , V b2 as the voltages of node b 1 , b 2 , which are on the first column. Generally, V bj is the voltage of node b j on the first column. Similarly, V kj is the voltage of node k j , which is on the jth column. Applying Kirchhoff current law for all nodes in Figure 2a, V F and V O,k can be estimated as follows: If we assume that R F1 = R F2 , Equation (7) can be simplified as follow: By comparing Equation (8) and Equation (4), we can derive the variation of voltage, ∆V, which is caused by wire resistance on the vertical lines.
Here M j,k is the memristance of the crossing point between the jth row and the kth column. V bj and V kj are the voltage at nodes b j and k j of the first column and the kth column, respectively, as shown in Figure 2a. M j,k is calculated using Equation (4). It is possible to infer that the variation of voltage presented in Equation (9) can be very small because there are a negative term and a positive term in the right side of Equation (9).
In Figure 2b, wire resistance on vertical lines is omitted whereas wire resistance on horizontal lines is taken into account. The voltages applied to the columns decrease because they are lost from wire resistance. If we define V j(k) as the amount of voltage drop on wire resistance, which is on the jth row and between the (k − 1)th and kth column, the voltage applied to the jth row of the kth column is calculated as Equation (10).
Here V IN,j(k) is the voltage applied to the jth row of the kth column. The column-line voltage on the kth column, V O,k , can be calculated using Equation (11).
By comparing Equation (11) and Equation (3), we obtain the variation of voltage, ∆V k , of the kth column as follows.
Calculating V IN,j(k) by using Equation (10), we obtain ∆V k as presented in Equation (13).
Here k i=1 V j(i) is the sum of the voltage on k resistors on the jth row. Equation (13) indicates that the output voltage of the kth column increases because of wire resistance. It is possible to infer that the column close to the first column has small voltage variation and the column far from the first column has large voltage variation. In Equation (13), the voltage variation increases proportionally to the column's index, k. Hence, it is interesting that two adjacent columns can have almost the same amount of voltage variation. Due to this reason, we propose a memristor crossbar array with compensating circuit to mitigate the voltage variation caused by wire resistance. By putting two adjacent columns into a subtraction circuit, the voltage variation can be eliminated significantly. The proposed memristor crossbar is schematically shown in Figure 3.
In Figure 3, the memristor crossbar is composed of 27 columns for recognizing 26 character images. The first column is a constant-term circuit to generate a negative voltage, as mentioned in the previous section. The remaining 26 columns represent 26 perception neurons trained to recognize the 26 characters. The differential amplifies from G s,2 to G s,26 are inserted into the circuit. The gain of these amplifiers is 1, so they work as the subtractors. The output voltages from V O,1 to V O,n are the neuron's output of columns from Col 1 to Col n . V O,1 enter the comparator C 1 to decide if the neuron's output of column Col 1 should be activated or not. V O,2 and V O,1 go into G s,2 that produces V Os,2 . V Os,2 enters the comparator C 2 to decide if the neuron's output of column Col 2 should be activated or not. In general, the output voltage of the column Col k−1 and the column Col k enter the subtractor G s,k for generating the neuron's output, V Os,k , of the column Col k . Using superposition theorem, V Os,k can be calculated with the difference of V O,k − 1 and V O,k .
If we assume that R 3 = R 4 = R 5 = R 6 , we can obtain: The differential amplifier is able to reject any signal common to both inputs. That means, if two adjacent columns have almost the same amount of voltage variation, the voltage variation is then mitigated at the output.
Micromachines 2019, 10, 671 6 of 11 Figure 3. The proposed memristor crossbar with compensating circuit for implementing a perceptron neural network. The outputs of two adjacent columns are put into a differential amplifier working as a subtractor to eliminate the output voltage variation.
The concept of the proposed circuit is shown in Figure 4. The crossbar is trained to recognize the 26 characters from "A" to "Z". The 25 th column is for recognizing the character "Y". The output of the 25th column is close to 1V when the input is "Y" and close to 0 when the other characters are applied to the input. Similarly, the neuron's output of the 26th column should be activated if the input is "Z", as indicated in Figure 4a. In Figure 4b, it is assumed that the wire resistance is present in the crossbar. The output voltage increases as reasoned in the previous section. The two last neurons recognize the input characters incorrectly, as demonstrated in Figure 4b. However, if we put the outputs of two last columns into a subtractor, the voltage variation can be mitigated significantly, as illustrated in Figure 4b. By doing this, we can maintain the recognition rate when wire resistance is present in the crossbar circuit.  Figure 3. The proposed memristor crossbar with compensating circuit for implementing a perceptron neural network. The outputs of two adjacent columns are put into a differential amplifier working as a subtractor to eliminate the output voltage variation.
The concept of the proposed circuit is shown in Figure 4. The crossbar is trained to recognize the 26 characters from "A" to "Z". The 25th column is for recognizing the character "Y". The output of the 25th column is close to 1V when the input is "Y" and close to 0 when the other characters are applied to the input. Similarly, the neuron's output of the 26th column should be activated if the input is "Z", as indicated in Figure 4a. In Figure 4b, it is assumed that the wire resistance is present in the crossbar. The output voltage increases as reasoned in the previous section. The two last neurons recognize the input characters incorrectly, as demonstrated in Figure 4b. However, if we put the outputs of two last columns into a subtractor, the voltage variation can be mitigated significantly, as illustrated in Figure 4b. By doing this, we can maintain the recognition rate when wire resistance is present in the crossbar circuit.

Results
The proposed memristor crossbar circuit in Figure 3 is verified for the application of character recognition. Figure 5a shows eight × eight images of characters used in this simulation. Each character is composed of 64 black-and-white pixels. The proposed memristor crossbar is composed of 64 rows and 27 columns. The first column connects with all inputs through RB to generate the negative voltage as mentioned in the previous section. The remaining 26 columns are for recognition of 26 characters from "A" to "Z". The 64 input voltages obtained from 64 pixels are applied to the inputs of 64 rows.
The red line in Figure 5b shows a hysteresis behavior of a real memristor based on the film structure of Pt/LaAlO3/Nb-doped SrTiO3 stacked layer [28]. The black line in Figure 5b represents the behavior model of the memristor used in this paper. This model can well describe various memristive behaviors that come from different kinds of memristors [29]. The circuit simulation is performed using the SPECTRE circuit simulation provided by Cadence Design Systems Inc. Memristors are modeled using Verilog-A and the CMOS technology is given by SAMSUNG 0.13 mm process technology [29,30]. The Verilog-A model parameters are presented in [28]. The wire resistance between two adjacent junctions is set to be 2.5 Ω for a 4F 2 cross-point structure [19,31]. Figure 6a shows the neuron's output of the 25th column, which is trained to be activated when character "Y" is applied to the input. Ideally, VO,25 is close to 1V for character "Y", and close to 0V for others. However, the output voltage of the 25th column, VO,25, is shifted up because of wire resistance, as reasoned in the previous section. Similarly, in Figure 6b, the neuron's output of the 26 th column is shifted up as a result of the voltage drop along wire resistance. It can be realized that if we compare the column's output voltage, VO,26, with the reference voltage, VREF, the neuron's output of the 26th column can be activated for several input characters, which consequently degrades the recognition rate. The output voltage of the 25th column and the 26th column are put into a subtractor circuit to produce the neuron's output voltage of the 26th column, VOs,26. By doing this, the voltage variation is mitigated significantly, as demonstrated in Figure 6c. When the character "Y" is applied to the inputs, VOs,26 is negative, because VO,25 is higher than VO,26. For the character "Z", VOs,26 is high, as indicated in Figure 6c. The simulation result shown in Figure 6c indicates that the neuron's output of the 26th column is only activated for the input character "Z", because the variation of voltage caused by wire resistance is mitigated remarkably by the subtractor circuit.

Results
The proposed memristor crossbar circuit in Figure 3 is verified for the application of character recognition. Figure 5a shows eight × eight images of characters used in this simulation. Each character is composed of 64 black-and-white pixels. The proposed memristor crossbar is composed of 64 rows and 27 columns. The first column connects with all inputs through R B to generate the negative voltage as mentioned in the previous section. The remaining 26 columns are for recognition of 26 characters from "A" to "Z". The 64 input voltages obtained from 64 pixels are applied to the inputs of 64 rows.
The red line in Figure 5b shows a hysteresis behavior of a real memristor based on the film structure of Pt/LaAlO 3 /Nb-doped SrTiO 3 stacked layer [28]. The black line in Figure 5b represents the behavior model of the memristor used in this paper. This model can well describe various memristive behaviors that come from different kinds of memristors [29]. The circuit simulation is performed using the SPECTRE circuit simulation provided by Cadence Design Systems Inc. Memristors are modeled using Verilog-A and the CMOS technology is given by SAMSUNG 0.13 mm process technology [29,30]. The Verilog-A model parameters are presented in [28]. The wire resistance between two adjacent junctions is set to be 2.5 Ω for a 4F 2 cross-point structure [19,31]. Figure 6a shows the neuron's output of the 25th column, which is trained to be activated when character "Y" is applied to the input. Ideally, V O,25 is close to 1V for character "Y", and close to 0V for others. However, the output voltage of the 25th column, V O,25 , is shifted up because of wire resistance, as reasoned in the previous section. Similarly, in Figure 6b, the neuron's output of the 26th column is shifted up as a result of the voltage drop along wire resistance. It can be realized that if we compare the column's output voltage, V O,26 , with the reference voltage, V REF , the neuron's output of the 26th column can be activated for several input characters, which consequently degrades the recognition rate. The output voltage of the 25th column and the 26th column are put into a subtractor circuit to produce the neuron's output voltage of the 26th column, V Os, 26 . By doing this, the voltage variation is mitigated significantly, as demonstrated in Figure 6c. When the character "Y" is applied to the inputs, V Os,26 is negative, because V O,25 is higher than V O,26 . For the character "Z", V Os,26 is high, as indicated in Figure 6c. The simulation result shown in Figure 6c indicates that the neuron's output of the 26th column is only activated for the input character "Z", because the variation of voltage caused by wire resistance is mitigated remarkably by the subtractor circuit. The memristor's current-voltage characteristic measured from the real device and the memristor's behavior model [28,29].  The memristor's current-voltage characteristic measured from the real device and the memristor's behavior model [28,29]. The memristor's current-voltage characteristic measured from the real device and the memristor's behavior model [28,29].  The proposed circuit is tested with wire resistance that is varied from 0.5 to 2.5 Ω. This range of wire resistance is commonly used and obtained from the International Technology Roadmap for Semiconductors [24,25,[31][32][33][34]. Figure 7 shows the comparison of the recognition rate between the memristor crossbar without compensating circuit and the proposed memristor crossbar with compensating circuit when the wire resistance is set to be 0.5, 1.0, 1.5, 2.0, and 2.5 Ω, respectively. The recognition rate of the memristor crossbar without compensating circuit declines dramatically when wire resistance increases. In particular, the recognition rate of the memristor crossbar without compensating circuit is 99%, 95%, and 81%, when the wire resistance is set to be 1.5, 2.0, and 2.5 Ω, respectively. By contrast, the proposed memristor crossbar with compensating circuit can maintain the recognition as high as 100% when wire resistance is as high as 2.5 Ω.
The proposed circuit is tested with wire resistance that is varied from 0.5 to 2.5 Ω. This range of wire resistance is commonly used and obtained from the International Technology Roadmap for Semiconductors [24,25,[31][32][33][34]. Figure 7 shows the comparison of the recognition rate between the memristor crossbar without compensating circuit and the proposed memristor crossbar with compensating circuit when the wire resistance is set to be 0.5, 1.0, 1.5, 2.0, and 2.5 Ω, respectively. The recognition rate of the memristor crossbar without compensating circuit declines dramatically when wire resistance increases. In particular, the recognition rate of the memristor crossbar without compensating circuit is 99%, 95%, and 81%, when the wire resistance is set to be 1.5, 2.0, and 2.5 Ω, respectively. By contrast, the proposed memristor crossbar with compensating circuit can maintain the recognition as high as 100% when wire resistance is as high as 2.5 Ω.

Discussion
Finally, we discuss the power and area overhead of the proposed memristor crossbar circuit. The proposed circuit uses the compensating circuit constituted by an Op-Amp and four resistors. The proposed circuit consumes more power and area, compared to the memristor crossbar without compensating circuit. However, the proposed memristor crossbar with compensating circuit shows better recognition rate by 19% than the previous memristor crossbar circuit, when wire resistance is set to be 2.5 Ω. Because wire resistance in the crossbar cannot be omitted, the proposed scheme makes the memristor crossbar-based perceptron neural network become more possible. The proposed circuit can be applied to memristor-based crossbar architectures which are used in resistive memory and artificial neural networks [34][35][36].

Conclusions
In this work, a memristor crossbar-based perceptron neural network with compensating circuit is proposed. The neuron's outputs of two columns are put into a subtractor circuit to eliminate the voltage variation caused by wire resistance. The memristor crossbar-based perceptron neural network is trained to recognize the 26 characters. The proposed memristor crossbar with compensating circuit shows better recognition rate, compared to the previous memristor crossbar without compensating circuit when wire resistance is taken into account. The simulation result shows that the proposed circuit can maintain the recognition rate as high as 100% when the wire resistance is set to be 2.5 Ω. By contrast, the recognition rate of the memristor crossbar without compensating circuit decreases by 19% when wire resistance is set to be 2.5 Ω.
Funding: This research received no external funding.

Conflicts of Interest:
The author declares no conflicts of interest.

Discussion
Finally, we discuss the power and area overhead of the proposed memristor crossbar circuit. The proposed circuit uses the compensating circuit constituted by an Op-Amp and four resistors. The proposed circuit consumes more power and area, compared to the memristor crossbar without compensating circuit. However, the proposed memristor crossbar with compensating circuit shows better recognition rate by 19% than the previous memristor crossbar circuit, when wire resistance is set to be 2.5 Ω. Because wire resistance in the crossbar cannot be omitted, the proposed scheme makes the memristor crossbar-based perceptron neural network become more possible. The proposed circuit can be applied to memristor-based crossbar architectures which are used in resistive memory and artificial neural networks [34][35][36].

Conclusions
In this work, a memristor crossbar-based perceptron neural network with compensating circuit is proposed. The neuron's outputs of two columns are put into a subtractor circuit to eliminate the voltage variation caused by wire resistance. The memristor crossbar-based perceptron neural network is trained to recognize the 26 characters. The proposed memristor crossbar with compensating circuit shows better recognition rate, compared to the previous memristor crossbar without compensating circuit when wire resistance is taken into account. The simulation result shows that the proposed circuit can maintain the recognition rate as high as 100% when the wire resistance is set to be 2.5 Ω. By contrast, the recognition rate of the memristor crossbar without compensating circuit decreases by 19% when wire resistance is set to be 2.5 Ω.
Funding: This research received no external funding.

Conflicts of Interest:
The author declares no conflicts of interest.