summaryrefslogtreecommitdiff
path: root/2582/CH6
diff options
context:
space:
mode:
Diffstat (limited to '2582/CH6')
-rwxr-xr-x2582/CH6/EX6.1/Ex6_1.sce11
-rwxr-xr-x2582/CH6/EX6.2/Ex6_2.sce7
-rwxr-xr-x2582/CH6/EX6.3/Ex6_3.sce11
-rwxr-xr-x2582/CH6/EX6.4/Ex6_4.sce22
-rwxr-xr-x2582/CH6/EX6.5/Ex6_5.sce10
-rwxr-xr-x2582/CH6/EX6.6/Ex6_6.sce10
-rwxr-xr-x2582/CH6/EX6.7/Ex6_7.sce8
-rwxr-xr-x2582/CH6/EX6.8/Ex6_8.sce13
-rwxr-xr-x2582/CH6/EX6.9/Ex6_9.sce6
9 files changed, 98 insertions, 0 deletions
diff --git a/2582/CH6/EX6.1/Ex6_1.sce b/2582/CH6/EX6.1/Ex6_1.sce
new file mode 100755
index 000000000..49500b8a3
--- /dev/null
+++ b/2582/CH6/EX6.1/Ex6_1.sce
@@ -0,0 +1,11 @@
+//Ex 6.1
+clc;clear;close;
+n=8;//no. of bits
+V1=0;//V
+V2=5.12;//V
+Res=2^n;//resolution
+disp(Res,"(a) Resolution=");
+delVo=(V2-V1)/Res*1000;//mV/bit
+disp(delVo,"(b) Output change per bit(mV/bit)");
+VFS=V2*(1-1/2^n);//V
+disp(VFS,"(c) Full scale Output voltage(V)");
diff --git a/2582/CH6/EX6.2/Ex6_2.sce b/2582/CH6/EX6.2/Ex6_2.sce
new file mode 100755
index 000000000..5db7f06c4
--- /dev/null
+++ b/2582/CH6/EX6.2/Ex6_2.sce
@@ -0,0 +1,7 @@
+//Ex 6.2
+clc;clear;close;
+format('v',5);
+step=10.3;//mV
+reading='101101111';//reading
+Vo=step*bin2dec(reading)/1000;//V
+disp(Vo,"Output voltage(V)");
diff --git a/2582/CH6/EX6.3/Ex6_3.sce b/2582/CH6/EX6.3/Ex6_3.sce
new file mode 100755
index 000000000..04c423d74
--- /dev/null
+++ b/2582/CH6/EX6.3/Ex6_3.sce
@@ -0,0 +1,11 @@
+//Ex 6.3
+clc;clear;close;
+format('v',5)
+n=8;//no. of bits
+Range=0:10;//range
+LSB=max(Range)/2^n;//V
+MSB=max(Range)/2^0;//V
+VFS=MSB-LSB;//V
+disp(LSB*1000,"LSB(mV)");
+disp(MSB,"MSB(V)");
+disp(VFS,"VFS(V)");
diff --git a/2582/CH6/EX6.4/Ex6_4.sce b/2582/CH6/EX6.4/Ex6_4.sce
new file mode 100755
index 000000000..b7aa3c0f8
--- /dev/null
+++ b/2582/CH6/EX6.4/Ex6_4.sce
@@ -0,0 +1,22 @@
+//Ex 6.4
+clc;clear;close;
+format('v',5);
+Range=0:10;//range
+//(i)2-bit DAC
+n=2;//no. of bits
+step=max(Range)/2^n;//V
+reading='10';//input in binary
+Vo=step*bin2dec(reading);//V
+disp(Vo,"(i) Output Voltage(V)");
+//(ii)4-bit DAC
+n=4;//no. of bits
+step=max(Range)/2^n;//V
+reading='0110';//input in binary
+Vo=step*bin2dec(reading);//V
+disp(Vo,"(ii) Output Voltage(V)");
+//(i)8-bit DAC
+n=8;//no. of bits
+step=max(Range)/2^n;//V
+reading='10111100';//input in binary
+Vo=step*bin2dec(reading);//V
+disp(Vo,"(iii) Output Voltage(V)");
diff --git a/2582/CH6/EX6.5/Ex6_5.sce b/2582/CH6/EX6.5/Ex6_5.sce
new file mode 100755
index 000000000..3d6f765ac
--- /dev/null
+++ b/2582/CH6/EX6.5/Ex6_5.sce
@@ -0,0 +1,10 @@
+//Ex 6.5
+clc;clear;close;
+n=8;//no. of bits
+Res=20;//mV/bit(Resolution)
+reading='00010110';//input in binary
+Vo=Res*bin2dec(reading);//V
+disp(Vo/1000,"(a) Output Voltage(V)");
+reading='10000000';//input in binary
+Vo=Res*bin2dec(reading);//V
+disp(Vo/1000,"(b) Output Voltage(V)");
diff --git a/2582/CH6/EX6.6/Ex6_6.sce b/2582/CH6/EX6.6/Ex6_6.sce
new file mode 100755
index 000000000..6b94fc0fb
--- /dev/null
+++ b/2582/CH6/EX6.6/Ex6_6.sce
@@ -0,0 +1,10 @@
+//Ex 6.6
+clc;clear;close;
+n=12;//no. of bits
+Eoff=0.05;//%//maximum offset error
+Vref=10.24;//V
+Voffset=Eoff/100*Vref;//V
+disp(round(Voffset*1000),"(a) Offset voltage(mV)");
+delVo=Vref/2^n;//V/bit
+Voff_dash=Voffset/delVo;//in terms of LSB
+disp(round(Voff_dash),"(b) Offset voltage in terms of LSB");
diff --git a/2582/CH6/EX6.7/Ex6_7.sce b/2582/CH6/EX6.7/Ex6_7.sce
new file mode 100755
index 000000000..606fbab5e
--- /dev/null
+++ b/2582/CH6/EX6.7/Ex6_7.sce
@@ -0,0 +1,8 @@
+//Ex 6.7
+clc;clear;close;
+format('v',4);
+n=8;//no. of bits
+E=0.2;//%//maximum gain error
+Vref=5.1;//V
+V11=(100-E)*Vref/100;//V
+disp(V11,"Minimum output voltage(V)");
diff --git a/2582/CH6/EX6.8/Ex6_8.sce b/2582/CH6/EX6.8/Ex6_8.sce
new file mode 100755
index 000000000..66642eb83
--- /dev/null
+++ b/2582/CH6/EX6.8/Ex6_8.sce
@@ -0,0 +1,13 @@
+//Ex 6.8
+clc;clear;close;
+format('v',5);
+n=8;//no. of bits
+Range=0:10;//V
+Vin=5.2;//V
+oneLSB=max(Range)/2^n;//V
+disp(oneLSB*1000,"(a) Minimum voltage for 1 LSB in mV");
+Vifs=max(Range)-oneLSB;//V
+disp(Vifs,"(b) For all ones input voltage should be (V)");
+D=Vin/oneLSB;//Digital output in decimal
+D=dec2bin(round(D));//Digital output in binary
+disp(D,"(c) Digital Output");
diff --git a/2582/CH6/EX6.9/Ex6_9.sce b/2582/CH6/EX6.9/Ex6_9.sce
new file mode 100755
index 000000000..d354b009e
--- /dev/null
+++ b/2582/CH6/EX6.9/Ex6_9.sce
@@ -0,0 +1,6 @@
+//Ex 6.9
+clc;clear;close;
+n=8;//no. of bits
+f=1*10^6;//Hz(Clock frequency)
+TC=1/f*(n+1);//seconds
+disp(TC*10^6,"Conversion time in micro seconds");