summaryrefslogtreecommitdiff
path: root/1757/CH11/EX11.2
diff options
context:
space:
mode:
Diffstat (limited to '1757/CH11/EX11.2')
-rwxr-xr-x1757/CH11/EX11.2/EX11_2.sce32
1 files changed, 32 insertions, 0 deletions
diff --git a/1757/CH11/EX11.2/EX11_2.sce b/1757/CH11/EX11.2/EX11_2.sce
new file mode 100755
index 000000000..e3d889d40
--- /dev/null
+++ b/1757/CH11/EX11.2/EX11_2.sce
@@ -0,0 +1,32 @@
+//Example11.2 // determine the output voltage of D/A converter for the binary inputs a) 10101010 b) 11001100 c) 11101110 d) 00010001
+clc;
+clear;
+close;
+del = 12*10^-3 ; // mA
+
+// the input voltage of D/A converter
+ //Vo = del*binary input (BI)
+
+// For BI 10101010 the output
+BI = '10101010' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 10101010 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 11001100 the output
+BI = '11001100' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 11001100 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 11101110 the output
+BI = '11101110' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 11101110 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 00010001 the output
+BI = '00010001' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 00010001 the output of D/A converter is = ' +string(Vo)+ ' V ');