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 memristor model in NI MULTISIM
  • A CMOS-Memristor hybrid circuit for edge detection
  • Using MATLAB for image analysis

NI Multisim is a great 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 it’s corresponding discrete voltage signal and vica 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:

Source: https://user.eng.umd.edu/~newcomb/courses/spring2010/303/tsmc180nmcmos.lib

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

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

Setting up memristor model in NI MULTISIM

There are mainly 3 type of memristor models: Linear, Non-Linear and TEAM. I mainly use 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:

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 with respect to time can be seen in the adjoining graph, which thus confirms the working of the model.
Note- While performing transiant analysis of 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 memristor can control the intensity of response.
  • It can be used for: Edge detection, colour extraction from an image etc.
Output of the above Edge detection circuit, where image on right is the input image and the one on the left is the output one.
Edge detection circuit

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

Input and output signal of edge detection circuit

Using MATLAB for image analysis

Here MATLAB is being used to convert an image sequentially(Pixel by Pixel) to an electrical descrete 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 img_serial variable.

Output of analog signal can be stored in a csv file(line 3) which is then processed to convert it into an image.

Tagged , , ,

About Udit kumar agarwal

Leave a Reply

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