Beruflich Dokumente
Kultur Dokumente
CODING:
clc;
clear all;
close all;
h=[0 1 2 3 4 5];
x=[5 4 3 2 1 0];
pp=h;
qq=x;
l1=length(h);
l2=length(x);
l=abs(l1-l2);
if(l1>l2)
x=[x zeros(1,l)];
else if(l2>l1)
h=[h zeros(1,l)];
end
end
h=[h zeros(1,max(l1,l2))];
for shift=0:max(l1,l2)
xx=[zeros(1,shift) x zeros(1,(max(l1,l2))-shift)];
y(shift+1,:)=sum(h.*xx);
end
y=y'
subplot(3,1,1)
stem(pp,'m');
title('h');
subplot(3,1,2)
stem(qq,'b');
title('x');
subplot(3,1,1)
stem(y,'r');
title('coorelation');
OBSERVATION:
clc;
clear all;
close all;
t=0:0001:6.3;
am=2;
fm=1;
msg=am*cos(fm*t);
ac=10;
fc=1000;
carrier=ac*cos(fc*t);
m=am/ac;
y=ac.*(1+(m.*cos(fm.*t))).*cos(fc.*t);
subplot(3,1,1)
plot(t,msg);
title('message signal');
subplot(3,1,2)
plot(t,carrier);
title('carrier signal');
subplot(3,1,3)
plot(t,y);
title('modulated signal');
OBSERVATION:
CONCLUSION: Here we plotted massage signal , carrier signal
& modulated signal.
clc;
clear all;
close all;
t=0:0.01:10;
x=2*sin(2*t);
freq=linspace(-5,5,1000);
for k=1:length(freq);
w=exp(-1i*2*pi*freq(k)*t);
l=trapz(t,x.*w);
magdata(k)=abs(l);
phasedata(k)=angle(l);
esd(k)=magdata(k)^2;
end
subplot(3,1,1)
plot(freq,magdata);
title('magnitude plot');
subplot(3,1,2)
plot(freq,phasedata);
title('phase plot');
subplot(3,1,3);
plot(freq,esd);
title('electro spectral density');
OBSERVATOIN:
OBSERVATION:
INPUT: D0 , D1 , D2 , D3
SELECT : S1 , S2
OUTPUT : Y
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
OBSERVATION:
TRUTH TABLE:
S0 S1 S2 E D0 D1 D2 D3 D4 D5 D6 D7
x x x 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 1
0 0 1 1 0 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1 0 0
0 1 1 1 0 0 0 0 1 0 0 0
1 0 0 1 0 0 0 1 0 0 0 0
1 0 1 1 0 0 1 0 0 0 0 0
1 1 0 1 0 1 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0
The decoder circuit works only when the Enable pin (E) is high. S0, S1 and S2 are three different inputs and D0, D1, D2, D3.
D4. D5. D6. D7 are the eight outputs.
OBSERVATION:
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.
CONCLUSION:
HENCE,WE Implement different digital logic circuits using labview.