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 --- 462/CH2/EX2.11.a/ex_2_11_a.pdf | Bin 0 -> 34839 bytes 462/CH2/EX2.11.a/ex_2_11_a.sce | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 462/CH2/EX2.11.a/ex_2_11_a.pdf create mode 100755 462/CH2/EX2.11.a/ex_2_11_a.sce (limited to '462/CH2/EX2.11.a') diff --git a/462/CH2/EX2.11.a/ex_2_11_a.pdf b/462/CH2/EX2.11.a/ex_2_11_a.pdf new file mode 100755 index 000000000..c5655a9a6 Binary files /dev/null and b/462/CH2/EX2.11.a/ex_2_11_a.pdf differ diff --git a/462/CH2/EX2.11.a/ex_2_11_a.sce b/462/CH2/EX2.11.a/ex_2_11_a.sce new file mode 100755 index 000000000..9fb07532f --- /dev/null +++ b/462/CH2/EX2.11.a/ex_2_11_a.sce @@ -0,0 +1,18 @@ +//example 2.11(a)// +//find 2's complement of binary number// +clc +//clears the window// +clear +//clears all the existing variables// +x=01100100 +//the number// +xd=bin2dec('01100100') +//binary to decimal conversion// +xc=bitcmp(xd,8) +//one's complement of the number// +xp=xc+1 +xc1=dec2bin(xp) +//2's complement of the number// +disp('2s complement of 01100100 is : ') +disp(xc1) +//answer in 2's complement form// \ No newline at end of file -- cgit