From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3860/CH1/EX1.12/Ex1_12.sce | 15 +++++++++++++++ 3860/CH1/EX1.12/Ex1_12.txt | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 3860/CH1/EX1.12/Ex1_12.sce create mode 100644 3860/CH1/EX1.12/Ex1_12.txt (limited to '3860/CH1/EX1.12') 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 -- cgit