summaryrefslogtreecommitdiff
path: root/1241/CH2/EX2.33/exa2_33.sce
diff options
context:
space:
mode:
Diffstat (limited to '1241/CH2/EX2.33/exa2_33.sce')
-rwxr-xr-x1241/CH2/EX2.33/exa2_33.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/1241/CH2/EX2.33/exa2_33.sce b/1241/CH2/EX2.33/exa2_33.sce
new file mode 100755
index 000000000..175b26f37
--- /dev/null
+++ b/1241/CH2/EX2.33/exa2_33.sce
@@ -0,0 +1,16 @@
+//Example 2-33//
+// -4 in two’s complement form by second method//
+clc
+//clears the window//
+clear
+//clears all existing variables//
+x=bitcmp(4,8)
+//complement of the decimal number 4(8 bit representation)//
+y=1
+z=x+y
+//1 is added to the complement//
+a=dec2bin(z)
+//binary conversion of the decimal number//
+disp(' -4 in two’s complement form is: ')
+disp(a)
+//result is displayed//