HTBasic Help
×
Menu
Index

BINIMP

Performs a bit by bit implication operation.
 
 BINIMP( arg, arg )
 
Where:
arg = numeric-expression rounded to an INTEGER
 
Usage:
K=BINIMP(Var,&O377)
I=BINIMP(12,J)
 
Example:     BINIMP.BAS
 
Description:
The result of BINIMP(A,B) is calculated by converting A and B to integer values. Then each bit of the result is set to 1 or 0 depending on the corresponding bits in A and B. The following truth table defines the implication operation:
 
A
B
BINIMP(A,B)
0
0
1
0
1
1
1
0
0
1
1
1
 
Note that the operation is not commutative. That is, BINIMP(A,B) <> BINIMP(B,A).
 
The following example performs a bit by bit implication of 12 and 6:
 
BINIMP(12,6)
 
12           = 0000000000001100
6            = 0000000000000110
BINIMP(12,6) = 1111111111110111
 
The resulting binary number represents -9.
 
See Also: