summaryrefslogtreecommitdiff
path: root/3544/CH3/EX3.2.1.1
diff options
context:
space:
mode:
Diffstat (limited to '3544/CH3/EX3.2.1.1')
-rw-r--r--3544/CH3/EX3.2.1.1/Ex3_2_1_1.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/3544/CH3/EX3.2.1.1/Ex3_2_1_1.sce b/3544/CH3/EX3.2.1.1/Ex3_2_1_1.sce
new file mode 100644
index 000000000..4f58d7a34
--- /dev/null
+++ b/3544/CH3/EX3.2.1.1/Ex3_2_1_1.sce
@@ -0,0 +1,16 @@
+
+//Example XOR operations
+
+A = bin2dec("101")
+printf("A: %s\n\n",dec2bin(A))
+B = bin2dec("110")
+printf("B: %s\n\n",dec2bin(B))
+
+C = bitxor(A,B)
+printf("C: %3s\n\n",dec2bin(C))
+
+disp("C XOR A")
+disp(dec2bin(bitxor(C,A)))
+
+disp("C XOR B")
+disp(dec2bin(bitxor(C,B)))