Masked Compare Word (MSKCMPW) Function 143
Masked Compare Dword (MSCCMPD) Function 144
The Masked Compare function is used to compare the contents of two bit strings with
the ability to mask selected bits. The length of the bit strings to be compared is specified
by the LEN parameter where the value of LEN specifies the number of 16 bit words for
MSKCMPW and 32 bit words for MSKCMPD.
When the logic controlling the enable input to the function passes power flow to the
enable (EN) input, the function begins comparing the bits in the first string with the cor-
responding bits in the second. Comparison continues until a miscompare is found, or
until the end of the string is reached.
The BIT input is used to store the bit number where the next comparison should start
where a 0 indicates the first bit in the string. The BN output is used to store the bit num-
ber where the last comparison occurred where a 1 indicates the first bit in the string.
Using the same reference for BIT and BN causes the compare to start at the next bit posi-
tion after a miscompare or at the beginning if all bits compared successfully upon the
next invocation of the function block.
If you want to start the next comparison at some other location in the string, you can
enter different references for BIT and BN. If the value of BIT is a location that is beyond
the end of the string, BIT is reset to a 0 before starting the next comparison.
IF all Bits in I1 and I2 are the Same
If all corresponding bits in strings I1 and I2 match, the function sets the ”miscompare”
output MC to 0 and BN to the highest bit number in the input strings. The comparison
then stops. On the next invocation of MSKCMPW, it will be reset to 0.
If a Miscompare is Found
When the two bits currently being compared are not the same, the function then checks
the correspondingly-numbered bit in string M (the mask). If the mask bit is a 1, the com-
parison continues until another miscompare or the end of the input strings is reached.
If a miscompare is detected and the corresponding mask bit is a 0, the function:
1. Sets the corresponding mask bit in M to a 1.
2. Sets the miscompare (MC) output to 1.
3. Updates the output bit string Q to match the new content of mask string M.
4. Sets the bit number output (BN) to the number of the miscompared bit.
5. Stops the comparison.
Warning: include_once(/js/tracking.php): failed to open stream: No such file or directory in /var/www/series/revision.php on line 248
Warning: include_once(): Failed opening '/js/tracking.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/series/revision.php on line 248