What is “bit padding” or “padding bits” exactly?

后端 未结 4 1579
梦谈多话
梦谈多话 2020-12-18 17:16

I do not want to molest you with this, but i just can not find anywhere in the internet a well-described explanation for what "bit padding" really is, as well as n

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 17:32

    bit padding:
    Bit padding is the addition of one or more extra bits to a transmission or storage unit to make it conform to a standard size.

    As the definition you posted is already correct, I'll try to explain with an example:

    Suppose you have to store data that occupies less than 32 bits but you have 4 byte slots. It is easier to access that data by accessing to each slot, so you just have to complete all the 32 bits. The additional bits needed to complete 'the given space' but which are not part of the data conform the bit padding.

    I'm sure there may be better examples of this in multiple contexts. Anybody, feel free to edit and/or complete the answer with new improvements or examples.

    Hope this helps!

提交回复
热议问题