BS & DSD LAB MANUAL - Final
BS & DSD LAB MANUAL - Final
PREFACE
This laboratory lays the foundation for the Electronics and Communication Engineering students
during second year of their course. BS&DSD LAB can be divided into 2 groups: Hardware &
Software. In Hardware lab, the students design, even Parity Generator, MUX, decoders, adder,
subtractor, BCD adder, 4 bit magnitude comparator circuit. Flip-flop, synchronous/asynchronous,
up/down counter. In Software, the students will MATLAB is used in this lab to simulate
signals.Basic concepts of signals are coded and simulated. Analyze the generation Various
Signals and Sequences in MATLAB, including the operations on Signals and Sequences.
Determine the Convolution and Correlation between Signals and systems.
BY
K.NAGAMANI, Asst. Prof.
N.RESHMA BINDU, Asst. Prof.
T.TANUJA, Asst. Prof.
DEPARTMENT OF ECE 1
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
ACKNOWLEDGEMENT
It was really a good experience, working with Basic simulation & Digital design lab. First
we would like to thank Dr.Srinivas Bachu, Professor, HOD of Department of Electronics and
Communication Engineering, Marri Laxman Reddy Institute of technology & Management for
his concern and giving the technical support in preparing the document.
We are deeply indebted and gratefully acknowledge the constant support and valuable
patronage of Dr.C.Balarengadurai, Dean Academics, Marri Laxman Reddy Institute of
technology & Management for giving us this wonderful opportunity for preparing the Basic
simulation & Digital design lab laboratory manual.
At last, but not the least I would like to thanks the entire ECE Department faculty those who had
inspired and helped us to achieve our goal.
BY
K.NAGAMANI, Asst. Prof.
N.RESHMA BINDU, Asst. Prof.
T.TANUJA, Asst. Prof.
DEPARTMENT OF ECE 2
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
GENERAL INSTRUCTIONS
1. Students are instructed to come to Basic simulation & Digital design laboratory on time.
Late comers are not entertained in the lab.
2. Students should be punctual to the lab. If not, the conducted experiments will not be
repeated.
3. Students are expected to come prepared at home with the experiments which are going to
be performed.
4. Students are instructed to display their identity cards before entering into the lab.
5. Students are instructed not to bring mobile phones to the lab.
6. Any damage/loss of equipments like transformers, transistors, CRO’s etc., during the lab
session, it is student’s responsibility and penalty or fine will be collected from the
student.
7. Students should update the records and lab observation books session wise. Before
leaving the lab the student should get his lab observation book signed by the faculty.
8. Students should submit the lab records by the next lab to the concerned faculty members
in the staffroom for their correction and return.
9. Students should not move around the lab during the lab session.
10. If any emergency arises, the student should take the permission from faculty member
concerned in written format.
11. The faculty members may suspend any student from the lab session on disciplinary
grounds.
12. Never copy the output from other students. Write down your own outputs.
DEPARTMENT OF ECE 3
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VISION
MISSION
To fulfill the promised vision through the following strategic characteristics and aspirations:
DEPARTMENT OF ECE 4
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Imparting quality technical education through research, innovation and team work for a lasting
technology development in the area of Electronics and Communication Engineering.
Our Mission
To develop a strong centre of excellence for education and research with excellent infrastructure
and well qualified faculties to instill in them a passion for knowledge.
1. Establish a unique learning environment to enable the students to face the challenges of
the Electronics and Communication Engineering field.
2. Promote the establishment of centre of excellence in niche technology areas to nurture
the spirit of innovation and creativity among faculty and students.
3. Provide ethical and value based education by promoting activities addressing the societal
needs.
4. Enable students to develop skills to solve complex technological problems of current
times and also provide a framework for promoting collaborative and multidisciplinary
activities.
DEPARTMENT OF ECE 5
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROGRAM OUTCOMES
a.a. An ability to apply knowledge of Science, Mathematics, Engineering & Computing
fundamentals for the solutions of Complex Engineering problems.
b.b. An ability to identify, formulates, research literature and analyze complex engineering
problems using first principles of mathematics and engineering sciences.
c.
c. An ability to design solutions to complex process or program to meet desired needs.
d.d. Ability to use research-based knowledge and research methods including design of
experiments to provide valid conclusions.
e.
e. An ability to use appropriate techniques, skills and tools necessary for computing practice.
f.f. Ability to apply reasoning informed by the contextual knowledge to assess social issues,
consequences & responsibilities relevant to the professional engineering practice.
g.g. Ability to understand the impact of engineering solutions in a global, economic,
environmental, and societal context with sustainability.
h.
h. An understanding of professional, ethical, Social issues and responsibilities.
i.i. An ability to function as an individual, and as a member or leader in diverse teams and in
multidisciplinary settings.
j.j. An ability to communicate effectively on complex engineering activities within the
engineering community.
k.k. Ability to demonstrate and understanding of the engineering and management principles
as a member and leader in a team.
l.l. Ability to engage in independent and lifelong learning in the context of technological
change.
DEPARTMENT OF ECE 6
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Basic simulation & Digital design lab will have a continuous evaluation during
4thsemester for 30 sessional marks and 70 end semester examination marks.
Out of the 30 marks for internal evaluation, day-to-day work in the laboratory shall be
evaluated for 15 marks and internal practical examination shall be evaluated for 15marks
conducted by the laboratory teacher concerned.
The end examination will be evaluated for a maximum of 70 marks. The end semester
examination shall be conducted with an external examiner and internal examiner. The
external examiner shall be appointed by the principal / Chief Controller of examinations
Course Objectives:
Course Outcomes:
Generate various signals and will be able to perform various operations on signals and
also classify the random process characteristics
Apply Laplace and Fourier transforms of a signal and also analyze its frequency response
Implements algebraic expressions using logic gates
Understand the combinational circuits like adder, subtractor, mux, decoder, and encoder
Design of flip flops & sequential circuits using flip flops
DEPARTMENT OF ECE 7
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
L T P C
0 0 3 1.5
Course Objectives:
Course Outcomes:
Generate various signals and will be able to perform various operations on signals and also
classify the random process characteristics
Apply Laplace and Fourier transforms of a signal and also analyze its frequency response
Implements algebraic expressions using logic gates
Understand the combinational circuits like adder, subtractor, mux, decoder, and encoder
Design of flip flops & sequential circuits using flip flops
List of Experiments:
Basic Simulation Lab:
1. Generation of Various Signals and Sequences (Periodic and Aperiodic).
2. Operations on Signals and Sequences such as Addition, Multiplication, Scaling, Shifting,
Folding, Computation of Energy and Average Power.
3. Convolution and for Correlation (ACF and CCF) Signals and sequences.
4. Verification of Linearity and Time Invariance Properties of a given Continuous/Discrete
System.
5. Computation of Unit sample, Unit step and Sinusoidal responses of the given LTI system.
6. Gibbs Phenomenon Simulation.
DEPARTMENT OF ECE 8
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
7. Finding the Fourier Transform of a given signal and plotting its magnitude and phase
spectrum.
8. Locating the Zeros and Poles and plotting the Pole-Zero maps in S-plane and Z-Plane for
the given transfer function.
9. Verification of Sampling Theorem.
10. Checking a Random Process for Stationary in Wide sense.
All the Basic Simulation Lab experiments are to be simulated using MATLAB/SCI LAB or
equivalent software.
Minimum of 14 experiments (7 from Basic Simulation and 7 from Digital System Design Lab)
are to be completed.
DEPARTMENT OF ECE 9
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 1
AIM: -To write a “MATLAB” Program to generate various signals and sequences, such as unit
impulse, unit step, unit ramp, sinusoidal, square, saw tooth, triangular, sinc signals.
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
One of the more useful functions in the study of linear systems is the "unit impulse function."
An ideal impulse function is a function that is zero everywhere but at the origin, where it is
infinitely high. However, the area of the impulse is finite. This is, at first hard to visualize but
we can do so by using the graphs shown below.
If b>a, then
Solution:
And
DEPARTMENT OF ECE 10
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
The unit step function and the impulse function are considered to be fundamental functions in
engineering, and it is strongly recommended that the reader becomes very familiar with both of
these functions.
The unit step function, also known as the Heaviside function, is defined as such:
DEPARTMENT OF ECE 11
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Sometimes, u(0) is given other values, usually either 0 or 1. For many applications, it is
irrelevant what the value at zero is. u(0) is generally written as undefined.
Derivative
The unit step function is level in all places except for a discontinuity at t = 0. For this reason, the
derivative of the unit step function is 0 at all points t, except where t = 0. Where t = 0, the
derivative of the unit step function is infinite.
The derivative of a unit step function is called an impulse function. The impulse function will
be described in more detail next.
Integral
DEPARTMENT OF ECE 12
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Sinc Function
And
Sinc(0)=1
Then, since cos(0) = 1, we can apply the Squeeze Theorem to show that the sinc function
approaches one as x goes to zero. Thus, defining sinc(0) to be 1 makes the sinc function
continuous.
Also, the Sinc function approaches zero as x goes towards infinity, with the envelope of sinc(x)
tapering off as 1/x.
Rect Function
The Rect Function is a function which produces a rectangular-shaped pulse with a width of 1
centered at t = 0. The Rect function pulse also has a height of 1. The Sinc function and the
rectangular function form a Fourier transform pair.
where the pulse is centered at X and has width Y. We can define the impulse function above in
terms of the rectangle function by centering the pulse at zero (X = 0), setting it's height to 1/A
and setting the pulse width to A, which approaches zero:
DEPARTMENT OF ECE 13
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
We can also construct a Rect function out of a pair of unit step functions
Here, both unit step functions are set a distance of Y/2 away from the center point of (t - X).
SAWTOOTH:-
The SAWTOOTH wave (or saw wave) is a kind of non-sinusoidal waveform. It is named a
SAWTOOTH based on its resemblance to the teeth on the blade of a saw. The convention is that
a SAWTOOTH wave ramps upward and then sharply drops. However, there are also
SAWTOOTH waves in which the wave ramps downward and then sharply rises. The latter type
of SAWTOOTH wave is called a 'reverse SAWTOOTH wave' or 'inverse SAWTOOTH wave'.
As audio signals, the two orientations of SAWTOOTH wave sound identical. The piecewise
linear function based on the floor function of time t, is an example of a SAWTOOTH wave with
period 1.
Triangle wave
DEPARTMENT OF ECE 14
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
The sine wave or sinusoid is a mathematical function that describes a smooth repetitive
oscillation. It occurs often in pure mathematics, as well as physics, signal processing, electrical
engineering and many other fields. Its most basic form as a function of time (t)is:
where:
•A, the amplitude, is the peak deviation of the function from its center position.
•ω, the angular frequency, specifies how many oscillations occur in a unit time
•φ, the phase, specifies where in its cycle the oscillation begins at t = 0.
Where f is the signal frequency, fs is the sampling frequency, θis the phase and A is the
amplitude of the signal.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clear all;
close all;
t=-10:1:10;
x=(t==0);
subplot(2,1,1);
plot(t,x,'g');
x label('time');
y label('amplitude');
DEPARTMENT OF ECE 15
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
subplot (2,1,2);
stem (t,x,'r');
xlabel('time');
ylabel('amplitude');
clc;
clear all;
close all;
N=100;
t=1:100;
x=ones(1,N);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
DEPARTMENT OF ECE 16
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
clc;
clear all;
close all;
t=0:20;
x=t;
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
%sinusoidal function%
clc;
clear all;
close all;
t=0:0.01:2;
x=sin(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
DEPARTMENT OF ECE 17
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinusoidal sequence');
%square function%
clc;
clear all;
close all;
t=0:0.01:2;
x=square(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('square signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('square sequence');
%sawtooth function%
clc;
clear all;
DEPARTMENT OF ECE 18
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sawtooth signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sawtooth sequence');
%trianguler function%
clc;
clear all;
close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t,0.5);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('trianguler signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
DEPARTMENT OF ECE 19
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
ylabel('amplitude');
title('trianguler sequence');
%sinc function%
clc;
clear all;
close all;
t=linspace(-5,5);
x=sinc(t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinc signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinc sequence')
DEPARTMENT OF ECE 20
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
OUTPUT:-
0.5
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
time
unit impulse discreat function
1
amplitude
0.5
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
time
1.5
amplitude
0.5
0
0 10 20 30 40 50 60 70 80 90 100
time
unit step discreat function
1
amplitude
0.5
0
0 10 20 30 40 50 60 70 80 90 100
time
DEPARTMENT OF ECE 21
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
15
amplitude
10
0
0 2 4 6 8 10 12 14 16 18 20
time
unit ramp discreat function
20
15
amplitude
10
0
0 2 4 6 8 10 12 14 16 18 20
time
sinusoidal function
DEPARTMENT OF ECE 22
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
square function
square signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
square sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
SAWTOOTH function
sawtooth signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sawtooth sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
DEPARTMENT OF ECE 23
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
trianguler function
trianguler signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
trianguler sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sinc function
sinc signal
1
amplitude
0.5
-0.5
-5 -4 -3 -2 -1 0 1 2 3 4 5
time
sinc sequence
1
amplitude
0.5
-0.5
-5 -4 -3 -2 -1 0 1 2 3 4 5
time
DEPARTMENT OF ECE 24
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
RESULT: Thus the Generation of continuous time signals like unit step, sawtooth,
by using MATLAB .
DEPARTMENT OF ECE 25
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
5. What is System?
13.Define Systems?
DEPARTMENT OF ECE 26
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
29.Write MATLAB command for left shift the signal to 8 times of the original signal
30Write MATLAB command for right shift the signal to 8 times of the original signal
32.Write MATLAB command for shift a positive time line signal to negative timeline signal
33.Write MATLAB command for shift a negative time line signal to positive timeline signal
34.Write MATLAB command for right shifting of a sequence to 8 times of the original signal
35.Write MATLAB command for left shifting of a sequence to 8 times of the original signal
49.The relation ship between unit step function and signum function?
EXERCISE QUESTIONS
DEPARTMENT OF ECE 27
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
6. Write a MATLAB program to generate a sine wave with amplitude = 3, frequency 20Hz.
7. Write a MATLAB program to generate a cos wave with amplitude = 3, frequency 20Hz.
8. Write a MATLAB program to generate a triangular wave with amplitude = 8, frequency
10Hz.
9. Write a MATLAB program to generate a square wave with amplitude = 2, frequency
10kHz.
10. Write a MATLAB program to generate the signum function.
11. Write a MATLAB program to generate exponential growing signal.
12. Write a MATLAB program to generate exponential decaying signal.
13. Write a MATLAB program to generate a triangular wave with amplitude = 6,frequency
1Hz.
14. Write a MATLAB program to generate a square wave with amplitude = 5, frequency
5kHz.
15. Write a MATLAB program to generate a SAWTOOTH wave with amplitude = 8,
frequency5Khz.
16. Write a MATLAB program to generate a sine wave with amplitude = 5, frequency 5Hz.
17. Write a MATLAB program to generate a cos wave with amplitude = 4, frequency 10Hz.
DEPARTMENT OF ECE 28
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
18. Write a MATLAB program to generate a triangular wave with amplitude = 5, frequency
4Hz.
19. Write a MATLAB program to generate a square wave with amplitude = 1, frequency
20kHz.
20. Write a MATLAB program to generate the signum function.
21. Write a MATLAB program to generate a square wave with amplitude = 4, frequency
5kHz.
22. Write a MATLAB program to generate a triangular wave with amplitude = 6, frequency
6Hz.
23. Write a MATLAB program to generate a triangular wave with amplitude = 8,frequency
2Hz.
24. Write a MATLAB program to generate a square wave with amplitude = 7, frequency
5kHz.
25. Write a MATLAB program to generate a SAWTOOTH wave with amplitude =10,
frequency 10Khz.
DEPARTMENT OF ECE 29
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 2
OPERATIONS ON SIGNALS&SEQUENCES
AIM:-
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2. Windows XP SP2.
THEORY:-
Time shifting: y(t)=x(t-T)The effect that a time shift has on the appearance of a signal
If T is a positive number, the time shifted signal, x (t -T ) gets shifted to the right, otherwise it
gets shifted left.
Time reversal: Y(t)=y(-t) Time reversal _ips the signal about t = 0 as seen in
DEPARTMENT OF ECE 30
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Figure 1.
Signal Amplification/Attuation:
Multiplication/Division:
DEPARTMENT OF ECE 31
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Folding:
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
t=0:0.001:2;
s1=6*sin(2*pi*5*t);
subplot(4,1,1);
plot(t,s1,'g');
xlabel('time');
ylabel('amplitude');
title('first signal');
s2=8*sin(2*pi*5*t);
subplot(4,1,2);
plot(t,s2,'r');
xlabel('time');
ylabel('amplitude');
title('second signal');
DEPARTMENT OF ECE 32
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
s3=s1+s2;
subplot(4,1,3);
plot(t,s3,'g');
xlabel('time');
ylabel('amplitude');
s4=s1.*s2;
subplot(4,1,4);
plot(t,s4,'g');
xlabel('time');
ylabel('amplitude');
clc;
clear all;
close all;
t=0:0.001:2;
s1=6*sin(2*pi*5*t);
subplot(3,1,1);
plot(t,s1,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
s2=3*s1;
subplot(3,1,2);
plot(t,s2,'r');
xlabel('time');
ylabel('amplitude');
DEPARTMENT OF ECE 33
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
title('amplified signal');
s3=s1/3;
subplot(3,1,3);
plot(t,s3,'g');
xlabel('time');
ylabel('amplitude');
title('attenuated signal');
clc;
clear all;
close all;
t=0:0.001:2;
s1=6*sin(2*pi*5*t);
subplot(3,1,1);
plot(t,s1,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
t1=3*t;
subplot(3,1,2);
plot(t1,s1,'r');
xlabel('time');
ylabel('amplitude');
title('compressed signal');
t2=t/3;
subplot(3,1,3);
plot(t2,s1,'g');
DEPARTMENT OF ECE 34
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
xlabel('time');
ylabel('amplitude');
title('enlarged signal');
clc;
clear all;
close all;
t=0:0.001:3;
s1=6*sin(2*pi*5*t);
subplot(3,1,1);
plot(t,s1,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
t1=t+10;
subplot(3,1,2);
plot(t1,s1,'r');
xlabel('time');
ylabel('amplitude');
t2=t-10;
subplot(3,1,3);
plot(t2,s1,'g');
xlabel('time');
ylabel('amplitude');
clc;
DEPARTMENT OF ECE 35
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
clear all;
close all;
t=0:0.001:2;
s=sin(2*pi*5*t);
m=length(s);
n=[-m:m];
y=[0,zeros(1,m),s];
subplot(2,1,1);
plot(n,y,'g');
xlabel('time');
ylabel('amplitude');
title('original signal');
y1=[fliplr(s),0,zeros(1,m)];
subplot(2,1,2);
plot(n,y1,'r');
xlabel('time');
ylabel('amplitude');
title('folded signal');
OUTPUT:-
DEPARTMENT OF ECE 36
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
first signal
amplitude
10
0
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
second signal
amplitude
10
0
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sum of two signals
amplitude
20
0
-20
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
multiplication of two signals
amplitude
50
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sinusoidal signal
10
amplitude
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
amplified signal
20
amplitude
-20
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
attenuated signal
2
amplitude
-2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
DEPARTMENT OF ECE 37
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
sinusoidal signal
10
amplitude
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
compressed signal
10
amplitude
-10
0 1 2 3 4 5 6
time
enlarged signal
10
amplitude
-10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
time
sinusoidal signal
10
amplitude
-10
0 0.5 1 1.5 2 2.5 3
time
right shift of the signal
10
amplitude
-10
10 10.5 11 11.5 12 12.5 13
time
left shift of the signal
10
amplitude
-10
-10 -9.5 -9 -8.5 -8 -7.5 -7
time
DEPARTMENT OF ECE 38
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
original signal
1
0.5
amplitude
0
-0.5
-1
-2500 -2000 -1500 -1000 -500 0 500 1000 1500 2000 2500
time
folded signal
1
0.5
amplitude
-0.5
-1
-2500 -2000 -1500 -1000 -500 0 500 1000 1500 2000 2500
time
RESULT:-
In this experiment the various oprations on signals have been Performed Using MATLAB have
been demonstrated.
DEPARTMENT OF ECE 39
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
5. What is System?
13.Define Systems?
DEPARTMENT OF ECE 40
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
29.Write MATLAB command for left shift the signal to 8 times of the original signal
30Write MATLAB command for right shift the signal to 8 times of the original signal
32.Write MATLAB command for shift a positive time line signal to negative timeline signal
33.Write MATLAB command for shift a negative time line signal to positive timeline signal
34.Write MATLAB command for right shifting of a sequence to 8 times of the original signal
35.Write MATLAB command for left shifting of a sequence to 8 times of the original signal
DEPARTMENT OF ECE 41
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAMS
4. Write a MATLAB program to right shift the signal to 5 times of the original signal.
5. Write a MATLAB program to left shift the signal to 8 times of the original signal.
7. Write a MATLAB program to shift a positive time line signal to negative timeline signal.
10. Write a MATLAB program to division and multiply two co-sinusoidal signals.
14. Write a MATLAB program to generate amplitude scaling of a sequence with amplitude 5.
15. Write a MATLAB program to generate time scaling of a sequence with time 2sec.
16. Write a MATLAB program to add two different signals with 4 <t<8
17. Write a MATLAB program to shift a negative time line signal to positive timeline signal.
19. Write a MATLAB program to subtract and divide two sinusoidal signals
20. Write a MATLAB program to add and multiply two co-sinusoidal signals.
Stream processing
Block processing
Vector processing
DEPARTMENT OF ECE 42
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 3
To find the output with linear convolution operation and compute auto correlation and cross
correlation between signals and Sequences using MATLAB Software
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
1. Folding
2. Multiplication
3. Addition
4. Shifting
DEPARTMENT OF ECE 43
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
In Signal processing, When the autocorrelation function is normalized by mean and variance, it
is sometimes referred to as the autocorrelation coefficient. Given a signal f(t), the continuous
auto correlation Rff(T) is most often defined as the continuous cross-correlation integral of
f(t)with itself, at lag T
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
DEPARTMENT OF ECE 44
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROGRAM:-
clc;
clear all;
close all;
t=0:0.001:10;
x=sin(t);
h=square(t);
subplot(3,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(3,1,2);
plot(t,h,'r');
xlabel('time');
ylabel('amplitude');
title('square function');
y=conv(x,h);
subplot(3,1,3);
plot(y);
xlabel('time');
ylabel('amplitude');
title('convolution signal');
DEPARTMENT OF ECE 45
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
clear all;
close all;
N=0:(L+M-1);
y=conv(x,h);
subplot(3,1,1);
stem(x,'g');
xlabel('discrete time');
ylabel('x(n)');
title('1st sequence');
subplot(3,1,2);
stem(h,'r');
xlabel('discrete time');
ylabel('h(n)');
title('second sequence');
subplot(3,1,3);
stem(y);
xlabel('discrete time');
ylabel('y(n)');
DEPARTMENT OF ECE 46
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROGRAM:-
clc;
clear all;
close all;
t=0:0.001:1;
x=cos(2*pi*3*t);
a=xcorr(x);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('input signal');
subplot(2,1,2);
plot(a,'r');
xlabel('time');
ylabel('amplitude');
clc;
clear all;
close all;
t=0:0.001:1;
x=cos(2*pi*3*t);
y=cos(2*pi*5*t);
a=xcorr(x,y);
subplot(3,1,1);
plot(t,x,'g');
DEPARTMENT OF ECE 47
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
xlabel('time');
ylabel('amplitude');
title('1st signal');
subplot(3,1,2);
plot(t,y,'r');
xlabel('time');
ylabel('amplitude');
title('2nd signal');
subplot(3,1,3);
plot(a,'r');
xlabel('time');
ylabel('amplitude');
clc;
clear all;
close all;
a=xcorr(x);
subplot(2,1,1);
stem(x,'g');
xlabel('time');
ylabel('amplitude');
title('input sequence');
subplot(2,1,2);
stem(a,'r');
xlabel('time');
ylabel('amplitude');
DEPARTMENT OF ECE 48
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
clc;
clear all;
close all;
a=xcorr(x,y);
subplot(3,1,1);
stem(x,'g');
xlabel('time');
ylabel('amplitude');
title('1st sequence');
subplot(3,1,2);
stem(y,'r');
xlabel('time');
ylabel('amplitude');
title('2nd sequence');
subplot(3,1,3);
stem(a,'r');
xlabel('time');
ylabel('amplitude');
DEPARTMENT OF ECE 49
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
OUTPUT:-
sinusoidal signal
1
amplitude
-1
0 1 2 3 4 5 6 7 8 9 10
time
square function
1
amplitude
-1
0 1 2 3 4 5 6 7 8 9 10
time
4
x 10 convolution signal
1
amplitude
-1
0 0.5 1 1.5 2 2.5
time 4
x 10
DEPARTMENT OF ECE 50
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
1st sequence
4
x(n) 2
0
1 1.5 2 2.5 3 3.5 4
discrete time
second sequence
4
h(n)
0
1 1.5 2 2.5 3 3.5 4
discrete time
convolution of two sequences
40
y(n)
20
0
1 2 3 4 5 6 7
discrete time
OUTPUT:-
input signal
1
0.5
amplitude
-0.5
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
auto correlation signal
1000
amplitude
500
-500
0 500 1000 1500 2000 2500
time
DEPARTMENT OF ECE 51
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
1st signal
1
amplitude
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
2nd signal
1
amplitude
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
cross correlation signal
100
amplitude
-100
0 500 1000 1500 2000 2500
time
x= 1 2 3 4
DEPARTMENT OF ECE 52
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
input sequence
4
amplitude 3
0
1 1.5 2 2.5 3 3.5 4
time
auto correlation sequence
30
amplitude
20
10
0
1 2 3 4 5 6 7
time
1st sequence
4
amplitude
0
1 1.5 2 2.5 3 3.5 4
time
2nd sequence
4
amplitude
0
1 1.5 2 2.5 3 3.5 4
time
cross correlation sequence
40
amplitude
20
0
1 2 3 4 5 6 7
time
RESULT:-
In this experiment output with linear convolution operation and compute auto correlation and
cross correlation between signals and Sequences have been performed Using MATLAB .
DEPARTMENT OF ECE 53
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
1. Define Convolution?
11.What is Correlation?
DEPARTMENT OF ECE 54
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
DEPARTMENT OF ECE 55
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAMS
1.Write the MATLAB program to perform convolution between the following sequences
2. Write a mat lab program to perform the convolution between sinusoidal and ramp function and
see how mat lab reacts to it.
3. Write a MATLAB program to perform convolution between square and step signal and see
how mat lab reacts to it.
4. Write a MATLAB program to perform convolution between sinusoidal and ramp signal and
see how mat lab reacts to it.
5. Write a MATLAB program to perform the convolution between X (n) = [1 2 3 5] and y (n) =
[- 1 – 2] and see how MATLAB reacts to it.
6. Write a MATLAB program to perform the convolution between X (n) = [1 -3 5] and y (n) =
[1 2 3 4] and see how MATLAB reacts to it.
7. Write a MATLAB program to perform the convolution between X (n) = [1 0 1 1] and y (n) =
[1 0 0 0 0] and see how MATLAB reacts to it.
9.Write a MATLAB program to perform the convolution between X (n) = [1 1 0 0] and y (n) =
[1 1 1 1] and see how MATLAB reacts to it.
10.Write a MATLAB program to perform the convolution between X (n) = [6 7 8 9 10] and y
(n) = [5 4 3 2 1] and see how MATLAB reacts to it.
11.Write the MATLAB program to perform convolution between the following sequences
12. Write a mat lab program to perform the convolution between step and ramp function and see
how mat lab reacts to it.
13. Write a MATLAB program to perform convolution between square and step signal and see
how mat lab reacts to it.
14. Write a MATLAB program to perform convolution between sinusoidal and square signal
and see how mat lab reacts to it.
15. Write a MATLAB program to perform the convolution between X (n) = [234 5] and y (n) =
[-2 –4] and see how MATLAB reacts to it.
DEPARTMENT OF ECE 56
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
16. Write a MATLAB program to perform the convolution between X (n) = [3 -46] and y (n) =
[2686] and see how MATLAB reacts to it.
17. Write a MATLAB program to perform the convolution between X (n) = [3120] and y (n) =
[2434 5] and see how MATLAB reacts to it.
18.Write a MATLAB program to perform the convolution between X (n) = [22 1 0211 0] and y
(n) = [1 1 1 2 1 0 1 0] and see how MATLAB reacts to it.
19.Write a MATLAB program to perform the convolution between X (n) = [2 1 21] and y (n) =
[1 2 1 2] and see how MATLAB reacts to it.
20.Write a MATLAB program to perform the convolution between X (n) = [56987] and y (n) =
[12 3 2 1] and see how MATLAB reacts to it.
21.Write the MATLAB program to perform convolution between the following sequences
22. Write a mat lab program to perform the convolution between ramp and step function and see
how mat lab reacts to it.
23. Write a MATLAB program to perform convolution between square and step signal and see
how mat lab reacts to it.
24. Write a MATLAB program to perform convolution between sinusoidal and step signal and
see how mat lab reacts to it.
25. Write a MATLAB program to perform the convolution between X (n) = [1 5 6 5] and y (n) =
[-3 –6] and see how MATLAB reacts to it.
2. Correlation is used to extract second (and higher) order statistics from any random
signal.
DEPARTMENT OF ECE 57
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 4
System.
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
LINEARITY PROPERTY
DEPARTMENT OF ECE 58
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%Program1:%
clc;
clear all;
close all;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=a*x1+b*x2;
y=n.*x;
y1=n.*x1;
DEPARTMENT OF ECE 59
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
y2=n.*x2;
yt=a*y1+b*y2;
d=y-yt;
d=round(d)
if d
else
end
subplot(3,1,1), stem(n,y);
grid;
subplot(3,1,2), stem(n,yt);
grid;
subplot(3,1,3), stem(n,d);
grid;
%Program2:%
clc;
clear all;
close all;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=a*x1+b*x2;
y=x.^2;
y1=x1.^2;
y2=x2.^2;
yt=a*y1+b*y2;
DEPARTMENT OF ECE 60
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
d=y-yt;
d=round(d);
if d
else
end
subplot(3,1,1), stem(n,y);
grid;
subplot(3,1,2), stem(n,yt);
grid;
subplot(3,1,3), stem(n,d);
grid;
%Program3:%
clc;
close all;
clear all;
n=0:40;
D=10;
x=3*cos(2*pi*0.1*n)-2*cos(2*pi*0.4*n);
xd=[zeros(1,D) x];
y=n.*xd(n+D);
n1=n+D;
yd=n1.*x;
d=y-yd;
if
else
DEPARTMENT OF ECE 61
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
end
subplot(3,1,1),stem(y),grid;
subplot(3,1,2),stem(yd),grid;
subplot(3,1,3),stem(d),grid;
OUTPUT:-
Program1:
DEPARTMENT OF ECE 62
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Program2:
Program3:
DEPARTMENT OF ECE 63
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS :
1. Define Systems?
13.Locate DFT ?
DEPARTMENT OF ECE 64
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
35.How to obtain The output Sequence of Linear Convolution through Circular Convolution?
44.Define Systems?
50.Define Systems?
DEPARTMENT OF ECE 65
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXCERCISE QUESTIONS
1.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the linearity
property or not.
2.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the linearity
property or not
3.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the linearity property
or not
4.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not.
5.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not
6.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the time
invariance property or not.
7.Write a MATLAB program to verify the time variance property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the time
invariance property or not.
8.Write a MATLAB program to verify the non linearity property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the
linearity property or not
9.Write a MATLAB program to verify the time variance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not.
10.Write a MATLAB program to verify the non linearity property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the
linearity property or not.
11.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the linearity
property or not.
12.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the linearity
property or not
DEPARTMENT OF ECE 66
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
13.Write a MATLAB program to verify the linearity property of the following sequency
x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the linearity property
or not
14.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not.
15.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not
16.Write a MATLAB program to verify the time invariance property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the time
invariance property or not.
17.Write a MATLAB program to verify the time variance property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the time
invariance property or not.
18.Write a MATLAB program to verify the non linearity property of the following
sequency x1= sin(2*pi*0.1*n); cos(2*pi*0.3*n),and chech whether it satisfies the
linearity property or not
19.Write a MATLAB program to verify the time variance property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the time
invariance property or not.
20.Write a MATLAB program to verify the non linearity property of the following
sequency x1= sin(2*pi*1*n);x2= sin(2*pi*2*n), and chech whether it satisfies the
linearity property or not
DEPARTMENT OF ECE 67
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 5
PROPERTIES
AIM: -
To Unit Step And Sinusoidal Response Of The Given LTI System And Verifying
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
criteria to produce a modified output signal. The input signal x(n) is the system
excitation, and y(n) is the system response. The transform operation is shown as,
If the input to the system is unit impulse i.e. x(n) = δ(n) then the output of the system is
h(n) = T[δ(n)]
DEPARTMENT OF ECE 68
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
we know that any arbitrary sequence x(n) can be represented as a weighted sum of
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clear all;
close all;
b=[1];
a=[1,-1,.9];
DEPARTMENT OF ECE 69
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
x=impseq(0,-20,120);
n = [-20:120];
h=filter(b,a,x);
subplot(3,1,1);stem(n,h);
title('impulse response');
xlabel('n');ylabel('h(n)');
=stepseq(0,-20,120);
s=filter(b,a,x);
s=filter(b,a,x);
subplot(3,1,2);
stem(n,s);
title('step response');
xlabel('n');ylabel('s(n)')
t=0:0.1:2*pi;
x1=sin(t);
%impseq(0,-20,120);
n = [-20:120];
h=filter(b,a,x1);
subplot(3,1,3);stem(h);
title('sin response');
xlabel('n');ylabel('h(n)');
figure;
zplane(b,a);
OUTPUT:-
DEPARTMENT OF ECE 70
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
DEPARTMENT OF ECE 71
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
RESULT:-
In this experiment computation of unit sample, unit step andsinusoidal response of the given LTI
system and verifying its physical realizabilityandstability properties Using MATLAB .
DEPARTMENT OF ECE 72
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
2.State causality?
6.Define stability?
20.Memorize stability?
21.State Reliability?
24.What are the classification of the System based on Unit Sample Response?
DEPARTMENT OF ECE 73
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
DEPARTMENT OF ECE 74
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAM:-
4. Write a MATLAB program for generating u(n)+u(n-1) and verify how MATLAB reacts to it.
5. write a MATLAB program to find the energy & power of the signal x(t)=10sin(10t).
6. write a MATLAB program to find the even & odd of the signal x(t)=e^2t.
7. write a MATLAB program to find the even & odd of the signal x(t)=sin(t).
8. write a MATLAB program to find the even & odd of the signal x(t)=cos(t).
9. write a MATLAB program to find the energy & power of the signal x(t)=sin(t).
10. write a MATLAB program to find the energy & power of the signal x(t)=e^2t.
12. Write a MATLAB program for generating delayed step response with magnitude 2
13.Write a MATLAB program for generating delayed impulse response with magnitude
14. Write a MATLAB program for generating u(n+1)+u(n-1) and verify how MATLAB reacts
to it.
15. Write a MATLAB program to find the energy & power of the signal x(t)=20sin(5t).
16. Write a MATLAB program to find the even & odd of the signal x(t)=e^3t.
17. Write a MATLAB program to find the even & odd of the signal x(t)=sin(t)+cos(t).
18. Write a MATLAB program to find the even & odd of the signal x(t)=cos(t)-sin(t).
19. Write a MATLAB program to find the energy & power of the signal x(t)=sin(t)-cos(t).
20. Write a MATLAB program to find the energy & power of the signal x(t)=e^4t.
22. Write a MATLAB program for generating delayed unit step response
24. Write a MATLAB program for generating u(n-3)+u(n-1) and verify how MATLAB reacts
to it.
25. Write a MATLAB program to find the energy & power of the signal x(t)=5sin(20t).
DEPARTMENT OF ECE 75
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
DEPARTMENT OF ECE 76
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 6
AIM: -
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
Gibbs Phenomenon:
The peculiar manner in which the Fourier series of a piecewise continuously differentiable
periodic function behaves at a jump discontinuity: the nth partial sum of the Fourier series
has large oscillations near the jump, which might increase the maximum of the partial sum
above that of the function itself. The overshoot does not die out as the frequency increases,
The Gibbs phenomenon involves both the fact that Fourier sums overshoot at a jump
discontinuity, and that this overshoot does not die out as the frequency increases.
The best known version of the Gibbs phenomenon is the overshoot that arises when a
discontinuous
function is represented by a truncated set of Fourier expansion terms. The situation is similar if
the
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
DEPARTMENT OF ECE 77
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROGRAM:-
%Gibbs phenomenon%
clc;
clear all;
close all;
t=0:0.01:1;
N=input('enter no of harmonics');
x=square(2*pi*t);
plot(t,x);
hold on;
gp=0;
for n=1:2:N;
gp=gp+(4/(n*pi))*sin(2*pi*n*t);
end;
plot(t,gp);
hold off;
xlabel('time');
ylabel('amplitude');
title('gibbs phenomenon');
OUTPUT:-
Gibbs phenomenon
enter no of harmonics 5
DEPARTMENT OF ECE 78
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
gibbs phenomenon
1.5
0.5
amplitude
-0.5
-1
-1.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
RESULT:-
DEPARTMENT OF ECE 79
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAM:-
2. Write a mat lab program to perform the convolution between sinusoidal and ramp
3. Write a MATLAB program to perform convolution between square and step signal
12. Write a mat lab program to perform the convolution between step and ramp function and see
how mat lab reacts to it.
13. Write a MATLAB program to perform convolution between sinusoidal and step
DEPARTMENT OF ECE 80
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
14. Write a MATLAB program to perform convolution between impulse and ramp
15. Write a MATLAB program to perform the convolution between X (n) = [32 6 9]
and y (n) = [-2 –4] and see how MATLAB reacts to it.
16. Write a MATLAB program to perform the convolution between X (n) = [2 -42 5]
19.Write a MATLAB program to perform the convolution between X (n) = [22 0 2] and
20. Write a MATLAB program to perform the convolution between X (n) = [214 5 3]
and y (n) = [21 6 21] and see how MATLAB reacts to it.
22. Write a mat lab program to perform the convolution between sinusoidal and ramp
23. Write a MATLAB program to perform convolution between square and step signal
24. Write a MATLAB program to perform convolution between sinusoidal and ramp
DEPARTMENT OF ECE 81
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
6. Define Noise?
25.State Equations Used to Convert the Fir Filter Coefficients to Lattice Filter
Coefficient.
DEPARTMENT OF ECE 82
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
36.What is Cross-correlation ?
DEPARTMENT OF ECE 83
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 7
To obtain Fourier Transform and Inverse Fourier Transform of a given signal / sequence and to
plot its Magnitude and Phase Spectra.
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
We may use Fourier series to motivate the Fourier transform as follows. Suppose that ƒ is
a function which is zero outside of some interval [−L/2, L/2]. Then for any T ≥L we may
expand ƒ in a Fourier series on the interval [−T/2,T/2], where the "amount" of the wave
By definition
DEPARTMENT OF ECE 84
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
The fast Fourier transform (FFT) is an efficient algorithm for computing the DFT of a
sequence; it is not a separate transform. It is particularly useful in areas such as signal and
image processing, where its uses range from filtering, convolution, and frequency analysis to
For length N input vector x, the DFT is a length N vector X, with elements
n=1
k=1
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%Fourier Transform%
clc
clear all;
close all;
syms t;
x=exp(-2*t)*heaviside(t);
y=fourier(x);
DEPARTMENT OF ECE 85
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
z=ifourier(y);
mg=abs(y);
subplot(2,1,1);
ezplot(mg);
xlabel('time');
ylabel('amplitude');
grid;
pha=atan(imag(y)/real(y));
subplot(2,1,2);
ezplot(pha);
xlabel('time');
ylabel('amplitude');
grid;
OUTPUT:-
Fourier Transform
Y=
1/(2+w*i)
Z=
Heaviside(x)/exp(2*x)
DEPARTMENT OF ECE 86
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
0.5
0.4
amplitude
0.3
0.2
-6 -4 -2 0 2 4 6
time
phasespectrum of a input signal
1
amplitude
-1
-6 -4 -2 0 2 4 6
time
RESULT:-
In this experiment the fourier transform of a given signal and plotting its magnitude and phase
spectrum have been demonstrated using MATLAB .
DEPARTMENT OF ECE 87
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
7.what is plot?
8.what is stem?
11.what is subplot?
24.what is subplot?
DEPARTMENT OF ECE 88
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
45.what is clc?
46.applications of BS LAB?
50.what is system
DEPARTMENT OF ECE 89
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAMS
12. Write a MATLAB program to find F.T of the causal signal x(t)=at
15. Write a MATLAB program to find F.T of the causal signalx(t)=impulse function
16. Write a MATLAB program to find F.T of the causal signalx(t)=Delta function
DEPARTMENT OF ECE 90
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 8
TRANSFER FUNCTION.
AIM: -
To locating the zeros and poles and plotting the pole zero maps in s-plane and z-plane
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
A Transfer Function is the ratio of the output of a system to the input of a system, in the Laplace
domain considering its initial conditions to be zero. If we have an input function of X(s), and an
output function Y(s), we define the transfer function H(s) to be:
Given a continuous-time transfer function in the Laplace domain, H(s) or a discrete-time one
in the Z-domain, H(z), a zero is any value of s or z such that the transfer function is zero, and
DEPARTMENT OF ECE 91
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
Zeros:1. The value(s) for z where the numerator of the transfer function equals zero
2. The complex frequencies that make the overall gain of the filter transfer function
zero.
Poles: 1. The value(s) for z where the denominator of the transfer function equals zero
2. The complex frequencies that make the overall gain of the filter transfer functioninfinite.
Z-transforms
transform.
Bilateral Z-transform
The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z)
defined as
Unilateral Z-transform
Alternatively, in cases where x[n] is defined only for n ≥ 0, the single-sided or unilateral
Z-transform is defined as
DEPARTMENT OF ECE 92
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
h=tf(num,den);
poles=roots(den);
zeros=roots(num);
sgrid;
pzmap(h);
grid on;
DEPARTMENT OF ECE 93
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
clc;
clear all;
close all;
p=roots(den);
z=roots(num);
zplane(p,z);
grid;
OUTPUT:-
1.5 1.4
0.5 0.36 0.27 0.19 0.12 0.06
1.2
0.66
1
1
0.8
0.6
0.5 0.88
0.4
0.2
0.2
-0.5 0.4
0.88
0.6
0.8
-1
1
0.66
1.2
0.5 0.36 0.27 0.19 0.12 0.06
-1.5 1.4
-1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0
DEPARTMENT OF ECE 94
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
0.5
Imaginary Part
-0.5
-1
-1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Real Part
RESULT:-
In this experiment the zeros and poles and plotting the pole zero
using MATLAB .
DEPARTMENT OF ECE 95
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
VIVA QUESTIONS:-
6.bilateral z-transform
7.z-transforms
8.unilateral z-transforms
9.what is pole?
10.what is zero?
11.what is splane?
12.what is zplane?
14.what is subplot?
15.what is subplot(4,5,6)?
16.define s plane?
17.define z plane?
19.what is plot?
20.what is stem?
25.what os signal?
DEPARTMENT OF ECE 96
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
34.what is plot?
35.what is stem?
38.what is system?
39.what is signal?
41.application of convolution?
44.define laplace-transform?
49.Define i.l.t?
DEPARTMENT OF ECE 97
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXERCISE PROGRAMS
1.Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
2. Write a MATLAB program to find the impulse response of the following difference
equation 6y(n)-9y(n-1)-4y(n-2)=x(n)-5x(n-1).
3. Write a MATLAB program to find the impulse response of the following difference
equation8y(n)-6y(n-1)+4y(n-2)=x(n)+2x(n-1).
4. Write a MATLAB program to find the impulse response of the following difference
equation 3y(n)+5y(n-1)+9y(n-2)=x(n)-9x(n-1).
5. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
6. Write a MATLAB program to find the impulse response of the following difference
equation7y(n)-5y(n-1)+4y(n-2)=x(n)-9x(n-1).
7.Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=x(n)-6x(n-1).
8.Write a MATLAB program to find the impulse response of the following difference
equation 5y(n)-5y(n-1)+5y(n-2)=x(n)-2x(n-1).
9.Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-6 y(n-1)+4y(n-2)=x(n)-7x(n-1).
10.Write a MATLAB program to find the impulse response of the following difference
equation2y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
11.Write a MATLAB program to find the impulse response of the following difference
equation 3y(n)-5y(n-1)+4y(n-2)=5x(n)-6x(n-1).
12. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-8y(n-1)-4y(n-2)=7x(n)-5x(n-1).
13. Write a MATLAB program to find the impulse response of the following difference
equation8y(n)-8y(n-1)+9y(n-2)=x(n)+5x(n-1).
14. Write a MATLAB program to find the impulse response of the following difference
DEPARTMENT OF ECE 98
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
equation 3y(n)+9y(n-1)+9y(n-2)=9x(n)-5x(n-1).
15. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-5y(n-1)+4y(n-2)=7x(n)-2x(n-1).
16. Write a MATLAB program to find the impulse response of the following difference
equation 7y(n)-5y(n-1)+4y(n-2)=x(n)-7x(n-1).
17. Write a MATLAB program to find the impulse response of the following difference
equation 3y(n)-5y(n-1)+4y(n-2)=x(n)-6x(n-1).
18. Write a MATLAB program to find the impulse response of the following difference
equation 5y(n)-5y(n-1)+5y(n-2)=7x(n)-2x(n-1).
19. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-6 y(n-1)+4y(n-2)=4x(n)-x(n-1).
20. Write a MATLAB program to find the impulse response of the following difference
equation2y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
DEPARTMENT OF ECE 99
BASIC SIMULATION & DIGITAL SYSTEM DESIGN LAB
EXPERMENT NO: 9
SAMPLING THEORM
AIM: -
SOFTWARE REQURIED:-
1. MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
Sampling Theorem:
The theorem shows that a band limited analog signal that has been sampled can be perfectly
reconstructed from an infinite sequence of samples if the sampling rate exceeds 2B samples
If a signal contains a component at exactly B hertz, then samples spaced at exactly 1/(2B)
(wm = 2πfm).
Let gs(t) be the sampled signal. Its Fourier Transform Gs(w) isgiven by
Scale it by T.
Aliasing
{ Aliasing is a phenomenon where the high frequency components of the sampled signalinterfere
with each other because of inadequate sampling ws < 2wm.
Aliasing leads to distortion in recovered signal. This is the reason why sampling frequency
should be at least twice the bandwidth of the signal.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
%sampling theorem%
clc;
clear all;
close all;
t=0:0.001:1;
f=5;
x=cos(2*pi*f*t);
plot(t,x);
%when fs>2fm%
fs1=3*f;
ts1=1/fs1;
n1=0:ts1:1;
xs1=cos(2*pi*f*n1);
figure;
plot(n1,xs1,'r');
hold on;
plot(t,x);
hold off;
%when fs=2fm%
fs2=2*f;
ts2=1/fs2;
n2=0:ts2:1;
xs2=cos(2*pi*f*n2);
figure;
plot(n2,xs2,'r');
hold on;
plot(t,x);
hold off;
%when fs<2fm%
fs3=1.5*f;
ts3=1/fs3;
n3=0:ts3:1;
xs3=cos(2*pi*f*n3);
figure;
plot(n3,xs3,'r');
hold on;
plot(t,x);
hold off;
OUTPUT:-
Sampling
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
theorem
when fs>2fm
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
when fs=2fm
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
when fs<2fm
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
RESULT:-
In this experiment the sampling theorem have been verified using MATLAB .
VIVA QUESTIONS:-
Sampling Theorem
EXERCISE PROGRAM:-
3. Write a MATLAB program to find the effect of up sampling in frequency domain for 20khz.
X(t) = 1; (0<t<2)
6.Write a MATLAB program to generate a sine wave with amplitude = 3, frequency 20Hz.
7.Write a MATLAB program to generate a cos wave with amplitude = 3, frequency 20Hz.
9.Write a MATLAB program to generate a square wave with amplitude = 2, frequency 10kHz.
1Hz.
5kHz.
frequency5Khz.
16.Write a MATLAB program to generate a sine wave with amplitude = 5, frequency 5Hz.
10Hz.
4Hz.
20kHz.
5kHz.
6Hz.
2Hz.
5kHz.
25.Write a MATLAB program to generate a SAWTOOTH wave with amplitude =10, frequency
10Khz.
EXPERMENT NO: 10
AIM: -
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
The first property implies that the mean function mx(t) must be constant. The second property
implies that thecorrelation function depends only on the difference between t1 and t2 and only
needs to be indexed by onevariable rather than two variables. Thus, instead of writing,
This also implies that the auto covariance depends only on _ = t1 − t2, since
A random X(t) is stationary if its statistical properties are unchanged by a time shift in the time
origin.Whenthe auto-Correlation function Rx(t,t+T) of the random X(t) varies with time
difference T and the mean valueof the random variable X(t1) is independent of the choicet1,then
X(t) is said to be stationary in the widesenseor wide-sense stationary . So a continuous- Time
random process X(t) which is WSS has the following properties
1) E[X(t)]=μX(t)= μX(t+T)
RX(t, t+T)=Rx(T)
If the statistical properties like mean value or moments depends on time then the random process
is saidto be non-stationary.
When dealing with two random process X(t) and Y(t), we say that they are jointly wide-sense
stationary if each process is stationary in the wide-sense.
Rxy(t,t+T)=E[X(t)Y(t+T)]=Rxy(T).
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
Clc;
Close all;
clear all
y = randn([1 40])
my=round(mean(y));
z=randn([1 40])
mz=round(mean(z));
vy=round(var(y));
vz=round(var(z));
t = sym('t','real');
h0=3;
x=y.*sin(h0*t)+z.*cos(h0*t);
mx=round(mean(x));
k=2;
xk=y.*sin(h0*(t+k))+z.*cos(h0*(t+k));
x1=sin(h0*t)*sin(h0*(t+k));
x2=cos(h0*t)*cos(h0*(t+k));
c=vy*x1+vz*x1;
OUTPUT:-
RESULT:-
VIVA QUESTIONS:-
EXERCISE PROGRAMS
2. Write a mat lab program to perform the cross correlation between sinusoidal and ramp
function and see how mat lab reacts to it.
3. Write a MATLAB program to perform cross correlation between square and step signal and
see how mat lab reacts to it.
4. Write a MATLAB program to perform cross correlation between sinusoidal and ramp signal
and see how mat lab reacts to it.
5. Write a MATLAB program to perform the cross correlation between X (n) = [1 2 3 5] and y
(n) = [- 1 – 2] and see how MATLAB reacts to it.
6. Write a MATLAB program to perform the cross correlation between X (n) = [1 -3 5] and y
(n) = [1 2 3 4] and see how MATLAB reacts to it.
7. Write a MATLAB program to perform the cross correlation between X (n) = [1 0 1 1] and y
(n) = [1 0 0 0 0] and see how MATLAB reacts to it.
9.Write a MATLAB program to perform the cross correlation between X (n) = [1 1 0 0] and y
(n) = [1 1 1 1] and see how MATLAB reacts to it.
10.Write a MATLAB program to perform the cross correlation between X (n) = [6 7 8 9 10] and
y (n) = [5 4 3 2 1] and see how MATLAB reacts to it.
11.Write the MATLAB program to perform cross correlation between the following sequences
12. Write a mat lab program to perform the convolution between step and ramp function and see
how mat lab reacts to it.
13. Write a MATLAB program to perform convolution between square and step signal and see
how mat lab reacts to it.
14. Write a MATLAB program to perform convolution between sinusoidal and square signal
and see how mat lab reacts to it.
15. Write a MATLAB program to perform the convolution between X (n) = [2 3 4 5] and y (n) =
[-2 –4] and see how MATLAB reacts to it.
16. Write a MATLAB program to perform the convolution between X (n) = [3 -4 6] and y (n) =
[2 6 8 6] and see how MATLAB reacts to it.
17. Write a MATLAB program to perform the convolution between X (n) = [3 1 2 0] and y (n) =
[2 4 3 4 5] and see how MATLAB reacts to it.
19.Write a MATLAB program to perform the convolution between X (n) = [2 1 2 1] and y (n) =
[1 2 1 2] and see how MATLAB reacts to it.
20.Write a MATLAB program to perform the convolution between X (n) = [5 6 9 8 7] and y (n)
= [1 2 3 2 1] and see how MATLAB reacts to it.
21.Write the MATLAB program to perform cross correlation between the following sequences
22. Write a mat lab program to perform the cross correlation between ramp and step function and
see how mat lab reacts to it.
23. Write a MATLAB program to perform cross correlation between square and step signal and
see how mat lab reacts to it.
24. Write a MATLAB program to perform cross correlation between sinusoidal and step signal
and see how mat lab reacts to it.
25. Write a MATLAB program to perform the convolution between X (n) = [1 5 6 5] and y (n) =
[-3 –6] and see how MATLAB reacts to it.
DIGITAL SYSTEM
DESIGN LAB
EXPERIMENT 1
LOGIC DIAGRAM 1:
LOGIC DIAGRAM 2
IC PIN DIAGRAMS:
7432
THEORY:
Logic gates
Digital systems are said to be constructed by using logic gates. These gates are the AND, OR,
NOT, NAND, NOR, EXOR and EXNOR gates. The basic operations are described below with
the aid of truth tables.
AND gate
The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are
high. A dot (.) is used to show the AND operation i.e. A.B. Bear in mind that this dot is
sometimes omitted i.e. AB
OR gate
The OR gate is an electronic circuit that gives a high output (1) if one or more of its
inputs are high. A plus (+) is used to show the OR operation.
NOT gate
The NOT gate is an electronic circuit that produces an inverted version of the input at its
output. It is also known as an inverter. If the input variable is A, the inverted output is
known as NOT A. This is also shown as A', or A with a bar over the top, as shown at the
outputs. The diagrams below show two ways that the NAND logic gate can be configured
to produce a NOT gate. It can also be done using NOR logic gates in the same way.
NAND gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The
outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND
gate with a small circle on the output. The small circle represents inversion.
NOR gate
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The
outputs of all NOR gates are low if any of the inputs are high.
The symbol is an OR gate with a small circle on the output. The small circle represents
inversion.
EXOR gate
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not
both, of its two inputs are high. An encircled plus sign ( ) is used to show the EOR
operation.
EXNOR gate
The 'Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a low output
if either, but not both, of its two inputs are high. The symbol is an EXOR gate with a small
circle on the output. The small circle represents inversion.
The NAND and NOR gates are called universal functions since with either one the AND and OR
functions and NOT can be generated.
Note:
A function in sum of products form can be implemented using NAND gates by replacing all
AND and OR gates by NAND gates.
A function in product of sums form can be implemented using NOR gates by replacing all AND
and OR gates by NOR gates
Table 2 is a summary truth table of the input/output combinations for the NOT gate together with
all possible input/output combinations for the other gate functions. Also note that a truth
table with 'n' inputs has 2n rows. You can compare the outputs of different gates.
TRUTH TABLE:
Logic diagram 1:
A B A+B B’ A+B’ F=
(A+B)*(A+B’)
Logic diagram 2:
PROCEDURE:
PRECAUTIONS:
shorting of pins.
RESULT: Realization of Boolean Expressions using Gates AND ,OR and NOT gates NOR
gates have been verified.
VIVA QUESTIONS
2. A __________ gate gives the output as 1 only if all the inputs signals are?
3. Which of the gate will give a 0 when both of its inputs are 1?
7. The universal gate that can be used to implement any Boolean expression is
__________?
8. Electronic circuits that operate on one or more input signals to produce standard output
_______?
10. A ____________ is a circuit with only one output but can have multiple inputs?
11. The Output is LOW if any one of the inputs is HIGH in case of a _________ gate?
12. How many AND gates are required to realize the following expression Y=AB+BC?
21. The portion of the processor which contains the hardware required to fetch the operations
is _______?
22. Causing the CPU to step through a series of micro operations is called _________?
23. The functions of execution and sequencing are performed by using ______________?
27. CPU has built-in ability to execute a particular set of machine instructions, called as
__________?
48. How many NOT gates are required for the construction of a 4-to-1 multiplexer?
EXPERIMENT 2
Equipments Needed:
1) Patch Cords
2) IC CD 4011, 1k Resistance , 100E Resistance , 100uF/25V Electrolytic capacitor,
Bread Board
Block Diagram:
Circuit Diagram:
THEORY:
NAND Gate: The NAND gate represents the complement of the AND operation. Its name is
an abbreviation of NOT AND. The graphic symbol for the NAND gate consists of an AND
symbol with a bubble on the output, denoting that a complement operation is performed on
the output of the AND gate. The truth table and the graphic symbol of NAND gate is shown
in the figure. The truth table clearly shows that the NAND operation is the complement of
the AND.
NOR Gate: The NOR gate represents the complement of the OR operation. Its name is an
abbreviation of NOT OR. The graphic symbol for the NOR gate consists of an OR symbol
with a bubble on the output, denoting that a complement operation is performed on the output
of the OR gate. The truth table and the graphic symbol of NOR gate is shown in the figure.
The truth table clearly shows that the NOR operation is the complement of the OR.
Universal Gates: A universal gate is a gate which can implement any Boolean function
without need to use any other gate type. The NAND and NOR gates are universal gates. In
practice, this is advantageous since NAND and NOR gates are economical and easier to
fabricate and are the basic gates used in all IC digital logic families. In fact, an AND gate is
typically implemented as a NAND gate followed by an inverter not the other way around!!
Likewise, an OR gate is typically implemented as a NOR gate followed by an inverter
PROCEDURE:
VIVA QUESTIONS:
1. What are the universal gates? Why they are called so?
3. Give the truth table for EX-NOR and realize using NAND gates?
4. What are the logic low and High levels of TTL IC’s and CMOS IC’s?
6 .Which logic family is fastest and which has low power dissipation?
23 Draw the full adder circuit by using Half Adder circuit and minimum no. of logicgate?
25. Write Boolean function for Full adder?261.Design the half Adder and Full adder using
NAND-NAND Logic.
29. What is the difference between Johnson Ring Counter and synchronous ring counter?
36. Write the behavioral code for IC 74x189 without declaring the function
48. What is a flip-flop? Explain the functions of preset and clear inputs in flip-flop?
EXPERIMENT 3
BLOCK DIAGRAM:
TRUTH TABLE
THEORY:
PROCEDURE:
PRECAUTIONS: -
VIVA QUESTIONS:
EXPERIMENT: 4
EQUIPMENTS NEEDED:
1) Patch Cords
2) IC 74LS136- 2 Nos.
BLOCK DIAGRAM:
CIRCUIT DIAGRAM:
TRUTH TABLE
Decimal B3 B2 B1 B0 Decimal G3 G2 G1 G0
PROCEDURE:
PRECAUTIONS:
RESULT: Convertion f binary to gray and gary to binary codes are sucessfully verified with
the help of truth table
VIVA QUESTIONS
EXPERIMENT: 5
AIM: Design and realization of an 8 bit parallel load and serial out shift register using flip-
flops.
EQUIPMENTS NEEDED:
1. Patch Cords
2. IC 74LS165
3. Trainer kit
BLOCK DIAGRAM:
CIRCUIT DIAGRAM:
TRUTH TABLE:
THEORY:
The Shift Register is another type of sequential logic circuit that can be used for the storage
or the transfer of binary data
This sequential device loads the data present on its inputs and then moves or “shifts” it to its
output once every clock cycle, hence the name Shift Register.
A shift register basically consists of several single bit “D-Type Data Latches”, one for each
data bit, either a logic “0” or a “1”, connected together in a serial type daisy-chain
arrangement so that the output from one data latch becomes the input of the next latch and so
on.
Data bits may be fed in or out of a shift register serially, that is one after the other from either
the left or the right direction, or all together at the same time in a parallel configuration.
The number of individual data latches required to make up a single Shift Register device is
usually determined by the number of bits to be stored with the most common being 8-bits
(one byte) wide constructed from eight individual data latches.
Shift Registers are used for data storage or for the movement of data and are therefore
commonly used inside calculators or computers to store data such as two binary numbers
before they are added together, or to convert the data from either a serial to parallel or
parallel to serial format. The individual data latches that make up a single shift register are all
driven by a common clock ( Clk ) signal making them synchronous devices.
Shift register IC’s are generally provided with a clear or reset connection so that they can be
“SET” or “RESET” as required. Generally, shift registers operate in one of four different
modes with the basic movement of data through a shift register being:
Serial-in to Parallel-out (SIPO) - the register is loaded with serial data, one bit at a
time, with the stored data being available at the output in parallel form.
Serial-in to Serial-out (SISO) - the data is shifted serially “IN” and “OUT” of the
register, one bit at a time in either a left or right direction under clock control.
Parallel-in to Serial-out (PISO) - the parallel data is loaded into the register
simultaneously and is shifted out of the register serially one bit at a time under clock
control.
Parallel-in to Parallel-out (PIPO) - the parallel data is loaded simultaneously into the
register, and transferred together to their respective outputs by the same clock pulse.
The Parallel-in to Serial-out shift register acts in the opposite way to the serial-in to parallel-
out one above. The data is loaded into the register in a parallel format in which all the data
bits enter their inputs simultaneously, to the parallel input pins PA to PD of the register. The
data is then read out sequentially in the normal shift-right mode from the register
at Qrepresenting the data present at PA to PD.
This data is outputted one bit at a time on each clock cycle in a serial format. It is important
to note that with this type of data register a clock pulse is not required to parallel load the
register as it is already present, but four clock pulses are required to unload the data.
PROCEDURE:
PRECAUTIONS:
RESULT: Parallel load and serial out shift register operation is verified by using truth table
VIVA QUESTIONS
22. What is the definition of a register in the context of digital circuitry? Also, define and
compare/contrast what a shift register is.
23. Draw the schematic diagram for a five-bit serial-in/serial-out shift register circuit, and
be prepared to give a brief explanation of how it functions.
24. Explain how a shift register circuit could be built from D-type flip-flops with the ability
to shift data either to the right or to the left, on command.
25. Explain what a universal shift register is
26. Describe how we can get parallel data entered into a shift register circuit.
27. A shift register that will accept a parallel input or a bidirectional serial load and internal
shift features is called as?
28. How can parallel data be taken out of a shift register simultaneously?
29. What is meant by parallel load of a shift register?
30. The group of bits 11001 is serially shifted (right-most bit first) into a 5-bit parallel output
shift register with an initial state 01110. After three clock pulses, the register contains?
31. Assume that a 4-bit serial in/serial out shift register is initially clear. We wish to store the
nibble 1100. What will be the 4-bit pattern after the second clock pulse?
32. An 8-bit serial in/serial out shift register is used with a clock frequency of 2 mhz to
achieve a time delay (td) of
33. On the fifth clock pulse, a 4-bit Johnson sequence is Q0 = 0, Q1 = 1, Q2 = 1, and Q3 = 1.
On the sixth clock pulse, the sequence is ________.
34. The bit sequence 0010 is serially entered (right-most bit first) into a 4-bit parallel out shift
register that is initially clear. What are the Q outputs after two clock pulses?
35. On the third clock pulse, a 4-bit Johnson sequence is Q0 = 1, Q1 = 1, Q2 = 1, and Q3 = 0.
On the fourth clock pulse, the sequence is ________.
36. A bidirectional 4-bit shift register is storing the nibble 1101. Its input is
HIGH. The nibble 1011 is waiting to be entered on the serial data-input line. After three
clock pulses, the shift register is storing ________.
37. What does the output enable do on the 74395A chip?
38. In a 6-bit Johnson counter sequence there are a total of how many states, or bit patterns?
39. A modulus-12 ring counter requires a minimum of how many flipflops?
40. Stepper motors have become popular in digital automation systems because they are
driven by ---------- signals and have repetitive__________ moment.
41. A sequence of equally spaced timing pulses may be easily generated by which type of
counter circuit?
42. The bit sequence 10011100 is serially entered (right-most bit first) into an 8-bit parallel
out shift register that is initially clear. What are the Q outputs after four clock pulses?
43. If an 8-bit ring counter has an initial state 10111110, what is the state after the fourth
clock pulse?
44. How would a latch circuit be used in a microprocessor system?
45. A 4-bit shift register that receives 4 bits of parallel data will shift to the ________ by
________ position(s) for each clock pulse.
46. How many clock pulses will be required to completely load serially a 5-bit shift register?
47. An 8-bit serial in/serial out shift register is used with a clock frequency of 150 khz. What
is the time delay between the serial input and the Q3 output?
48. What are the three output conditions of a three-state buffer?
49. The primary purpose of a three-state buffer is?
50. What is the difference between a ring shift counter and a Johnson shift counter?
EXPERIMENT NO: 6
EQUIPMENTS NEEDED:
1. Patch Cords
2. IC 74LS90, IC 74193
3. TRAINER KIT
BLOCK DIAGRAM:
TRUTH TABLE:
States QD QC QB QA States QD QC QB QA
THEORY:
As well as counting “up” from zero and increasing or incrementing to some preset value, it is
sometimes necessary to count “down” from a predetermined value to zero allowing us to
produce an output that activates when the zero count or some other pre-set value is reached.
This type of counter is normally referred to as a Down Counter, (CTD). In a binary or BCD
down counter, the count decreases by one for each external clock pulse from some preset
value. Special dual purpose IC’s such as the TTL 74LS193 or CMOS CD4510 are 4-bit
binary Up or Down counters which have an additional input pin to select either the up or
down count mode.
In the 4-bit counter above the output of each flip-flop changes state on the falling edge (1-to-
0 transition) of the CLK input which is triggered by the Q output of the previous flip-flop,
rather than by the Q output as in the up counter configuration. As a result, each flip-flop will
change state when the previous one changes from 0 to 1 at its output, instead of changing
from 1 to 0.
Bidirectional Counter
Both Synchronous and Asynchronous counters are capable of counting “Up” or counting
“Down”, but their is another more “Universal” type of counter that can count in both
directions either Up or Down depending on the state of their input control pin and these are
known as Bidirectional Counters.
Bidirectional counters, also known as Up/Down counters, are capable of counting in either
direction through any given count sequence and they can be reversed at any point within their
count sequence by using an additional control input as shown below.
The circuit above is of a simple 3-bit Up/Down synchronous counter using JK flip-flops
configured to operate as toggle or T-type flip-flops giving a maximum count of zero (000) to
seven (111) and back to zero again. Then the 3-Bit counter advances upward in sequence
(0,1,2,3,4,5,6,7) or downwards in reverse sequence (7,6,5,4,3,2,1,0).
Generally most bidirectional counter chips can be made to change their count direction either
up or down at any point within their counting sequence. This is achieved by using an
additional input pin which determines the direction of the count, either Up or Down and the
timing diagram gives an example of the counters operation as this Up/Down input changes
state.
Nowadays, both up and down counters are incorporated into single IC that is fully
programmable to count in both an “Up” and a “Down” direction from any preset value
producing a complete Bidirectional Counter chip. Common chips available are
the 74HC190 4-bit BCD decade Up/Down counter, the 74F569 is a fully synchronous
Up/Down binary counter and the CMOS 4029 4-bit Synchronous Up/Down counter.
PROCEDURE:
RESULT: Synchronous and asynchronous counter operation is verified by using truth table.
VIVA QUESTIONS:
EXPERIMENT NO-7
THEORY:
8x1 Multiplexer :
In this section, let us implement 8x1 Multiplexer using 4x1 Multiplexers and 2x1 Multiplexer. We
know that 4x1 Multiplexer has 4 data inputs, 2 selection lines and one output. Whereas, 8x1
Multiplexer has 8 data inputs, 3 selection lines and one output.
So, we require two 4x1 Multiplexers in first stage in order to get the 8 data inputs. Since, each
4x1 Multiplexer produces one output, we require a 2x1 Multiplexer in second stage by
considering the outputs of first stage as inputs and to produce the final output.
Let the 8x1 Multiplexer has eight data inputs I7 to I0, three selection lines s2, s1 & s0 and one
output Y. The Truth table of 8x1 Multiplexer is shown below.
We can implement 8x1 Multiplexer using lower order Multiplexers easily by considering the
above Truth table. The block diagram of 8x1 Multiplexer is shown in the following figure.
The same selection lines, s1 & s0 are applied to both 4x1 Multiplexers. The data inputs of upper
4x1 Multiplexer are I7 to I4 and the data inputs of lower 4x1 Multiplexer are I3 to I0. Therefore,
each 4x1 Multiplexer produces an output based on the values of selection lines, s1 & s0.
The outputs of first stage 4x1 Multiplexers are applied as inputs of 2x1 Multiplexer that is present
in second stage. The other selection line, s2 is applied to 2x1 Multiplexer.
If s2 is zero, then the output of 2x1 Multiplexer will be one of the 4 inputs I3 to I0 based on
the values of selection lines s1 & s0.
If s2 is one, then the output of 2x1 Multiplexer will be one of the 4 inputs I7 to I4 based on
the values of selection lines s1 & s0.
Therefore, the overall combination of two 4x1 Multiplexers and one 2x1 Multiplexer performs as
one 8x1 Multiplexer.
PROCEDURE:
PRECAUTIONS:
chip.
RESULT: 8X1 Mux by using 2X1 Mux is verified along with truth table
VIVA QUESTIONS
1. What is a multiplexer?
2. Which combinational circuit is renowned for selecting a single input from multiple
inputs & directing the binary information to output line?
3. Which is the major functioning responsibility of the multiplexing combinational
circuit?
4. How many select lines would be required for an 8-line-to-1-line multiplexer?
5. How many NOT gates are required for the construction of a 4-to-1 multiplexer?
6. What are the applications of multiplexer and de-multiplexer?
7. In 2n to 1 multiplexer how many selection lines are there?
8. How to get higher order multiplexers?
9. Implement an 8:1 mux using 4:1 muxes
EXPERIMENT 8
APPARATUS REQUIRED: IC 7485, 4-BIT Digital Comparator Trainer Kit, Patch Chords
IC PIN DESCRIPTION:
TRUTH TABLE
Some commercially available digital comparators such as the TTL 74LS85 or CMOS 4063
4-bit magnitude comparator have additional input terminals that allow more individual
comparators to be “cascaded” together to compare words larger than 4-bits with magnitude
comparators of “n”-bits being produced. These cascading inputs are connected directly to
the corresponding outputs of the previous comparator as shown to compare 8, 16 or even
32-bit words.
PROCEDURE:
VIVA QUESTIONS:
28 Draw the full adder circuit by using Half Adder circuit and minimum no. of logicgate?
31.Design the half Adder and Full adder using NAND-NAND Logic.
34.Draw the full subtractor circuit by using half subtractor circuit and minimum no. of logic gate?
41.Out of the possible 16 code combination? How many numbers used in Excess-3 code?
46.If two numbers are not equal then binary variable will be
EXPERIMENT NO-9
AIM:
To Construct a Ring Counter and Twisted Ring Counter using 4 Bit Shift Register.
APPARATUS:
1. Ring Counter and Twisted Ring Counter using ϰBit Shift Register Trainer kit.
2. Patch Cords.
THEORY:
Ring counter is a basic register with direct feedback such that the contents of the
register simply circulate around the register when the clock is running. Here the last
output that is QD in a shift register is connected back to the serial input. A basic ring
counter can be slightly modified to produce another type of shift register counter called
Johnson counter. Here complement of last output is connected back to the not gate input
and not gate output is connected back to serial input. A four bit Johnson counter gives 8
state output.
PIN CONFIGURATION:
PROCEDURE:
Ring Counter:
TRUTH TABLE:
Ring Counter:
Clock QA QB QC QD
0 1 0 0 0
1 0 1 0 0
2 0 0 1 0
3 0 0 0 1
4 1 0 0 0
5 0 1 0 0
6 0 0 1 0
7 0 0 0 1
8 1 0 0 0
Clock QA QB QC QD
0 0 0 0 0
1 1 0 0 0
2 1 1 0 0
3 1 1 1 0
4 1 1 1 1
5 0 1 1 1
0 0 1 1
76 0 0 0 1
8 0 0 0 0
RESULTS:
A Ring Counter and Twisted Ring Counter using 4 Bit Shift Register was constructed and
implemented.
VIVA QUESTIONS
EXPERIMENT 10
THEORY:
A sequence detector is a sequential state machine which takes an input string of bits and
generates an output 1 whenever the target sequence has been detected.In a Mealy machine,
output depends on the present state and the external input (x). Hence in the diagram, the output is
written outside the states, along with inputs. Sequence detector is of two types:
1. Overlapping
2. Non-Overlapping
In an overlapping sequence detector the last bit of one sequence becomes the first bit of next
sequence. However, in non-overlapping sequence detector the last bit of one sequence does not
become the first bit of next sequence. In this post, we’ll discuss the design overlapping 101
Mealysequence detector.
Examples:
Input :0110101011001
Output:0000100010000
Input :0110101011001
Output:0000101010000
Step 2:CodeAssignment –
Rule 1 : States having the same next states for a given input condition should have adjacent
assignments.
Rule 2:States that are the next states to a single state must be given adjacent assignments.
Rule 1 given preference over Rule 2.
Step 3: Make Present State/Next State table – We’ll use D-FlipFlops for design purpose.
This is the final circuit for a Mealy 101 non overlapping sequence detector.
RESULT: sequence detector-a finite state machine is verified by using truth table
VIVA QUESTIONS:
1. The Finite state machine described by the following state diagram with A as starting
state, where an arc label is x / y and x stands for 1-bit input and y stands for 2- bit output
11. For a give Moore Machine, Given Input=’101010’, thus the output would be of length?
13. Design a circuit that detects three consecutive '1's using Mealy and Moore FSM?
14. Fault coverage is ______ in finite state machines?
17. How many test patterns are required to test the circuit using counters?
19. Explain about setup time and hold time, what will happen if there is setup time and hold
tine violation, how to overcome this?
20. What are different ways to synchronize between two clock domains?
21. What is skew, what are problems associated with it and how to minimize it?
22. What is glitch? What causes it (explain with waveform)? How to overcome it?
24. Given only two xor gates one must function as buffer and another as inverter?
30. Draw the state diagram to output a "1" for one cycle if the sequence "0110" shows up (the
leading 0s cannot be used in more than one sequence)?
33. what is false path?how it determine in ckt? what the effect of false path in ckt?
36. The circle can rotate clockwise and back. Use minimum hardware to build a circuit to
indicate the direction of rotating.?
49. What are the differences between Binary, Gray and One-hot encoding?