summaryrefslogtreecommitdiff
path: root/462/CH2/EX2.10.a
diff options
context:
space:
mode:
Diffstat (limited to '462/CH2/EX2.10.a')
-rwxr-xr-x462/CH2/EX2.10.a/ex_2_10_a.pdfbin0 -> 35271 bytes
-rwxr-xr-x462/CH2/EX2.10.a/ex_2_10_a.sce18
2 files changed, 18 insertions, 0 deletions
diff --git a/462/CH2/EX2.10.a/ex_2_10_a.pdf b/462/CH2/EX2.10.a/ex_2_10_a.pdf
new file mode 100755
index 000000000..119116b5b
--- /dev/null
+++ b/462/CH2/EX2.10.a/ex_2_10_a.pdf
Binary files differ
diff --git a/462/CH2/EX2.10.a/ex_2_10_a.sce b/462/CH2/EX2.10.a/ex_2_10_a.sce
new file mode 100755
index 000000000..77b217f90
--- /dev/null
+++ b/462/CH2/EX2.10.a/ex_2_10_a.sce
@@ -0,0 +1,18 @@
+//example 2.10(a)//
+//find 2's complement of binary number//
+clc
+//clears the window//
+clear
+//clears all the existing variables//
+x=01001110
+//the number//
+xd=bin2dec('01001110')
+//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 01001110 is : ')
+disp(xc1)
+//answer in 2's complement form// \ No newline at end of file