Engee checksum calculation¶
Let's generate the CRC-8 checksum for the example from 802.11-2016 in section 21.3.10.3 and compare it to the expected checksum.
Model description¶
To implement a variant of the checksum algorithm set out in the 802.11-2016 standard, let's configure the General CRC Generator
block to work with the polynomial $z^8 + z^2 + z + 1$, set the initial bit state to 1, set the XOR bit to 1 and select the direct method.
The simulation length is 0, i.e. one input message from the block Input
will be processed. This block is given as an example in 802.11-2016 section 21.3.10.3. The message includes bits {m0, .... m22} with values [1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1], the expected checksum for them {c7, ..., c0} is [0 0 0 0 1 1 1 0 0 0]. The model has blocks for bitwise comparison of the calculated and expected checksum. Each time the comparator input matches the checksum stored in it, the corresponding output bit takes the value 1
.
model_name = "generate_crc_8_checksum";
model_name in [m.name for m in engee.get_all_models()] ? engee.open(model_name) : engee.load( "$(@__DIR__)/$(model_name).engee");
res = engee.run( model_name );
collect(res["comparedOut"]).value[end]
Conclusion¶
We have verified the operation of the General CRC Generator
block and implemented the checksum calculation according to 802.11-2016.