Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1754067
  • 博文数量: 413
  • 博客积分: 8399
  • 博客等级: 中将
  • 技术积分: 4325
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-09 10:44
文章分类

全部博文(413)

文章存档

2015年(1)

2014年(18)

2013年(39)

2012年(163)

2011年(192)

分类: C/C++

2011-09-08 10:28:53

In computingbit numbering (or sometimes bit endianness) is the convention used to identify the bit positions in a binary number or a container for such a value. The bit number starts with zero and is incremented by one for each subsequent bit position.
LSB 0 bit numbering
LSB 0: A container for 8-bit binary number with the highlighted least significant bit assigned the bit number 0

When the bit numbering starts at zero for the least significant bit the numbering scheme is called "LSB 0".[1] This bit numbering method has the advantage that for any unsigned integral data type the value of the number can be calculated by usingexponentiation with the bit number and a base of 2.



MSB 0 bit numbering

MSB 0:A container for 8-bit binary number with the highlighted most significant bit assigned the bit number 0

Similarly, when the bit numbering starts at zero for the most significant bit the numbering scheme is called "MSB 0".



Usage

Little-endian CPUs usually employ "LSB 0" bit numbering, however both bit numbering conventions can be seen in big-endian machines. 

Some architectures like SPARC and Motorola 68000 use "LSB 0" bit numbering, while S/390, PowerPC and PA-RISCuse "MSB 0".[2]

The recommended style for Request for Comments documents is "MSB 0" bit numbering.[3]

Bit numbering is usually transparent to the software, but some programming languages like Ada allow specifying the appropriate bit order for data type representation.[4]

阅读(1607) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~