# What is this array-like notation of registers in datasheets?

I am reading BMP280 datasheet (pressure&temperature sensor). On different pages they use the following notation: $$register\text{_}name[a:b]$$ where a, b are integers. For example, on page 13 "Enabling/disabling the temperature measurement and oversampling setting are selected through the osrs_t[2:0] bits in control register 0xF4".

How to interpret this notation?

• In x86 microcode descriptions we would say its bits 2, 1 and 0. Might be the same in their notation. – PlasmaHH Aug 9 '18 at 11:19
• @PlasmaHH, from left to right? So [a:b] means b, b+1, ..., a bits? – Turkhan Badalov Aug 9 '18 at 11:20
• Bit 2:0 means bits 0 to 2. There's no "left and right", there's the LSB which is bit 0 and then count from there. – Lundin Aug 9 '18 at 11:21
• These are the notations borrowed from the chip design language, Verilog or VHDL. Marketing and technical writers just use them for simplicity and convenience. – Ale..chenski Aug 9 '18 at 16:56
• @AliChen - did you know that VHDL was originally conceived as a way of describing the behaviour of existing chips, not as a way of designing them? This is precisely the kind of application VHDL was originally supposed to be used for. – Jules Aug 9 '18 at 18:00

## 2 Answers

Those denote the bits within the register.

The bits are number 7, 6, 5, 4, 3, 2, 1, 0 so register 0xF4 is build up:

Control register 0xF4 bits: 7 6 5 4 3 2 1 0
<--->
osrs_t bits


In <----> you can set the temperature measurement and oversampling setting (osrs_t).

In Table 5 of page 13 you can see exactly the values and their meaning for these 3 bits:

If osrs_t would be stored in the MSB first 3 bits it would be mentioned as osrs_t[7:5], and if the entire byte is used, normally the [] will not be shown.

It very likely means bits. osrs_t[2:0] would mean selected through bits 0, 1 and 2.

• It is not "likely", it is with 110% confidence. – Ale..chenski Aug 9 '18 at 18:27
• @AliChen: Unless it's an IBM document. Then it means bits 31, 30, and 29 or bits 63, 62, and 61. ;-) – R.. Aug 9 '18 at 18:44
• @R.., that's probably why their hardware is out of business :-( – Ale..chenski Aug 9 '18 at 20:09
• @R.. I did actually have the dysfunctional PowerPC hardware manuals in mind when I wrote "very likely". – Lundin Aug 10 '18 at 6:34