BTP, memristor

CMOS-Memristor hybrid circuit for Edge detection using NI Multisim and MATLAB

Hello, In this post, we will have a look at the following:

  • Setting up 180nm/100nm MOSFET Models in Multisim
  • Setting up a memristor model in NI MULTISIM
  • A CMOS-Memristor hybrid circuit for edge detection
  • Using MATLAB for image analysis

NI Multisim is an excellent tool for simulation of both analog and digital circuits. One reason I like it over LTSpice or PSpice is the ease with which one can simulate mixed-signal circuitry. Using Multisim along with MATLAB allows conversion of image(pixel by pixel) to its a corresponding discrete voltage signal and vice versa.

We can import PSPICE models to multisim using its component wizard. I’ll elaborate it further:

Setting up 180nm/100nm MOSFET Models in Multisim

Following is the code for NMOS and PMOS using 180nm fabrication technology:


for 100nm, the MOSFET SPICE code can be found here.

The above code can be imported using the component wizard.
Note:- For MULTISIM, change the ‘LEVEL’ parameter in the above codes from 7 to 8.

Setting up a memristor model in NI MULTISIM

There are mainly 3 types of memristor models: Linear, Non-Linear, and TEAM. I mostly use a Non-linear model with Prodomakis or Jinxiang window functions. Have a look at my previous post for an overview of all available memristor models and window function.

Below is the Non-linear memristor model with jinxiang window function:

The above model can again be imported in Multisim using Component Wizard.

After importing the model, it can be verified using the following circuit:
Change in memristance concerning time can be seen in the adjoining graph, which thus confirms the working of the model.
Note- While performing transient analysis of the memristor model in Multisim,  change the initial condition setting to ‘User-defined’, otherwise simulation might not converge.

A CMOS-Memristor hybrid circuit for edge detection

  • This circuit is primarily a region segmentation circuit where a memristor can control the intensity of response.
  • It can be used for Edge detection, color extraction from an image, etc.
The output of the above Edge detection circuit, where the image on the right is the input image, and the one on the left is the output one.
Edge detection circuit

The complete circuit consists of 3 parts. First and the last part makes up the variable threshold NOT gate, which is responsible for setting up lower and upper limits between which whenever the input signal lies, output comes in the form of a spike.

Input and output signal of an edge detection circuit

Using MATLAB for image analysis

Here MATLAB is being used to convert an image sequentially(Pixel by Pixel) to an electrical discrete signal, which is then passed through the circuit. Circuit’s output is then converted using another script to the output image.

Below are the MATLAB scripts:

output can be probed from the img_serial variable.

The output of the analog signal can be stored in a CSV file(line 3), which is then processed to convert it into an image.

Tagged , , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.