Icon Quaternion Weighted Average


Icon BVHView


Icon Dead Blending Node in Unreal Engine


Icon Propagating Velocities through Animation Systems


Icon Cubic Interpolation of Quaternions


Icon Dead Blending


Icon Perfect Tracking with Springs


Icon Creating Looping Animations from Motion Capture


Icon My Favourite Things


Icon Inertialization Transition Cost


Icon Scalar Velocity


Icon Tags, Ranges and Masks


Icon Fitting Code Driven Displacement


Icon atoi and Trillions of Whales


Icon SuperTrack: Motion Tracking for Physically Simulated Characters using Supervised Learning


Icon Joint Limits


Icon Code vs Data Driven Displacement


Icon Exponential Map, Angle Axis, and Angular Velocity


Icon Encoding Events for Neural Networks


Icon Visualizing Rotation Spaces


Icon Spring-It-On: The Game Developer's Spring-Roll-Call


Icon Interviewing Advice from the Other Side of the Table


Icon Saguaro


Icon Learned Motion Matching


Icon Why Can't I Reproduce Their Results?


Icon Latinendian vs Arabendian


Icon Machine Learning, Kolmogorov Complexity, and Squishy Bunnies


Icon Subspace Neural Physics: Fast Data-Driven Interactive Simulation


Icon Software for Rent


Icon Naraleian Caterpillars


Icon The Scientific Method is a Virus


Icon Local Minima, Saddle Points, and Plateaus


Icon Robust Solving of Optical Motion Capture Data by Denoising


Icon Simple Concurrency in Python


Icon The Software Thief


Icon ASCII : A Love Letter


Icon My Neural Network isn't working! What should I do?


Icon Phase-Functioned Neural Networks for Character Control


Icon 17 Line Markov Chain


Icon 14 Character Random Number Generator


Icon Simple Two Joint IK


Icon Generating Icons with Pixel Sorting


Icon Neural Network Ambient Occlusion


Icon Three Short Stories about the East Coast Main Line


Icon The New Alphabet


Icon "The Color Munifni Exists"


Icon A Deep Learning Framework For Character Motion Synthesis and Editing


Icon The Halting Problem and The Moral Arbitrator


Icon The Witness


Icon Four Seasons Crisp Omelette


Icon At the Bottom of the Elevator


Icon Tracing Functions in Python


Icon Still Things and Moving Things


Icon water.cpp


Icon Making Poetry in Piet


Icon Learning Motion Manifolds with Convolutional Autoencoders


Icon Learning an Inverse Rig Mapping for Character Animation


Icon Infinity Doesn't Exist


Icon Polyconf


Icon Raleigh


Icon The Skagerrak


Icon Printing a Stack Trace with MinGW


Icon The Border Pines


Icon You could have invented Parser Combinators


Icon Ready for the Fight


Icon Earthbound


Icon Turing Drawings


Icon Lost Child Announcement


Icon Shelter


Icon Data Science, how hard can it be?


Icon Denki Furo


Icon In Defence of the Unitype


Icon Maya Velocity Node


Icon Sandy Denny


Icon What type of Machine is the C Preprocessor?


Icon Which AI is more human?


Icon Gone Home


Icon Thoughts on Japan


Icon Can Computers Think?


Icon Counting Sheep & Infinity


Icon How Nature Builds Computers


Icon Painkillers


Icon Correct Box Sphere Intersection


Icon Avoiding Shader Conditionals


Icon Writing Portable OpenGL


Icon The Only Cable Car in Ireland


Icon Is the C Preprocessor Turing Complete?


Icon The aesthetics of code


Icon Issues with SDL on iOS and Android


Icon How I learned to stop worrying and love statistics


Icon PyMark


Icon AutoC Tools


Icon Scripting xNormal with Python


Icon Six Myths About Ray Tracing


Icon The Web Giants Will Fall


Icon PyAutoC


Icon The Pirate Song


Icon Dear Esther


Icon Unsharp Anti Aliasing


Icon The First Boy


Icon Parallel programming isn't hard, optimisation is.


Icon Skyrim


Icon Recognizing a language is solving a problem


Icon Could an animal learn to program?




Icon Pure Depth SSAO


Icon Synchronized in Python


Icon 3d Printing


Icon Real Time Graphics is Virtual Reality


Icon Painting Style Renderer


Icon A very hard problem


Icon Indie Development vs Modding


Icon Corange


Icon 3ds Max PLY Exporter


Icon A Case for the Technical Artist


Icon Enums


Icon Scorpions have won evolution


Icon Dirt and Ashes


Icon Lazy Python


Icon Subdivision Modelling


Icon The Owl


Icon Mouse Traps


Icon Updated Art Reel


Icon Tech Reel


Icon Graphics Aren't the Enemy


Icon On Being A Games Artist


Icon The Bluebird


Icon Everything2


Icon Duck Engine


Icon Boarding Preview


Icon Sailing Preview


Icon Exodus Village Flyover


Icon Art Reel




Icon One Cat Just Leads To Another

Latinendian vs Arabendian

Created on Feb. 16, 2020, 1:26 p.m.

Let's say we have a string like cat which we want to write to a file. How do we actually write this down in terms of binary data?

Well, assuming we have an ASCII string, each character is represented by a single byte - an integer between 0 and 255 - which can be converted to binary and written to the file one by one.

                               c        a        t
                              99       97      116
                        01100011 01100001 01110100

So far so good, but what if instead we have a larger number like, let's say 134480385. This number doesn't fit into a single byte. One thing we could do is split it into multiple parts each the length of a byte.

                    00001000 00000100 00000010 00000001
                      part 4   part 3   part 2   part 1

Then we can write it down part by part:

               c        a        t                           134480385
              99       97      116
        01100011 01100001 01110100 00000001 00000010 00000100 00001000  

But wait a second, what happened? It seems that after we wrote it down the order of the bytes was reversed. The problem is we've written the number starting with part 1 on the right (the so called "least significant byte") and moved to the left writing each part in turn, reversing the order. But now we can't read it like a normal binary number any more because the bits are all messed up...

Well we could reverse the individual bits in the number too and tell people to read it all from left to right - then it would read correctly as a binary number in some sense, but perhaps we'd have to reverse bits every time we read and write a number. Also, it may be hard for programmers or other people reading the data to know that the bits are in the opposite order to what they expected. That seems like a good recipe for confusion.

Alternatively, we could write the parts in the opposite order starting with part 4 - the most significant byte. In this case the number would read correctly and the order of bits would be as expected, but, we would basically need to know ahead of time how large a number was if we were reading or writing it. In addition, converting between different sizes of integers such as 8-bit, 16-bit, and 32-bit would required shifting around bytes and putting in zeros to set all the bits in the right place rather than just adjusting how many bytes we read or write.

This debate, of which order to read or write the bytes, is the so called big-endian vs little-endian debate you may have heard of. Here, big-endian meaning starting with part 4 and little-endian meaning starting with part 1. And, if you're curious, most likely your machine is little-endian while the data you send over the network, for example, is probably big-endian.

                        big-endian                134480385
                        00001000 00000100 00000010 00000001

                        little-endian             134480385
                        00000001 00000010 00000100 00001000

But before you pick a side, perhaps it's worth finding out where this confusion comes from in the first place. Shouldn't writing down numbers be a relatively simple and solved problem? Well - interestingly, it has nothing to do with binary, bytes, or even computers - the problem comes from the fact that while our letters are Latin, our numerals are Arabic.

More specifically, while we inherited our text from latin, and so read characters and words from left to right, early European translators of the Arabic books from which we get our numerals (and where the text goes from right to left) reversed the ordering of words but kept the ordering of the symbols in numerals the same. While a European and someone who reads Arabic both write the number 521 with the same order of numerals, a European reads it as "five-hundred, and twenty one" - while (in formal Arabic at least) the same number is read as "one, twenty, and five hundred"[0][1].

Binary numbers are no different - just as decimal numbers are written with the smallest unit on the right and the largest on the left, binary numbers are the same, and when we try to read or write them we encounter the same confusion in ordering where mindlessly writing what you encounter from left to right doesn't work if you want to write the least significant thing first.

If we reversed the order in which we wrote numerals (or letters for that matter) there wouldn't be any more endian wars - everything would be consistent - we'd always write the least significant thing first, and then the only war left to fight would be on the choice of left-to-right or right-to-left for everything - Latinendian vs Arabendian?

github twitter rss