contents.gifindex.gif

Test Vectors - BINBCD

The test vectors verify the operation of LT22 and GT16 by assigning various values for Score, checking the results

The test vectors for the BCD converter are defined by the following macro:

test_vectors ( score - [bcd2,bcd1])
clear (binary);
@repeat 32 { binary - [binary/10,binary%10];
inc(binary);}

This macro a test vector with variable binary set to 0 by the macro :

(a) {@const ?a=0};

followed by 31 vectors provided by the @repeat directive. The 31 vectors are generated by incrementing the value of the variable binary by 1 for each vector. On the output side of the test vectors, division is used to create the output for bcd2, while the remainder (modulus) operator is used to create the output for bcd1.