Written by

Question CJ H · Nov 27, 2017

"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.

Comments

Dmitry Maslennikov · Nov 27, 2017

I think bitlogic operations is the best which you can use with bitstring. 

0
Fabian Haupt · Nov 29, 2017

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)

0