# S-Registers

Understanding Bit-Mapped S-Registers

A bit-mapped S-Register uses one number to describe a collection of settings. Bit-mapping allows us to pack a lot of information in a small space.

Bit-mapped registers are in the form of Sr.b=n, where r is the bit-mapped register;.b is the bit; n is 0 (off) or 1 (on).

The modem displays the value of an S-Register, as a decimal value between 0 and 255. The modem, however, understands the decimal value as a collection of binary digits (bits).

How bits are mapped to decimal values

Bits can be mapped into decimal values. Each bit can be either on (1) or off (0). Eight bits create 256 unique combinations of 1s and 0s. Each of the eight bits can be assigned a number corresponding to its position:

b b b b b b b b
7 6 5 4 3 2 1 0

Also, each bit can be assigned a value corresponding to its number (e.g., the value equals 2 to the power of the bit):

 Bit Value 7 128 6 64 5 32 4 16 3 8 2 4 1 2 0 1

Converting Bits to Decimal Values

Starting with a string of eight bits, assign each "1" bit a value based on its position. Add the values to come up with the final decimal value.

Here’s an example of how bits are converted to decimal values:

01001111

 0 1 0 0 1 1 1 1 0 + 64 + 0 + 0 + 8 + 4 + 2 + 1 = 79

Converting Decimal Values to Bits

Convert decimal values to bits by finding the largest decimal equivalent that is less than the decimal value. Subtract the decimal equivalent and mark the equivalent bit "1." Continue until the decimal value is zero. See the example below.

113
113 - 64 = 49
01
49 -32 = 17
011
17 -16 = 1
0111
1 -1 = 0
01110001

Setting Bit-Mapped S-Registers

You can set bit-mapped S-Registers using either bits or decimal values. While it may be simpler for you to set the bits individually, your modem displays the S-Register settings in decimal form.

Using Bits

Turning individual bits on and off is the more direct way to set bit-mapped S-Registers. To do this, specify the S-Register that you want to set and then indicate which bits you want to turn on (1) or off (0).

Example: ATS13.0=1.4=1.5=1, turns bits 0, 4, and 5 on for S-Register 13.

Using Decimal Values

An alternative way to set bit-mapped S-Registers is by adding the decimal values of the bits and entering the total.

This example, ATS13=49, sets the same value as the one in Using Bits above.