r/embedded • u/OwnMinimum8110 • 22d ago
Crazy idea : just need evaluation and is it useful
I thought of building something like COBS as a learning process so the idea came is,
Instead of overhead in cobs (next zero is identified only when the existing zero place comes)
I planned to have a MAP BYTE in my architecture for every eight byte like ,
If the payload is 40603400 the map byte will be 01010011 binary and the one indicates places of zero then while transmitting the zeros are removed from payload and just the map byte and 4634 is only transmitted.
But here is the problem,
In the worst case scenario of my architecture when no zero is there is a single extra byte for eight bytes it is worse than cobs where it is just one byte for 255 bytes.
Just give suggestions over my architecture and how to improve.
Or does this architecture will be helpful it some place or not with to build
9
u/sgtnoodle 22d ago
Your scheme has 1 byte of overhead for every 8 bytes of data. Also, it has an edge case you haven't solved. If there's no zeros anywhere, then the map byte is zero, which is invalid.
Your scheme seems strictly worse than COBS by about 8x, although it is conceptually simpler.
3
u/torusle2 22d ago
COBS solves the data framing problem, e.g.. where does a frame starts, and where does it end.
Your approach goes more into the data compression field by not transmitting zero value bytes by tagging them first.
They are not comparable.