Вы находитесь на странице: 1из 68

EDA Lab Manual

FOCUS INSTITUTE OF SCIENCE AND


TECHNOLOGY, POOMALA, THRISSUR
(Approved by AICTE, New Delhi , Affiliated to University of Calicut & APJ Abdul
Kalam Technological University)
Poomala, Thrissur District, Kerala 680 581.

------------------------------------------------------------------------------------------------------------------------------------------------

VISION: To create an Excellent Educational Environment for the students, for the development of
professional skills and fasten a strong sense of ethical commitment to the society.
MISSION: The mission of Focus Foundation is to enhance the knowledge of students through Quality
Education and make them competent in their field of study such as Science and Technology, Architecture,
Management and other areas. Focus Foundation is dedicated to provide quality and well-disciplined
education that combines rigorous academic study and the excitement of discovery with the support and
intellectual stimulation of a diverse campus community.

Electronics and Communication Dept ,FIST Poomala

Page1

EDA Lab Manual

Sub Name

: ELECTRONIC DESIGN AUTOMATION LAB


[EC 233]

Department of
Students

: ECE

Semester: III

Electronics and Communication Dept ,FIST Poomala

Page2

EDA Lab Manual

List Of Experiments
PSPICE EXPERIMENTS
Expt. No.
1
2
3

Experiment
Introduction To EDA Tools
Introduction To Pspice

PAGE
5
6

Diode Characteristics Using Pspice


Positive Clipping Circuit Using Pspice

12

Negative Clamping Circuit Using Pspice

20

RC Integrator

23

RC Differentiator

26

RC Phase Shift Oscillator

29

RC Coupled Amplifier

32

17

MATLAB EXPERIMENTS
Expt. No.
1
2

Experiment
Introduction To Matlab

PAGE
35

Basic Mathematical Equations


Generation Of Various Plots

49

Diode/Transistor Characteristics

58

Electrical Network Analysis

62

Electronics and Communication Dept ,FIST Poomala

53

Page3

EDA Lab Manual

1 INTRODUCTION TO EDA TOOLS

The software tools that engineers used for the rapid design and verification of complex
Electronic Systems is termed as EDA.
Electronics and Communication Dept ,FIST Poomala

Page4

EDA Lab Manual

EDA consists of collection of methodologies, algorithms and tools, which assist the
automatic design, verification and testing of Electronic systems.

It embodies a general

methodology that seeks to successively refine a high level

description to low level detailed physical implementation for designs ranging from
integrated circuits (including system- on chips )to printed circuited boards (PCBs)and
Electronic System

It involves modeling, Synthesis and verification at every level of Abstraction.

OBJECTIVES
The primary objective of these experiments is to teach /familiarize the students how to
design and simulate the analog and digital electronics circuit, signals and systems using the
software which are available and used for the modem design methodologies. It also covers very
relevant software tools that an Electronics engineer must know.
1. Solving/plotting mathematical equations using MATLAB
2. Simulation of circuits using PSPICE
3. Implementing Simple digital circuits using VHDL.

Electronics and Communication Dept ,FIST Poomala

Page5

EDA Lab Manual


2 INTRODUCTION TO PSPICE
2.1 OBJECTIVES
1. Introduction to Pspice Software.
2. Recognize various schematic symbols/model parameters of resistor, capacitor, inductor,
energy sources, DIODE, BJT, FET, MOSFET, etc.
3. Use PSPICE Schematic Editor to draw and analyze (DC, AC, Transient) simple, analog
and digital electronic circuits.
2.2 SPICE
SPICE (Simulation Program with Integrated Circuit Emphasis) is a general-purpose, open
source analog electronic circuit simulator. It is a program used in integrated circuit and boardlevel design to check the integrity of circuit designs and to predict circuit behavior. It is a
program used in integrated circuit and board-level design to check the integrity of circuit designs
and to predict circuit behavior. Unlike board-level designs composed of discrete parts, it is not
practical to breadboard integrated circuits before manufacture. Further, the high costs
of photolithographic masks and other manufacturing prerequisites make it essential to design the
circuit to be as close to perfect as possible before the integrated circuit is first built. Simulating
the circuit with SPICE is the industry-standard way to verify circuit operation at the transistor
level before committing to manufacture an integrated circuit. The circuit can also b tested at
different external environmental conditions. SPICE was developed at the Electronics Research
Laboratory of the University of California, Berkeley in 1975.
2.3 INTRODUCTION TO PSPICE
PSpice is a PC version of SPICE which is available from OrCAD Corp. of Cadence Design
Systems, Inc.that offer a total solution for the core design tasks: schematic and VHDL based
design entry;FPGA and CPLD design synthesis;digital,analog and mixed-signal simulation;
printed circuit board layout. These products are a suite of applications built around an engineers
design flow. Pspice is just one element in this total solution design flow.
Pspice is a simulating program that models the behavior of a circuit. Pspice simulates analog
only circuits whereas Psice A/D simulates any mix of analog and digital devics.Used with Orcad

Electronics and Communication Dept ,FIST Poomala

Page6

EDA Lab Manual


capture for design entry, it can be considered as a software based breadboard of a circuit that can
be used to test and refine the design before manufacturing the physical circuit board or IC.
2.4 Analysis with Pspice
Pspice supports analysis that can simulate analog-only, mixed-signal and digital-only circuits.
Pspice fully supports digital analysis by simulating the timing behavior of digital devices within
a standard transient analysis including worst case timing. For mixed analog\digital circuits, all of
the above mentioned analysis can be run. If the circuit is digital only transient analysis can be
run.
2.4.1 Basic Analysis
DC analysis is a computation of voltages and currents as a function of a variable dc voltage, or a
variable dc current, or a variable parts value (example: resistor), or a variable parameter
(example: temperature affecting the characteristics of a diode)
AC analysis is a computation of voltages and currents within a circuit as a function of a voltage
or current with constant amplitude but with variable frequency within a specified range.
Transient analysis is computation of voltages and currents of a circuit as function of time tstarting at t=0 including all transients, based on arbitrary input value of voltage or current and on
certain starting conditions (bias point)
1. DC sweep & other DC calculations.
These DC analyses evaluate circuit performance in response to a direct current
source. Table summarizes what PSpice A/D calculates for each DC analysis type.
Types
DC sweep
Bias point detail
DC sensitivity
Small signal DC transfer

PSpice computers
Steady state voltages, currents and digital states
sweeping a source , a model parameter,
over a range of values.
Bias point data in addition to what is automatically
computed in any simulation.
Sensitivity of a net or part voltage as a function of
bias point
Small signal DC gain, input & output resistance as a
function of bias point.
Table 2.1 DC Analysis Types

Electronics and Communication Dept ,FIST Poomala

Page7

EDA Lab Manual

2. AC sweep and noise


These AC analyses evaluate circuit performance in response to a small _ signal
alternating current source. Table summarizes what PSpice A/D calculates for each AC
analysis type.
3. Transient and Fourier These time based analysis evaluate circuit performance in
response to time- varying sources. Table summarizes what PSpice A/D calculates for
each time-based analysis type.
2.4.2 Advanced multi- run analysis
The multi run analysis result in a series of DC sweep, AC sweep or transient analysis depending
of which basic analysis you enabled.
Parametric and temperature analysis: For parametric and temperature analysis, PSpice A/D
steps a circuit value in a sequence that you specify and runs for a simulation for each value. For
parametric analysis you can step global parameter, model parameter, component value, DC
source or operational temperature. For temperature analysis we step the operational temperature.
Monte Carlo and sensitivity/worst case analysis: Monte Carlo and sensitivity /worst case
analyses statistical. PSpice changes device model parameter values with respect to device and lot
tolerances that you specify, and runs a simulation for each value.
Types
AC sweep
Noise

PSpice computers
Small signal response of the circuit when sweeping one or more sources
over a range of frequencies. Outputs include voltages and currents with
magnitude and phase.
For each frequency specified in the AC analysis:
Propagated noise contribution from an output net from every noise
generator in the circuit.

RMS sum of the noise contribution at the output.

Equivalent input noise.

Note
To run a noise analysis, you must also run an AC sweep analysis.
2.5 Simulation steps
Before the simulation of a circuit, one has to specify the circuit configuration. This can be done
in a variety of ways. One way is to enter the circuit description as a text file in terms of the
elements, connections, the models of the elements and the type of analysis. This file is called the
SPICE input file or source file. An alternative way is use a schematic entry program such as
OrCAD CAPTURE. Capture is a user friendly program that allows you to capture the schematic
of the circuits and to specify the type of simulation. The following summarizes the different steps
involved in simulating a circuit with OrCAD Capture CIS.
Electronics and Communication Dept ,FIST Poomala

Page8

EDA Lab Manual

2.5.1 Create a new PSpice project


From the Window Start menu, choose the OrCAD Capture CIS shortcut to start Capture.

From the File menu, select the Project manager and point to the New and choose Project.

Select the Analog or Mixed Signal Circuit Wizard from the project window.

In the name text box, enter a suitable name of the project.

Use the browse button to select the location for the project files. This will help you to
arrange your project systematically. Click OK

In the create PSpice project dialog box, select create A Blank


Project .Click OK.

Electronics and Communication Dept ,FIST Poomala

Page9

EDA Lab Manual

Figure 2.2 Creating new project


2.5.2 Place the Voltage sources, Diodes, Ground, Off- page connecter and other parts
In Capture, switch to the schematic page editor.
From the Place menu, choose PSpice Component >>>Source>>>Voltage Source>>>DC.
Some parts can also be placed from the tool palette given.
Move the Pointer to the correct position on the schematic page and click to place the parts.
Move the cursor and click again to place the second part.
Press Esc key or Right Click and choose End mode to stop placing parts.
Diodes, Inductors, Resistors, Transistors, GND etc can be placed by similar steps from
PSpice component library.
Press the key R to rotate the parts and for the mirror image, select edit >>>mirror.

2.5.3 To add libraries and search components


You can place a part from the libraries if required because not all parts or components are
displayed.
Click the place part on the tool palette >>> add library>>> Select the required library and
open. It will list all the parts available in the library.
You can search any component by place >>> PSpice component >>> search.
Electronics and Communication Dept ,FIST Poomala

Page10

EDA Lab Manual

2.5.4 Connect the parts


From the place menu or tool palette choose place wire to begin wiring parts

The pointer changes to a cross hair .Click the connection point (the very end of the pin on
the parts and drag)

Press Esc key to stop wiring.

Assign names (labels) to the nets


From the place menu, choose Net Alias to display the place net alias dalog box.

In the Name text box, type the required name.

Click OK and place the net alias on any segment of the wire.

The lower left corner of the net alias must touch the wire.

In the value text box, type new value and Click OK.

Assign names to the parts and changes the values of the parts.
Double click the name of the parts to display the Display Properties dialogue box.

In the Name text box, type the new name and Click OK.

Double click the value label of a part to display the Display Properties dialogue box.

In the value text box, type new value and Click OK.

Electronics and Communication Dept ,FIST Poomala

Page11

EDA Lab Manual

2.6 Running and analyzing Simulation results.


Now let us find how to use Orcad Capture for running and analyzing simulation result
2.6.1 Transient analysis
In capture, select New simulation profile or Edit Simulation settings from the PSpice
menu. If this is a new simulation, enter the name of the profile and click OK.

The Simulation setting dialogue box appears, Under analysis type, select Time
Domain(Transient)

Enter the necessary parameter values like staring time, ending time and maximum step
size.

Click OK to save the simulation profile.

Smoothness of the waveform depends on the maximum step size.

Select Run under the PSpice menu to start the simulation.

2.6.2 DC Sweep analysis


In capture, select New simulation profile or edit simulation settings from the PSpice
menu. If this new simulation, enter the name of the profile and click OK.

The Simulation settings dialogue box appears. Under analysis type, select DC Sweep.

For the primary sweep option, enter the necessary parameter values and select the
appropriate check boxes to complete the analysis specifications.

Electronics and Communication Dept ,FIST Poomala

Page12

EDA Lab Manual

Click OK to save the simulation profile.

Select Run under the PSpice menu to start stimulation.

2.6.3 Bias point analysis


In capture, Select New Simulation Profile or edit simulation settings from the PSpice
menu. If this is a new simulation, enter the name of the profile and click OK.

From the inherit from the list, select none, and then click create.

The Simulation settings dialog box appears. Under analysis type , select Bias point.

Click OK to save the simulation profile.

Select Run under the PSpice menu to start the simulation.

AC sweep analysis
AC sweep is a frequency response analysis. PSpice calculate the small signal response of the
circuit to a combination of inputs by transforming it around the bias point and treating it as a
linear circuit.
In capture select simulation profile or Edit Simulation setting from the PSpice menu. If
this is a new simulation, enter the name of the profile and click OK.

The Simulation settings dialogue box appears. Under Analysis type, select AC
sweep/Noise analysis. Click OK to save the simulation profile.

Select RUN under the PSpice to start the simulation. Under Options, select General
settings if it is not already enabled.

Set the number of sweep points as linearly or logarithmically by decades.

In the Start Frequency and End Frequency text boxes, enter the starting and ending
frequencies, respectively, for the sweep. Click OK to save the simulation profile and run.

Electronics and Communication Dept ,FIST Poomala

Page13

EDA Lab Manual

AIM:To plot, the diodes forward characteristics using PSPICE.

THEORY:PN junction diode has the unique ability to permit current flow only in one direction. The
lead connected to the P-region is called anode and that connected to the N-region is called
cathode. The P-type and N-type semiconductors are electrically neutral if considered separately.
During junction formation, majority carriers try to diffuse through the junction. This happens due
to the concentration gradient of holes and electrons existing inside the diode. Because of the
diffusion of majority carriers from P-region from N-region and vice versa, neutrality ends and a
potential barrier is setup at the junction. This barrier potential is 0.6v for silicon and 0.3v for
germanium approximately. The region thus created is devoid of majority carriers .It has a depth of
about 1m and is called depletion region or transition region.

FORWARD BIAS:If the anode of the diode is connected to the positive terminal of a power supply and
cathode to the negative terminal, the setup is called forward biasing. The diode will not conduct
until the supply voltage exceeds its potential barrier. Once the biasing voltage overcomes the
barrier potential, high forward current in the order of mA flows through the diode due to the
movement of holes and electrons across the junction. The applied voltage at which current starts
flowing in forward biased diode is called knee voltage or cut in voltage.

Electronics and Communication Dept ,FIST Poomala

Page14

EDA Lab Manual

CIRCUIT DIAGRAM

PROCEDURE:Starting a project:

Click START
Click in ALL PROGRAMS or
PROGRAMS
Select OrCAD Family Release 16.6
edition
Click on FILE > NEW > PROJECT
Write a suitable NAME: EC Lab (for eg:)
Select a suitable location

Select analog or Mixed A/D


Click OK
Choose create a Blank project
Name the schematic as DIODE CHARA.

ADDING COMPONENTS:

Click Place > Select Part > Type D 1N4002 > Place the component.
Click Place > Select Part > Type VDC > Place it.
Click Place > Select Part > Type R >Place the component.
Click place> select Ground > select GND/ CAPSYM.
Double click on ground symbol.
Arrange components, necessary movements and rotations.
Click on place > Select wire; connect components.

SIMULATION:

Click on PSPICE >Select New simulation Profile


Name it as DC sweep

Electronics and Communication Dept ,FIST Poomala

Page15

EDA Lab Manual

Change ANALYSIS TYPE to DCSWEEP


Enter: V1 in Name field
0 in start value
5 in end value
0.1 in increment

SIMULATE AND VIEW:

Select Run from PSPICE


Click on Trace, Select Add Trace
Select I(D1)
Click plot. Select Axis settings
Click X-axis. Select user defined.
Click Y- axis. Select user defined.

Electronics and Communication Dept ,FIST Poomala

Page16

EDA Lab Manual

RESULT:
Diode characteristics were plotted.

4 POSITIVE CLIPPING CIRCUIT USING PSPICE


AIM:
To study positive clipper and plot its output waveform using PSPICE.

THEORY:Clipping refers to removing a portion of the input signal that lies above or below a
reference level. Clipping or limiting is a linear wave shaping process by which we can extract
Electronics and Communication Dept ,FIST Poomala

Page17

EDA Lab Manual


desired part of the input signal as necessary. Limiting circuits are utilized in radio receivers to
avoid the noise pulses that rise above the average signal amplitude. Capability of the diodes to
permit current flow only in one direction enables them to be used as the clipping devices.
Diode clipping circuits can be classified as series and shunt clippers. If the diode is connected
in series with the input, the circuit is a series clipper. On the other hand, the circuits with diode
connected in parallel to the input are called shunt clippers. Considering the positive parallel
clipper circuit, the output is taken across the diode. During positive half cycle of the input, the
diode is forward biased and hence no output results. But during negative half cycle, diode is
reverse biased and therefore the signal is transferred to output terminals. Thus the waveform
obtaining from the circuit will have only negative half cycle. Since the diode will be in off state
until knee voltage is reached, a slice of the positive signal up to 0.6V will also appear in the
output.

CIRCUIT DIAGRAM

ROCEDURE:
STARTING A PROJECT:

Click start
Click in all programs or programs
Select OrCAD Family Release 16.6 Edition
Select Capture Lite Edition
Click on File > New > project
Write a suitable name
Select a suitable location
Select Analog or Mixed A/D
Click OK
Choose create a blank project

Electronics and Communication Dept ,FIST Poomala

Page18

EDA Lab Manual

Name the schematic as positive clipper

ADDING COMPONENTS:

Click place > Select Part > Type D1N4002 > Place the component.
Click place > Select part > Type R > place the component.
Click place > Select part > Type Vsin > place it.
Click place > Select Ground > Select GND/CAPSYM
Double click on ground symbol
Change the name GND to 0
Add probes
Arrange components, necessary movements and rotations.
Click on place > Select wire, connect components.

SIMULATION:

Click on PSPICE > Select New simulation profile.


Name it as positive clipper.
Change ANALYSIS to TIME DOMAIN(Transient)
Enter ; 10ms in Run to time
1ms in maximum step size
0 in start value
Click APPLY > OK.

SIMULATE AND VIEW:

Select Run from PSPICE pic.


To see input and output separately, click on input waveform.
Click cut to cut the input
Click on plot > Select Add plot to window
Click and paste it.

Electronics and Communication Dept ,FIST Poomala

Page19

EDA Lab Manual

RESULT:
Positive clipper was studied and its output waveform was obtained.

5 NEGATIVE CLAMPING CIRCUIT USING PSPICE


AIM:
Electronics and Communication Dept ,FIST Poomala

Page20

EDA Lab Manual


To study negative clamper circuit and plot the input and output waveform using PSPICE.

PRINCIPLE:In some situations it is necessary to add or subtract a DC voltage to a given


waveform without changing the shape of waveform. Circuits used for this purpose are called
clamping circuits. A capacitor which is charged to a voltage and subsequently prevented from
discharging can serve as a suitable replacement for battery. This principle is utilized in clampers.
Clamping circuits are also called DC restoring or inserting circuits.
Negative Clamper:
During positive half cycle of input sine wave diode conducts and capacitor charges to Vm
with negative polarity at right side of the capacitor. During negative half cycle, the capacitor
cannot discharge as the diode will not conduct. Thus the capacitor act as a source of (V m0.7)
volts connected in series with the input signal. Then output voltage, V O= (Vm 0.7) + (Vm Sin
t).

PROCEDURE:
STARTING A PROJECT:
Click Start
Click in ALL PROGRAMS or PROGRAMS
Select OrCAD Family Release 16.6 Edition
Select Capture Lite Edition
Click on FILE > NEW > PROJECT
Write a suitable Name
Select a suitable Location
Select Analog or Mixed A/D
Electronics and Communication Dept ,FIST Poomala

Page21

EDA Lab Manual


Click OK
Choose create a blank project
Name the schematic as Clamper.

ADDING COMPONENTS:
Click place > Select part > Type D1N4002 > place the component.
Click place > Select part > Type C > place the component (change the value as 1Mf).
Click place > Select part > Type Vsin > place it.
Click on Vsin and change frequency = 1000Hz,
Amplitude =10V,
Voff =0.

Click place > Select Ground > Select GND/CAPSYM


Change Name GND to 0.

Arrange components, necessary movements and rotation.


Click on place > Select wire > connect components.

SIMULATION:

Click on PSPICE > Select New Simulation profile


Name it as Negative clamper.
Change ANALYSIS TYPE to TIME DOMAIN (Transient)
Enter; Run to time=10ms,
Start value=0,
Maximum step size=1ms.
Click APPLY > OK.
0
0.6V

SIMULATE AND VIEW:

Select Run from PSPICE.pic


To see input and output separately, click on input signal.
Click cut to cut the input signal.
Click on Plot > Select Add plot to window.
Click and paste.

Electronics and Communication Dept ,FIST Poomala

Page22

EDA Lab Manual

RESULT:
0

Clamper was studied and its output waveform was obtained.

6 RC INTEGRATOR
Electronics and Communication Dept ,FIST Poomala

Page23

EDA Lab Manual


AIM: To study RC integrator and plot its output waveform using PSPICE.
THEORY:
If the time constant of the circuit is very large in comparison with the time period of the input
signal, the circuit is called an integrator. Under this condition the voltage drop across C will be
very small in comparison to the drop across R.The current is Vin/R since almost all Vin is
appearing across R.
The output is proportional to the integral of the input. For satisfactory integration, it is necessary
that
RC >= 15T, where T is the period of input square wave.
When a pulse waveform is given at the input, capacitor charges through R and output voltage
builds up. Capacitor continues to charge as long as input voltage is present. When the input is
terminated, capacitor discharges and output falls to zero. As the value of RC increases the
amplitude of the output decreases and the output waveform becomes linear. This happens because the charging current does not vary much through a high value resistor. Constant current
through a capacitor gives a linear output. If the input is a square wave capacitor charges and
discharges from the negative voltage to the positive voltage input.

CIRCUIT DIAGRAM

PROCEDURE:
STARTING A PROJECT:
Electronics and Communication Dept ,FIST Poomala

Page24

EDA Lab Manual

Click start
Click in all programs or programs
Select Cadence
Select Release 16.6
Select Design entry CIS
Click on File > New > project
Write a suitable name
Select a suitable location
Select Analog or Mixed A/D
Click OK
Choose create a blank project
Click OK.

ADDING COMPONENTS:

Click place part > Select Part > Place the components
Click place > Select part > Type Vsin > place it.
Click place > Select Ground > place it
Arrange components, necessary movements and rotations.
Click on place > Select wire, connect components.

SIMULATION:

Click on New simulation profile.


Name it as integrator.
Change ANALYSIS to TIME DOMAIN(Transient)
Enter ; 10ms in Run to time
1ms in maximum step size
0 in start value
Click on options, click on auto converge, click ok.
Click on data collection, change all to all.
Click APPLY > OK.

SIMULATE AND VIEW:


Place probes in the input and output
Select Run from PSPICE.

Electronics and Communication Dept ,FIST Poomala

Page25

EDA Lab Manual

RESULT:
RC integrator was studied and its output waveform was obtained.

Electronics and Communication Dept ,FIST Poomala

Page26

EDA Lab Manual

7 RC DIFFERENTIATOR
AIM: To study RC Differentiator and plot its output waveform using PSPICE.
THEORY:
A circuit is called a differentiator if its time constant is very small in comparison with the time
period of the input signal. The voltage drop across R will be very small in comparison with the
drop across C.
The current through the capacitor is Cdv/dt. Hence the output is proportional to the derivative of
the input.
Vo = Resistance x current = RC*dVi/dt

Consider a sinusoidal signal (V*Sinwt) is fed to the input of the differentiator. Its output will be
(VRCwCoswt).
Response to pulse input
A pulse waveform is a kind of voltage that rises to a high voltage level abruptly and remains at
that level for a period of time and falls quickly to zero and remains at that level for another
period of time.
Differentiated output is proportional to the rate of change of input. When input rises to
maximum, differentiated output follows suit because the sudden change of voltage is transferred
to the output by the capacitor. Since the rate of change of voltage is positive, differentiated
output is also positive.
When input remains in maximum voltage for a period of time, the rate of change of voltage is
zero. So output falls to zero. During this time input acts like a dc voltage and capacitor offers
high impedance to it. So the charge in capacitor drains to earth through the resistance.
When input falls to zero, rate of change of input voltage is negative. Then the output also goes to
negative. For perfect differentiation, it should satisfy the following criterion RC <= 0.0016T
where T = 1/f, and f is the frequency of input signal.

Electronics and Communication Dept ,FIST Poomala

Page27

EDA Lab Manual


Response to square wave input
A square waveform has positive and negative excursions with respect to its reference zero. The
peak of the output of the differentiator rises when the square wave is fed to the input instead of
pulses.

CIRCUIT DIAGRAM

PROCEDURE:
STARTING A PROJECT:

Click start
Click in all programs or programs
Select Cadence
Select Release 16.6
Select Design entry CIS
Click on File > New > project
Write a suitable name
Select a suitable location
Select Analog or Mixed A/D
Click OK
Choose create a blank project
Click OK.

ADDING COMPONENTS:

Click place part > Select Part > Place the components
Click place > Select part > Type Vsin > place it.
Click place > Select Ground > place it
Arrange components, necessary movements and rotations.
Click on place > Select wire, connect components

Electronics and Communication Dept ,FIST Poomala

Page28

EDA Lab Manual

SIMULATION:

Click on New simulation profile.


Name it as integrator.
Change ANALYSIS to TIME DOMAIN(Transient)
Enter ; 10ms in Run to time
1ms in maximum step size
0 in start value
Click on options, click on auto converge, click ok.
Click on data collection, change all to all.
Click APPLY > OK.

SIMULATE AND VIEW:


Place probes in the input and output
Select Run from PSPICE.

RESULT:
RC Differentiator was studied and its output waveform was obtained.

Electronics and Communication Dept ,FIST Poomala

Page29

EDA Lab Manual

8 RC PHASESHIFT OSCILLATOR USING PSPICE


AIM: To plot the output waveform of RC PHASESHIFT OSCILLATOR using PSPICE
THEORY:
The oscillator is an amplifier with positive feedback that generates a number of waveforms
usually used in instrumentation and test equipments. An oscillator that generates a sinusoidal
output is called a harmonic oscillator; the transistor is usually acts in the active region. The
output of the relaxation oscillator is not sinusoidal depending on the transient rise and decay of
voltage in RC or RL circuits. There are two types of RC oscillators: 1. Phase shift oscillators in
which the output of an amplifier must be 180 o out of phase with input where the amplifier is an
ideal one. A phase shift network (usually a resistor-capacitor network) is used to produce an
additional phase shift of 180 at one particular frequency to develop the required positive
feedback. The phase shift oscillator is used to the range of frequencies for several hertz to several
kilohertz and so includes the range of audio frequencies. The frequency depends on the
impedance elements in the phase shift network. The phase shift oscillator circuit is not very
suitable for generating variable frequency because the resistors and capacitors must be
simultaneously changed to obtain the required frequency control over a wide range therefore it is
used mostly in fixed frequency applications.

Electronics and Communication Dept ,FIST Poomala

Page30

EDA Lab Manual

CIRCUIT DIAGRAM

PROCEDURE:

Click START

Click in ALL PROGRAMS

Select Cadence

Select Release 16.6

Select Design Entry CIS

Click on File > NEW>PROJECT>Write a suitable Name>Select suitable location>Select


analog or Mixed A/D > OK >Create a blank project > Ok.

Add library > Draw the circuit > Change the values of components.

create net list

view net list

Select New Simulation Profile

Name it as Transient

Change analysis type to Transient >Create a Simulation Profile for the transient analysis
and run PSpice.

Electronics and Communication Dept ,FIST Poomala

Page31

EDA Lab Manual

Place output probe

The result of the simulation for Vout is shown in the figure.

OUTPUT WAVEFORM

RESULT:

Electronics and Communication Dept ,FIST Poomala

Page32

EDA Lab Manual

9 RC COUPLED AMPLIFIER USING PSPICE


AIM: To plot the output waveform of RC COUPLED AMPLIFIER using PSPICE
THEORY
When a.c. signal is applied to the base of the first transistor, it is amplified and developed across
the out of the 1st stage. This amplified voltage is applied to the base of next stage through the
coupling capacitor Cc where it is further amplified and reappears across the output of the second
stage. Thus the successive stages amplify the signal and the overall gain is raised to the desired
level. Much higher gains can be obtained by connecting a number of amplifier stages in
succession (one after the other). Resistance-capacitance (RC) coupling is most widely used to
connect the output of first stage to the input (base) of the second stage and so on. It is the most
popular type of coupling because it is cheap and provides a constant amplification over a wide
range of frequencies. Fig. 1 shows the circuit arrangement of a two stage RC coupled CE mode
transistor amplifier where resistor R is used as a load and the capacitor C is used as a coupling
element between the two stages of the amplifier. Frequency response curve The curve
representing the variation of gain of an amplifier with frequency is known as frequency response
curve. It is shown in Fig. 2. The voltage gain of the amplifier increases with the frequency, f and
attains a maximum value. The maximum value of the gain remains constant over a certain
frequency range and afterwards the gain starts decreasing with the increase of the frequency. It
may be seen to be divided into three regions. 1) Low frequency range ( 20 kHz ).
CIRCUIT DIAGRAM

Electronics and Communication Dept ,FIST Poomala

Page33

EDA Lab Manual

PROCEDURE:
Click START
Click in ALL PROGRAMS
Select Cadence
Select Release 16.6
Select Design Entry CIS
Click on File > NEW>PROJECT>Write a suitable Name>Select suitable location>Select
analog or Mixed A/D > OK >Create a blank project > Ok.
Add library > Draw the circuit > Change the values of components.
create net list
view net list
Select New Simulation Profile
Name it as AC SWEEP
Change analysis type to AC SWEEP >Create a Simulation Profile for the ac sweep analysis
and run PSpice.
Select Trace > Add axis settings
Place input and output probe
The result of AC sweep simulation is shown in the figure.

Electronics and Communication Dept ,FIST Poomala

Page34

EDA Lab Manual

Frequency Response Of RC Coupled Amplifier

Electronics and Communication Dept ,FIST Poomala

Page35

EDA Lab Manual

Transient Analysis
RESULT: Frequency response of RC COUPLED AMPLIFIER was plotted using PSPICE.

1. INTRODUCTION TO MATLAB
Electronics and Communication Dept ,FIST Poomala

Page36

EDA Lab Manual

3.1 OBJECTIVES
Writing simple programmes in Matlab for handling arrays and plotting of mathematical
functions.

Writing M files for the plotting of analogue, discrete and noise signals.

Writing M files for analyzing the simple electronics circuits/ Networking using nod and
mesh equations.

3.2. STARTING MATLAB


MATLAB (MATrix Laboratory) is a high Level technical computing language and
interactive environment for algorithm development, data visualization, data analysis, and
numerical Computation. MATLAB can solve technical computing problems faster than
tradition programming languages. It contains hundreds of commands to do mathematical
expressions and can be used to graph Function, solve Equations , perform Statistical tests,
and much more .It is High- Level programming Language that can communicate Fortran , C
and C++.It can also produce sound and animate Graphics
3.3 MATLAB DESKTOP WINDOWS
MATLAB Desktop Window will contain a title bar , a menu Bar, tool Bar and four
Embedded Windows one of which is hidden. The largest and most important window is the
Command window. Other windows are the Command History Window, the current
directory browser and Worksop space browser. At the top of the Command window you may
see the command prompt (>>).If the Command window is Active, its bar will be dark, and
the prompt will be followed by a cursor ( a blinking vertical line). That is the place where
you will enter your MATLAB commands. If the Command window is not active, just click
in it anywhere. Figure contains an Example of a MATLAB Desktop.

Electronics and Communication Dept ,FIST Poomala

Page37

EDA Lab Manual

Fig 3.1 MATLAB Desktop Window


3.4 Solving and plotting Mathematical Equations
You input commands to MATLAB in the Command Window. MATLAB returns output
in two ways: Typically, test or numerical outputs returned in the same command window, but
Graphical output appears in a separate Figure Window.
3.4.1. Solving Mathematical Equations
Example- 3.1 Various Expressions and Equations.
>> 3^ 2- (5+4)/2+6*3
ans=
22.5000
ans^ 2 +sqrt(ans)
Electronics and Communication Dept ,FIST Poomala

Page38

EDA Lab Manual

ans=510.9934
Example 3.2 (Trigonometric Functions)
>>u= cos(10)
u=
-0.8391
>>=sin(10)
v=
-0.5440
Notice that trigonometric Functions in MATLAB use radians, not degrees.
If you want to get it in degrees, type
>>sind(10)
ans=
0.1736
>>u ^2+v^ 2
ans= 1

Example 3.3 Symbolic Expression, Variably Precision, and Exact Arithmetic


Using the Symbolic Math Tool Box, you can also do exact arithmetic with symbolic Expressions.
Consider the following Example:
>>cos(pi/2)
ans=6.1232 e-17
The answer is written in floating point format and means 6.1232 x10 -17 .However we know that
cos( /2 ) is really equal to 0. The inaccuracy is due to the fact that typing ( )in MATLAB gives
an approximation to accurate 15 digits, not to its exact value. To compute an exact answer
instead of an approximate answer, we must create an exact symbolic representation of. ( /2) by
typing sym( /2).Now let take the cosine of the symbolic representation of ( /2)
>> cos (sym ( /2))
ans=
0
This is the expected answer. The quotes around /2 in sym( /2) create a string consisting of
the characters /2 and prevent MATALB from evaluating pi/2 as a floatingpoint number. The
Command sym converts the string to a symbolic expression.
The commands sym and syms are closely related. In fact, syms x is equivalent to x= sym(x).
The Command syms has a lasting effect on its arguments. In fact, even if x was previously

Electronics and Communication Dept ,FIST Poomala

Page39

EDA Lab Manual


defined, since x clears that definition and renders x a symbolic variable- which it remains until
(if ever) it is redefined.
On the other hand, sym has only a temporary effect unless you assign the output to a variable, as
in x=sym(x).
Here is how to add and 1/3 symbolically:
>>sym (1/2) +sym(1/3)
ans=
5/6
To print 50 digits of 2 , type :
>>vpa(sqrt(2),50)
ans=
1.4142135623730950488016887242096980785696718753769
If you dont specify the number of digits, the default setting is 32. You can change the default
with the command digits.
3.4.2 VECTORS AND MATRICES
MATLAB allows handling the tools of linear algebra (vectors and matrices) as effortlessly as
possible.
Vectors (1D array)
A vector is an ordered list of numbers. You can enter a vector of any length in MAT LAB by
typing a list of numbers, separated by Commas and /or Spaces, inside Square brackets.
For example>>Z=[2,4,6,8]
Z=
2468
>> Y=[4-3 5-2 8 1]
Y=
4-35-2 81
Suppose that you want to create a vector of values running from 1 to 9 without typing each
number use colon operator:
>>X=1:9
X=123456789
The notation 1:9 is used to represent a vector of number running from 1 to 9 in increments of 1.
The increment can be specified as the middle of three arguments:
>> X=0:2:6
X=0 2 4 6
Electronics and Communication Dept ,FIST Poomala

Page40

EDA Lab Manual


Increments can be fractional or negative, for example, 0:0.1:1or 100:-1:0.The elements vector X
can be extracted as X (1), X(2), etc for example 0:0.1:1 or 100:-1:0 The elements of the vector X
can be extracted as X(1), X(2) etc
For Example.
>> X(3)
ans=
4
To change the vector X from arrow vector to column vector, Put a prime () after X:
>> X
ans=
0
2
4
6
MATRICES (2D) ARRAY)
A matrix is a rectangular array of numbers. Row and column vectors discussed above, are
example of matrices .Consider the 3x4 matrices which can be entered in MATLAB with
command
>>A=(12345:,5,6,7,8,9,8,7,6,)
A=
1234
5678
9876
Note that the matrix elements in any row are separated by commas, and the rows are separated
by /semi colons. The elements in a row can also be separated by spaces.
If two matrixes A & B are of the same size, their (element by element) some is obtained by
typing A+ B. You can also add scalar ( a single Number ) to a matrix ; A +C adds C to each in A.
Likewise , A-B represents the different of A & B, A- C Subtracts the number of C in each
element of A.
If A and B are multiplicatively compatible i.e, If A is n x m and B is m x l, then their product
A*B is n x1. You can also multiply a scalar (a single number) to a matrix; A*C multiply to each
element in A.
A represents the conjugate transpose of A
>>X=(234)
X=
234
Electronics and Communication Dept ,FIST Poomala

Page41

EDA Lab Manual


>> X
ans =
2
3,4
Array Multiplication
You can perform mathematical operation on vectors for example, to square the elements of the
vector X, Type
>>X= (0 2 4 8 10 ) ;
>> X . ^2
Ans=
0 4 16 36 64 100
The period in this expression is very important; it says that the numbers in X should be squared
individually, or element- by element. You must type. * or. /if you want to multiply or divide
vectors element by element. For example , to multiply the elements of the vector X by the
corresponding elements of the vector Y , type
>> X. *Y
>> x= (1 1 1;2 2 2;3 3 3)
X=
111
22 2
333
>> y= (2 2 2 ;222;333)
Y=
222
222
333
>> z=x*y
Z=
777
14 1 4 1 4
21 21 21
>> a = x.*y
a=
222
4 44
9 99
See the different in the result of X* Y multiplication and X. * Y multiplication.
Suppressing Output

Electronics and Communication Dept ,FIST Poomala

Page42

EDA Lab Manual


Typing a semi column at the end of an input line suppresses printing of the output of the
MATLAB command .The Semi column should generally be used when defining large vectors or
matrices, such as X= 1:0.1:2 . It can also be used in any other situation where the MATLAB need
not be displayed.
3.4.3 Plotting mathematical Equations
There are Two Basic Plotting Commands

Ezplot

Plot

Ezplot
The simplest way to graph a function of one variable is Ezplot, which expects a string, a
symbolic expression, or an anonymous function, representing function to be plotted. For
example, to graph X3 +X2 + 4 on the interval (-4 to 4) using the string form of Ezplot, type
>> Ezplot(x ^3 +x ^2 +4, [-4 4])
>> grid
The plot will appear on the in new window plot

EzPlot
The plot Command works on vectors of numerical data. The syntax is plot (x, y ) where x and y
are vectors for the same length for example
>> x = (0 1 2 3);
>> y = (0 1 10 100);
Electronics and Communication Dept ,FIST Poomala

Page43

EDA Lab Manual


>> plot (x, Y)
>> grid
>> axis square
>> tittles using plot Command

XY plot using command plot


The plot command considers the vectors X and Y to be lists of the x and y coordinates of
successive points on a graph, and joins the points with line segments so , in figure, MATLAB
connects (0 0 )to (1,1) to (2,10) to (3,10).
Modifying Graphs
You can modify a graph in a number of ways. You can change the title above the graph in figure
by typing (in the command window not the figure window ).
>> titile An example plot
>> Xlabel current, mA
>>ylabelvoltage V
The same change can be made directly in the figure window by selecting Axes Properties from
the edit menu at the top of the figure window.(Just type the new title in the box marked Title
Electronics and Communication Dept ,FIST Poomala

Page44

EDA Lab Manual


) You can add label on the vertical access with y label or change the label on the horizontal axis
wit x label. Also, you can change the horizontal and vertical ranges of the graph with the axis
command. For Example, to confine the vertical range to the interval from 0 to 3, type
>> axis( [-1 2 0 3] )
The first two number are the range of the horizontal axis,both ranges must be included, even if
only one is changed. To make the shape of the graph square, type.
>> axis Square
This also makes the scale the same on both axes if the x And y range have equal length. For
ranges of any lengths, you can force the same scale on both axes without changing the shape by
typing.
>> axis equal
Generally, this command will expand on of the ranges as needed. However, if u unintentionally
cut off part of graph, the missing part is not forgotten by MATLAB. You can readjust the ranges
with an axis command like the one above, or type axis tight to automatically set the ranges to
include the entire graph.
Plotting multiple curves
Each time you execute a plotting command, MATLAB erases the old plot and draws a new one .
If you want to over lay two or more plots, type hold on. This command instructs MATLAB to
retain the old graphics and draw any new graphics on top of the old. It remains in effect until you
type hold off. Here is an example using ezplot:
>>ezplot(exp(-x),[0 10])
>> hold on
>>ezplot(sin(x),[0 10])
>> hold off
>> tittle exp(-x) and sin(x)
>> grid
The commands hold on and hold off work with all graphics commands.

Electronics and Communication Dept ,FIST Poomala

Page45

EDA Lab Manual

Multiple Plot
With plot, you can plot multiple curves directly. For example:
>> X= 0:0.01:10;
>> plot(X,exp (-X),X,sin(X))
Note that the vector of X- coordinates must be specified ones for each function being plotted.
3.4.4 Plotting discrete time signals
The command stem is used to plot discrete time signals.
>>t=0: 0.05:1;
>> X= sin(2*P i *t);
>> stem(x)
3.5 2 D , 3D surface and polar plot
Command like plot draws the graphs from numerical data, and the command ezplot graphs the
function specified by string or symbolic inputs. These two commands may be easier to use at
first, but are more limited in the capabilities and less amenable to customisation. Here thus, the
commands that plot data, which are likely to be more useful in the long run.
3.5.1 Two Dimensional Plots
To draw a curve in the x- y plane, but with y not given explicitly as a function of x. There are
two main techniques for plotting such curves:
Parametric plotting and

Contour or implicit plotting

Parametric Plots
When x and y are both given as functions of some parameter. For example, the circle of radius 1
centred at (0,0) can be expressed in parametric form as
Electronics and Communication Dept ,FIST Poomala

Page46

EDA Lab Manual


x= cos(2*....* t ), y= sin (2*....*t), where runs from 0 to 1. Through y is not expressed as a
function of x, you can easily graph this curve with plot, as follows.
>>T= 0:0. 1:1;
>> plot(cos(2*pi* T), sin(2*pi*T))
>>grid
>>axis square
>> title (when T= 0:0.1:1)

Parametric plotting is also possible with ezplot. You can obtain almost the same picture as with at
the command
Contour Plots and implicit plots:
A contour plot of a function of a two variables is plot of the level curves of the function, i.e. Sets
of points in the x- y plane where the functions assume a constant value. For example the level
curves of x2 + y2 are circles cantered at the origin, and the levels are the squares the radii of the
circles. Contour plots are produced in MATALAB with mesh grid and Contour.
The command mesh grid produces a grid of points in rectangular region, with a specifies
spacing. This grid is used by contour to produce a contour plot in the specified region.
3.5.2 Three dimensional plot
Curves in Three dimensional space
For plotting curves in three spaces, the basic command is plot 3. It works like plot, expect that it
takes three vectors instead of two one for the X- coordinates 1 for Y coordinates, and the 1 for
the z coordinates. For example we can plot a helix with
>> T= -2:0.01:2;
>>plot 3(cos(3*pi* T), sin(3*pi* T), T)
Electronics and Communication Dept ,FIST Poomala

Page47

EDA Lab Manual


>>grid
>> title (3D plot using plot 3 command)

3.5.3 Surface Plots


There are two basic commands for plotting surfaces in 3- space:
Mesh and
Surf
The former produces a transparent mesh surface; the latter opaque shaded one. There are two
different ways of using the each command
One for plotting in surfaces in which the Z- Coordinates is given as a function of X and Y , and
One for Parametric surfaces in which X, Y and Z are all given as functions of two another
parameters.
Mesh
Two plot Z= f(X,Y) , one begins with a mesh grid command as in the case of contour. For
example the Z is = x2+Y2 can be plotted with.
>>[X,Y]=meshgrid(-2:0.1:2,-2:0.1:2);
>> Z=x. 2 +y. 2;
>>mesh (x,y,z)
The command surf gives and opaque shaded one.
>> Surf (x,y,z)
There are also shortcut commands ezmesh and ezsurf; You can obtain a result very similar.

Electronics and Communication Dept ,FIST Poomala

Page48

EDA Lab Manual


>> ezmesh (x 2-y 2,[-2,2,-2,2])
If one wants to plot a surface that cannot be represented by an equation of the form z= F(x,y ),
for example the sphere x2+y2+z2=1 then it is better to parameterize the surface using a suitable co
ordinates system, in this case cylindrical spherical coordinates for example, we can take as
parameters the vertical coordinates and the polar coordinate in the x- y plane. If are denote the
distance to the Z Axis, then the equation of the sphere becomes r2+x2 is = 1 or
Thus we can produce our plot with
>>[z, theta]=meshgrid(-1:0.1:1,(0:0.1:2)* pi);
>>X=sqrt(1-Z. 2).*cos(theta);
>>Y=sqrt(1-Z. 2).*sin(theta);
>> Mesh(X,Y,Z);
>> axis square

3.54 Polar Plots


The polar function accepts polar coordinate, plots them in a Cartesian plane and draws the polar
grid on the plane.
The command polar(theta,rho) create a polar coordinate plot of the angle theta verses the radius
rho. where theta is the angle from the x axis to the radius vector specified in radians; rho is the
length of the radius vector specified in data space units.
Polar(theta, rho,Line Spec) where line Spec specifies the line type, plot symbol and the colour
for the lines in the polar plot.
Example one
>>T=0:pi/18:2* pi;
>> polar (sign (2*T).*cos(2*T),T,;-6)
Example 2
>>T=0:pi/36: pi/2;
>> polar (5* T,sign (T),- b)

Electronics and Communication Dept ,FIST Poomala

Page49

EDA Lab Manual

3.6 Figure windows and Concept of sub plots


MATLAB is also capable of opening multiple figure windows or complaining several plots in
one figure window.
Multiple figure windows
When you execute the plotting command in a given MATALAB session, the graph appears in a
new window labeled figure 1. Subsequent graphics commands either modify or replace the
graph in this window. Command hold on directs that new plotting commands should add to
rather than replace, the current graphs. If instead you want to create a new graph in separate
window while keeping and old graph on your screen type figure e to open a new window, labeled
figure 2.
Combining plots in one Window
The command subplot divides the figure window into an array of smaller plots the first two
argument gives the dimensions of the array of sub plots, and the last arguments gives the number
of the sub plot (counting from left to right across the first row then from left to right across the
next row, and so on) in which to put the output of the next graphing command.
>> subplot(m, n, p);

Electronics and Communication Dept ,FIST Poomala

Page50

EDA Lab Manual

2 BASIC MATHEMATICAL EQUATIONS


AIM:
To solve and plot for mathematical equations using:
i.
Complex Numbers.
ii.

Array and Matrix Multiplication.

iii.

Quadratic Expressions.

SOFTWARE REQUIRED:
MATLAB R2014.
THEORY:
A.) Complex Numbers: A complex number is a number that can be expressed in the
form a + bi, where a and b are real numbers and i is the imaginary unit, that satisfies
the equation i2 = 1. In this expression, a is the real part and b is the imaginary
part of the complex number. Complex numbers extend the concept of the onedimensional number line to the two-dimensional complex plane by using the horizontal
axis for the real part and the vertical axis for the imaginary part. The complex
number a + bi can be identified with the point (a,b) in the complex plane. A complex
number whose real part is zero is said to be purely imaginary, whereas a complex number
whose imaginary part is zero is a real number.
B.) Array Of Numbers And Matrices:
An array refers to a set of numbers that follow a specific pattern. An array is an orderly
arrangement, often in rows, columns or a matrix. Arrays are used in multiplication and
division as it shows a great visual to show how multiplication can be shown as repeated
addition and division can be shown as fair shares. In mathematics, matrix
multiplication is a binary operation that takes a pair of matrices, and produces another
matrix. Numbers such as the real or complex numbers can be multiplied according
to elementary arithmetic.
C.) Quadratic Equations:
In elementary algebra, a quadratic equation is any equation having the form
ax2+bx+c=0
where [x] represents an unknown, and [a, b] and [c] represent known numbers such that a is
not equal to 0. If[a] = 0, then the equation is linear, not quadratic. The numbers a, b, and c are
the coefficients of the equation, and can be called respectively, as the quadratic coefficient,
the linear coefficient and the constant or free term. Because the quadratic equation involves
only

one

unknown,

it

is

called

"univariate".

Electronics and Communication Dept ,FIST Poomala

The

quadratic

equation

only

Page51

EDA Lab Manual


contains powers of x that are non-negative integers, and therefore it is a polynomial equation,
and in particular it is a second degree polynomial equation since the greatest power is two.

PROGRAM:
a.)Find A+B,A-B,A*B,A/B where A=3+7i, B=10-4i ;
z = [3+7i];
y = [15-3i];
a
b
c
d

=
=
=
=

z+y;
z-y;
z*y;
z/y;

b.) Plot the equation y=9-x2


x = linspace(-4,4);
y = sqrt(9-x.^2);
plot(x,y);
grid on ;
axis equal;
axis([-4,4,-4,4]);
xlabel('x-axis');
ylabel('y-axis');
title('The Plot of y=9-x^2');

Electronics and Communication Dept ,FIST Poomala

Page52

EDA Lab Manual

c.) Create two arrays and find their product;


A = [1 3 5; 2 4 7];
B = [-5 8 11; 3 9 21; 4 0 8];
C = A*B;
d.) Find the product of two matrices.
A=[3 4 1;
2 3 4];
B=[ 1 2 3;
4 5 6;
7 8 9];
[nRow1,nCol1]=size(A);
[nRow2,nCol2]=size(B);
if nCol1 ~= nRow2
error('inner dimensions must match');
end
C = zeros(nRow1,nCol2);
Electronics and Communication Dept ,FIST Poomala

Page53

EDA Lab Manual

for i = 1:nRow1
for j = 1:nCol2
for k = 1:nCol1
C(i,j) = C(i,j) + A(i,k)*B(k,j);
end
end
end
C;

e.) Solve for quadratic equation by creating a Function M File:


2x2 + x - 1 = 0
Function M
function x
x(1) = (-b
x(2) = (-b
end

File:
= rqe(a,b,c)
+ sqrt(b^2 - 4 * a * c))/(2*a);
- sqrt(b^2 - 4 * a * c))/(2*a);

Script M File:
m= rqe(2, 1, -1);
RESULT:

Electronics and Communication Dept ,FIST Poomala

Page54

EDA Lab Manual

3 GENERATION OF VARIOUS PLOTS


AIM: To obtain different types of plots.
i.
2D/3D Plots.
ii.

Surface/Polar Plots.

SOFTWARE REQUIRED:
MATLAB R2014.
THEORY:
Plotting mathematical Equations
There are Two Basic Plotting Commands

Ezplot

Plot

Ezplot Command:
The simplest way to graph a function of one variable is Ezplot, which expects a string, a
symbolic expression, or an anonymous function, representing function to be plotted.
Plot Command:
The plot command considers the vectors X and Y to be lists of the x and y coordinates of
successive points on a graph, and joins the points with line segments.
2 D, 3D surface and polar plot
Command like plot draws the graphs from numerical data, and the command ezplot graphs the
function specified by string or symbolic inputs. These two commands may be easier to use at
first, but are more limited in the capabilities and less amenable to customization.
Two Dimensional Plots
To draw a curve in the x- y plane, but with y not given explicitly as a function of x. There are
two main techniques for plotting such curves:
Parametric plotting and

Contour or implicit plotting

Three dimensional plot:


For plotting curves in three spaces, the basic command is plot 3. It works like plot, expect that it
takes three vectors instead of two one for the X- coordinates 1 for Y coordinates, and the 1 for
the z coordinates.
Surface Plots
There are two basic commands for plotting surfaces in 3- space:
Mesh and
Electronics and Communication Dept ,FIST Poomala

Page55

EDA Lab Manual


Surf
The former produces a transparent mesh surface; the latter opaque shaded one. There are two
different ways of using the each command
One for plotting in surfaces in which the Z- Coordinates is given as a function of X and Y, and
one for Parametric surfaces in which X, Y and Z are all given as functions of two another
parameters.
Polar Plots
The polar function accepts polar coordinate, plots them in a Cartesian plane and draws the polar
grid on the plane. The command polar (theta, rho) create a polar coordinate plot of the angle
theta verses the radius rho. where theta is the angle from the x axis to the radius vector specified
in radians; rho is the length of the radius vector specified in data space units.
Polar(theta, rho,Line Spec) : where line Spec specifies the line type, plot symbol and the colour
for the lines in the polar plot.
PROGRAMS:
1.) 2D PLOTS:
a.) To obtain a circle of radius 1 with centre at (0,0) using parametric plots.
T= 0:0.1:1;
plot(cos(2*pi* T), sin(2*pi*T));
grid;
axis square ;
title ('when T= 0:0.1:1');

Electronics and Communication Dept ,FIST Poomala

Page56

EDA Lab Manual

Parametric Plot
b.) To obtain the contour plot of x2+y2.
[X Y] = meshgrid(-3:0.1:3,-3:0.1:3);
contour(X,Y,X.^2+ Y.^2);
axis square;
grid;
title ('Contour plot of x^ 2 +y ^2');

Electronics and Communication Dept ,FIST Poomala

Page57

EDA Lab Manual

Contour Plot
2.) 3D PLOTS:
c.) To obtain the 3D Plot of a helix.
T= -2:0.01:2;
plot3(cos(3*pi* T), sin(3*pi* T), T);
grid;
title ('3D plot using plot 3 command');

Electronics and Communication Dept ,FIST Poomala

Page58

EDA Lab Manual

3D plot
3.) SURFACE PLOTS:
d.)To plot the function z=f(x,y).
[X,Y]=meshgrid(-2:0.1:2,-2:0.1:2);
Z=X.^2 +Y.^2;
mesh(X,Y,Z);

Surface Plot Using Mesh Command


4.) POLAR PLOTS
Electronics and Communication Dept ,FIST Poomala

Page59

EDA Lab Manual

e.)To obtain the polar plots of various signals.


T=0:pi/18:2* pi;
polar(sign(2*T).*cos(2*T),T,'-r');

Polar Plot
RESULT:

Electronics and Communication Dept ,FIST Poomala

Page60

EDA Lab Manual

4 DIODE/TRANSISTOR CHARACTERISTICS
AIM: To obtain the characteristics of diode/transistor.
i.
Diode
ii.

Transistor

SOFTWARE REQUIRED:
MATLAB R2014.
THEORY:
PN JUNCTION DIODE:
A pn junction is a boundary or interface between two types of semiconductor material, ptype and n-type, inside a single crystal of semiconductor. The "p" (positive) side contains an
excess of holes, while the "n" (negative) side contains an excess of electrons. The p-n junction is
created by doping, by ion implantation, diffusion etc. In a pn junction, without an external
applied voltage, an equilibrium condition is reached in which a potential difference is formed
across the junction. This potential difference is called built-in potential (V). In forward bias, the
p-side is connected with the positive terminal and the n-side is connected with the negative
terminal. With applied bias (Vf) the built-in potential reduces to (V-Vf) hence reducing the width
of the depletion region thereby allowing electrons and holes to diffuse through the junction
resulting in diode current. Under reverse bias, the p-side is connected with the negative terminal
and the n-side is connected with the positive terminal due to which the built-in potential at the
junction increases to (V+Vr), thereby resisting the flow of charge carriers within the junction.
The Shockley diode equation or the diode law, gives the IV (current-voltage) characteristic of
an idealized diode in either forward or reverse bias (applied voltage):
I= Is(eVd / Vt -1)
I is the diode current,
IS is the reverse bias saturation current (or scale current),
VD is the voltage across the diode
VT is the thermal voltage

is the ideality factor, also known as the quality factor.

BIPOLAR JUNCTION TRANSISTOR:


A Bipolar Junction Transistor (BJT) has three terminals connected to three doped semiconductor
regions. In an NPN transistor, a thin and lightly doped P-type base is sandwiched between a
heavily doped N-type emitter and another N-type collector; while in a PNP transistor, a thin and
lightly doped N-type base is sandwiched between a heavily doped P-type emitter and another Ptype collector.
Depending on which of the three terminals is used as common terminal, there can be three
possible configurations for the two-port network formed by a transistor:

Electronics and Communication Dept ,FIST Poomala

Page61

EDA Lab Manual

Common emitter (CE),

Common base (CB),

Common collector (CC).

Bipolar transistors have five distinct regions of operation, defined by BJT junction biases.
Forward-active
The baseemitter junction is forward biased and the basecollector junction is reverse biased.
It is the normal operational region of transistors employed for amplifications.
Reverse-active
By reversing the biasing conditions of the forward-active region, a bipolar transistor goes
into reverse-active mode and the emitter and collector regions switch roles. Because most
BJTs are designed to maximize current gain in forward-active mode, the F in inverted mode
is several times smaller.
Saturation
With both junctions forward-biased, a BJT is in saturation mode and facilitates high current
conduction from the emitter to the collector (or the other direction in the case of NPN, with
negatively charged carriers flowing from emitter to collector). This mode corresponds to a
logical "on", or a closed switch.
Cut-off
In cut-off, biasing conditions opposite of saturation (both junctions reverse biased) are
present. There is very little current, which corresponds to a logical "off", or an open switch.
PROGRAMS:
a.)
To plot the diode characteristics at room temperature.
k = 1.38e-23;
q = 1.6e-19;
n = 1;
V = 0.45:0.01:.8;
t = 300;
Vt = k*t/ q;
Is1 = 1.0e-12;
I0 = Is1*exp(V/(n*Vt))-Is1;
plot(V,I0,'r*');
axis([0.45,0.8,0,10]);
Electronics and Communication Dept ,FIST Poomala

Page62

EDA Lab Manual


title ('Diode I-V Curve at room temperature');
xlabel ('Voltage');
ylabel ('Current');
grid ;

Diode Characteristics

b.)

To plot the output characteristics of a COMMON EMITTER Transistor


clear all;
k = 1.381e-23;
temp = 300;
q = 1.602e-19;
cur_den = 2.0e-15;
area = 5.5;
vt = k*temp/q;
alpha_f = 0.98;
beta_r = 0.35;
is = cur_den*area;
ies = is/alpha_f;
ics = is/beta_r;
vbe = 0.62;
vce = [0:.5:6];
ifr = ies*(exp(vbe/vt)-1);
vbc = vbe- vce;
ir = ics*(exp(vbc/vt)-1);

Electronics and Communication Dept ,FIST Poomala

Page63

EDA Lab Manual


ic = alpha_f*ifr - ir;
ib = (1-alpha_f)*ifr+(1-beta_r)*ir;
plot(vce,ic);
title('OUTPUT CHARACTERSTICS');
xlabel('Collector Emitter Voltage Vce');
ylabel('Collector Current Ic');
text(3.7,3.0e-4, ['ib =(' num2str(ib(1)) ')']);
axis([0,5,0,4e-4]);

Output Characteristics of transistor


RESULT:

Electronics and Communication Dept ,FIST Poomala

Page64

EDA Lab Manual

5 ELECTRICAL NETWORK ANALYSIS


AIM: To solve for electrical circuit / networks using,
i.
Nodal Analysis
ii.

Mesh and Loop Equations

SOFTWARE REQUIRED:
MATLAB R2014.
THEORY:
Electrical Network: A combination of various electric elements (Resistor, Inductor, Capacitor,
Voltage source, Current source) connected in any manner what so ever is called an electrical
network. Kirchhoffs laws are basic analytical tools in order to obtain the solutions of currents
and voltages for any electric circuit.
Node- A node in an electric circuit is a point where two or more components are connected
together. This point is usually marked with dark circle or dot. Generally, a point, or a node in an
circuit specifies a certain voltage level with respect to a reference point or node.
Branch- A branch is a conducting path between two nodes in a circuit containing the electric
elements. These elements could be sources, resistances, or other elements.
Loop- A loop is any closed path in an electric circuit i.e., a closed path or loop in a circuit is a
contiguous sequence of branches which starting and end points for tracing the path are, in effect,
the same node and touches no other node more than once.
Mesh- a mesh is a special case of loop that does not have any other loops within it or in its
interior.
Kirchhoffs Current Law (KCL): KCL states that at any node (junction) in a circuit the
algebraic sum of currents entering and leaving a node at any instant of time must be equal to
zero. Here currents entering(+ve sign) and currents leaving (-ve sign) the node must be assigned
opposite algebraic signs .
Kirchhoffs Voltage Law (KVL): It states that in a closed circuit, the algebraic sum of all
source voltages must be equal to the algebraic sum of all the voltage drops. Voltage drop is
encountered when current flows in an element (resistance or load) from the higher-potential
terminal toward the lower potential terminal. Voltage rise is encountered when current flows in
an element (voltage source) from lower potential terminal (or negative terminal of voltage
source) toward the higher potential terminal (or positive terminal of voltage source).

Electronics and Communication Dept ,FIST Poomala

Page65

EDA Lab Manual

PROGRAMS:
a.) To find the nodal voltages of the following electrical circuit

Solution:
At node1,
2mA = 1mA + (v1-v2)/2.5 + v1/5
1 = 0.6v1-0.4v2
At node2,
4mA +3mA = 2mA + (v1-v2)/2.5 + v2/5 + (v2-v3)/2.5
5 = -0.4v1 +v2 -0.4v3
At node3,
(v3-v2)/2.5 +v3/2.5+4mA+10mA=0
-0.4v2 +0.8v3= -14
MATLAB CODE:
syms v1 v2 v3;
[v1 v2 v3] = solve('0.6*v1-0.4*v2-1','0.4*v1+v2-0.4*v3=5','0.4*v2+0.8*v3=-14')
OUTPUT
v1 =
0
v2 =
-2.5

Electronics and Communication Dept ,FIST Poomala

Page66

EDA Lab Manual


v3 =
-18.75

b.) To find the currents i1,i2,i3 flowing through each loop

Solution:
Loop1
3.4V=1i1 + 500i1 +1(i1 i2)+13.6
2.5 i1 -1i2 = -10.2
Loop2
500 i2+1(i2 i3) +3.4V-13.6V=0
-1i1+2.5i2 -1i3 = 10.2
Loop3
500 i3+1i3 +6.8V-3.4V + 1(i3- i2) =0
-1i2+2.5i3 = -3.4

MATLAB CODE:
syms i1 i2 i3;
[i1 i2 i3] = solve('2500*i1-1000*i2=-10.2','-1000*i1+2500*i21000*i3=10.2','-1000*i2+2500*i3=3.4')

Electronics and Communication Dept ,FIST Poomala

Page67

EDA Lab Manual

OUTPUT
i1 =
-0.00232
i2 =
0.0044
i3 =
0.00312
RESULT:

Electronics and Communication Dept ,FIST Poomala

Page68

Вам также может понравиться