"Contains" operation for bitstring
aa=$zwc(411,1,1,3)/*$bit(1,3,5)*/
bb=$zwc(403,1,0,2)/*$bit(1,3)*/
Is there a handy function to test wether one bit string is covered by another one bitstring? For example, "bb" is covered by "aa".
I currently implement this by one AND operation and then do a bitcount, I just want to know any default function is already out there.
Thanks.
Discussion (3)0
Comments
I think bitlogic operations is the best which you can use with bitstring.
Docs.
something like this would work:
s contains=($BITLOGIC(aa|bb)=aa)||($BITLOGIC(aa|bb)=bb)
You could also implement it with
w ($ZB(aa,bb,7)=bb)||($ZB(aa,bb,7)=aa)