summaryrefslogtreecommitdiff
path: root/1238/CH8/EX8.1/8_1.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1238/CH8/EX8.1/8_1.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1238/CH8/EX8.1/8_1.sce')
-rwxr-xr-x1238/CH8/EX8.1/8_1.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/1238/CH8/EX8.1/8_1.sce b/1238/CH8/EX8.1/8_1.sce
new file mode 100755
index 000000000..2deb93114
--- /dev/null
+++ b/1238/CH8/EX8.1/8_1.sce
@@ -0,0 +1,20 @@
+//finding binary equivalent weights//
+//example 1//
+clc
+//clears the command window//
+clear
+//clears//
+n=6;//no. of bits//
+LSB1=1/((2^6)-1)
+printf('weight of 1st lsb=%f\n',LSB1)
+LSB2=2*LSB1
+printf('weight of 2nd lsb=%f\n',LSB2)
+LSB3=4*LSB1
+printf('weight of 3rd lsb=%f\n',LSB3)
+LSB4=8*LSB1
+printf('weight of 4th lsb=%f\n',LSB4)
+LSB5=16*LSB1
+printf('weight of 5th lsb=%f\n',LSB5)
+MSB=32*LSB1
+printf('weight of msb=%f',MSB)
+//results are displayed//