diff options
Diffstat (limited to '2825/CH19/EX19.5/Ex19_5.sce')
-rwxr-xr-x | 2825/CH19/EX19.5/Ex19_5.sce | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/2825/CH19/EX19.5/Ex19_5.sce b/2825/CH19/EX19.5/Ex19_5.sce new file mode 100755 index 000000000..670e3e987 --- /dev/null +++ b/2825/CH19/EX19.5/Ex19_5.sce @@ -0,0 +1,15 @@ +//Ex19_5 Pg-958
+clc
+
+//Integer part
+bin='10101'; //binary input
+dec_I=bin2dec(bin) //decimal output
+
+//Decimal part
+a=1
+b=0
+c=1
+dec_D=a*2^(-1)+b*2^(-2)+c*2^(-3)
+dec=dec_I+dec_D //decimal output
+disp("The decimal equivqlent of 10101.101 is")
+disp(dec)
|