From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1964/CH15/EX15.5/ex15_5.sce | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 1964/CH15/EX15.5/ex15_5.sce (limited to '1964/CH15/EX15.5') diff --git a/1964/CH15/EX15.5/ex15_5.sce b/1964/CH15/EX15.5/ex15_5.sce new file mode 100755 index 000000000..0d16eaec2 --- /dev/null +++ b/1964/CH15/EX15.5/ex15_5.sce @@ -0,0 +1,18 @@ +//Chapter-15, Example 15.5, Page 496 +//============================================================================= +clc +clear +//CALCULATIONS +x1=base2dec(['1101','1100'],2)//converting binary to decimal +x2=base2dec(['1000','101'],2)//converting binary to decimal +x3=base2dec(['1111','1001'],2)//converting binary to decimal +y1=(x1(1))*(x1(2));//multiplying +y2=(x2(1))*(x2(2));//multiplying +y3=(x3(1))*(x3(2));//multiplying +z1=dec2base(y1,2)//converting decimal to hexadecimal +z2=dec2base(y2,2)//converting decimal to hexadecimal +z3=dec2base(y3,2)//converting decimal to hexadecimal +disp(z1) +disp(z2) +disp(z3) +//=================================END OF PROGRAM======================================================================================================= -- cgit