|
Hi Klaus, Thanks for the clarification. There is certainly nothing wrong with designing the "how" rather than the "what" - the main point is to understand that the FN only intends to specify the "what". This is intentional, to allow the implementer as much freedom as possible. Originally we developed an engine which would take an FN description and automatically provide compression and decompression, meaning that you could get a reference solution without specifying the "how" part. However, this was a lot of work to maintain so we abandoned it. For reference, with real protocols where the operators used are non-invertible, look-up tables are very useful (and also fast). Although the individual operators used may be many-to-one as with modulo, the overall mapping must be one-to-one, so a lookup table is a nice solution. Of course scalability is an issue - for this example though the tables are small enough to sit in L1 cache so offer a good solution. Partly this depends on your architecture, but typically modulo consumes a lot of clock cycles. Thanks again for the input. All the best Raffles Klaus Warnke wrote: Hi Raffles, I tried to implement this encoding: ENFORCE(sequence_no.UVALUE == (scaled_seq_no.UVALUE * 3) % 16); I saw, it is easy to calculate the sequence_no.UVALUE from then scaled_seq_no.UVALUE, because the formula can be used 1:1. But if I want to calculate the scaled_seq_no.UVALUE from the sequence_no.UVALUE, I can't see how here. Did I oversaw something? So I restructured the formula, which was not so easy to me, because there is no inverse for the "%" operator. So I wanted to share this, maybe it is helpful for other developers. -- Raffles (Robert Finking) m: 0789 463 9887 e: raffles at gluft.com w: gluft.com O O OOOOOO O O O OOOOOO OOOOO O O O O O OOOOO O OOOOOO O OOOOOO O O OOOOOO we care about software ----------------------------------------------------------------- Gluft Ltd. Registered No.: 6795336 The information contained in this e-mail and any attachments is proprietary to Gluft Ltd and must not be passed to any third party without permission. This communication is for information only and shall not create or change any contractual relationship. Please consider the environment before printing. Thank you. ----------------------------------------------------------------- |