The easy fantastic thing about XOR floating level compression « Adafruit Industries – Makers, hackers, artists, designers and engineers!

[ad_1]

Clemens Winter discusses compression in an inventory of floating level numbers.

I not too long ago carried out a small program to visualise the internal workings of a scheme that compresses floating level time sequence by XORing subsequent values. The ensuing visualizations are fairly neat and made it a lot simpler for me to know this stunning algorithm than any of the reasons that I had beforehand encountered.

The algorithm is straightforward. We begin by writing out the primary floating level quantity in full. All subsequent numbers are XORed with the earlier quantity after which encoded in certainly one of 3 ways:

We write a single 0 bit. This means that the quantity is similar to the earlier quantity.
We write the 2 bit sequence 11. We write a 5 bit integer that signifies the variety of main zeros within the XORed worth. We write a 6 bit integer that signifies the variety of bits within the subsequence that begins on the first 1 bit and consists of and ends on the final 1 bit. We then write out this subsequence, omitting all main and trailing zeros.
We write the 2 bit sequence 10. We then instantly write out the subsequence of the XORed worth that has the identical beginning index and size because the final subsequence we wrote.

Try the small print within the publish right here.

 

Adafruit publishes a variety of writing and video content material, together with interviews and reporting on the maker market and the broader know-how world. Our requirements web page is meant as a information to greatest practices that Adafruit makes use of, in addition to an overview of the moral requirements Adafruit aspires to. Whereas Adafruit will not be an impartial journalistic establishment, Adafruit strives to be a good, informative, and constructive voice inside the group – test it out right here: adafruit.com/editorialstandards

Join Adafruit on Mastodon

Adafruit is on Mastodon, take part! adafruit.com/mastodon

Cease breadboarding and soldering – begin making instantly! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and extra. Construct initiatives with Circuit Playground in a couple of minutes with the drag-and-drop MakeCode programming website, be taught laptop science utilizing the CS Discoveries class on code.org, bounce into CircuitPython to be taught Python and {hardware} collectively, TinyGO, and even use the Arduino IDE. Circuit Playground Categorical is the most recent and greatest Circuit Playground board, with assist for CircuitPython, MakeCode, and Arduino. It has a strong processor, 10 NeoPixels, mini speaker, InfraRed obtain and transmit, two buttons, a swap, 14 alligator clip pads, and many sensors: capacitive contact, IR proximity, temperature, mild, movement and sound. A complete huge world of electronics and coding is ready for you, and it matches within the palm of your hand.

Have a tremendous undertaking to share? The Electronics Present and Inform is each Wednesday at 7pm ET! To affix, head over to YouTube and take a look at the present’s dwell chat – we’ll publish the hyperlink there.

Be a part of us each Wednesday night time at 8pm ET for Ask an Engineer!

Be a part of over 36,000+ makers on Adafruit’s Discord channels and be a part of the group! http://adafru.it/discord

CircuitPython – The best technique to program microcontrollers – CircuitPython.org

Get the one spam-free every day publication about wearables, operating a “maker enterprise”, digital ideas and extra! Subscribe at AdafruitDaily.com !

No feedback but.

Adafruit has a “be wonderful to one another” remark coverage. Assist us maintain the group right here constructive and useful. Persist with the subject, be respectful of makers of all ages and ability ranges. Be type, and do not spam – Thanks!

[ad_2]

Supply hyperlink

Offers: Samsung Galaxy Tab S6 Lite (2024) launches, listed here are some alternate options too

3D Printing Webinar and Occasion Roundup: April 14, 2024