1 03/31/83  bool
 2 
 3 Syntax:  bool B1 B2 B3
 4 
 5 
 6 Syntax as active function:  [bool B1 B2 B3]
 7 
 8 
 9 Function:  performs bit string operations on character string
10 representations of bit strings.
11 
12 
13 Arguments:
14 B1, B2, and B3
15    are bit strings entered as 0 and 1 characters.
16 
17    B3 must be four bits long.  It causes the following logical
18    operations to be performed on B1 and B2.
19 
20    B3        Name                Result
21    --        ----                ------
22    0000      clear               all zeroes
23    0001      and                 B1 & B2
24    0010                          B1 &^B2
25    0011      move B1             B1
26    0100                          ^B1 & B2
27    0101      move B2             B2
28 
29 
30    0110      xor                 (B1&^B2) | (^B1&B2)
31    0111      or                  B1 | B2
32    1000      ^or                 ^(B1|B2) = (^B1&^B2)
33    1001      ^xor                ^((B1&^B2) | (^B1&B2)) = (^B1|B2) &
34                                    (B1|^B2)
35    1010      invert B2           ^B2
36    1011                          ^(^B1&B2) = (B1|^B2)
37    1100      invert B1           ^B1
38    1101                          ^(B1&^B2) = (^B1|B2)
39    1110      ^and                ^(B1&B2) = (^B1|^B2)
40    1111      ^clear              all ones
41 
42 
43 Notes:  The shorter of the two strings is extended at the right with
44 zeroes to equal the length of the longer string.