MSB/LSB(big endian/little endian)
生活随笔
收集整理的這篇文章主要介紹了
MSB/LSB(big endian/little endian)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
- 1、什么是MSB/LSB(big endian/little endian)
- 2、python解析時二進制文件時注意大小端問題
- 3、舉例:
1、什么是MSB/LSB(big endian/little endian)
LSB(Least Significant Bit),意為最低有效位。
MSB(Most Significant Bit),意為最高有效位。若MSB=1,則表示數據為負值,若MSB=0,則表示數據為正。
兩大CPU派系指定的是Motorola的PowerPC系列CPU和Intel的x86系列CPU。PowerPC系列采用big endian方式存儲數據,而x86系列則采用little endian方式存儲數據。
小端字節序(little endian):低字節存于內存低地址,高字節存于內存高地址,對應LSB。
大端字節序(big endian):高字節存于內存低地址,低字節存于內存高地址,對應MSB。
例如一個數據0x0102,01是高位,02是低位。
總結
以上是生活随笔為你收集整理的MSB/LSB(big endian/little endian)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 卸载python重新安装_Python卸
- 下一篇: 基于arduino uno 开发板制作的