diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3860/CH1/EX1.12 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3860/CH1/EX1.12')
-rw-r--r-- | 3860/CH1/EX1.12/Ex1_12.sce | 15 | ||||
-rw-r--r-- | 3860/CH1/EX1.12/Ex1_12.txt | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/3860/CH1/EX1.12/Ex1_12.sce b/3860/CH1/EX1.12/Ex1_12.sce new file mode 100644 index 000000000..d14494f32 --- /dev/null +++ b/3860/CH1/EX1.12/Ex1_12.sce @@ -0,0 +1,15 @@ +//Example 1.12 Addition of two Binary numbers
+clc // clears the console window
+clear // clears the variable browser
+m = bin2dec('0110'); //conversion from binary to decimal
+n = bin2dec('0111');
+k= m + n; //addition of decimal numbers
+a = dec2bin(k);//conversion from decimal to Binary
+// displays the binary addition.
+disp(a,'Addition of two Binary number 0110 and 0111 is = ')
+p = bin2dec('1101'); //conversion from binary to decimal
+q = bin2dec('0101');
+r= p + q; //addition of decimal numbers
+s = dec2bin(r);//conversion from decimal to Binary
+// displays the binary addition.
+disp(s,'Addition of two Binary number 1101 and 0101 is = ')
diff --git a/3860/CH1/EX1.12/Ex1_12.txt b/3860/CH1/EX1.12/Ex1_12.txt new file mode 100644 index 000000000..5b7a53043 --- /dev/null +++ b/3860/CH1/EX1.12/Ex1_12.txt @@ -0,0 +1,8 @@ +
+ Addition of two Binary number 0110 and 0111 is =
+
+ 1101
+
+ Addition of two Binary number 1101 and 0101 is =
+
+ 10010
\ No newline at end of file |