summaryrefslogtreecommitdiff
path: root/3544/CH3/EX3.2.1.1/Ex3_2_1_1.sce
blob: 4f58d7a34deb78ff83d8f1f473734076e9beb594 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)))