beautypg.com

B - number systems, hex mask, Binary numbers, Positive decimal values – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 449: Number systems, hex mask

background image

B

Appendix

B–1

Number Systems, Hex Mask

This appendix:

describes the different number systems you need to understand for use of
the HHT with SLC 500 family controllers

covers binary, Binary Coded Decimal (BCD), and hexadecimal.

explains the use of a Hex mask used to filter data in certain programming
instructions

The processor memory stores 16-bit binary numbers. As indicated in the
figure below, each position in the number has a decimal value, beginning at
the right with 2

0

and ending at the left with 2

15

.

Each position can be 0 or 1 in the processor memory. A 0 indicates a value of
0 at that position; a 1 indicates the decimal value of the position. The
equivalent decimal value of the binary number is the sum of the position
values.

Positive Decimal Values

The far left position is always 0 for positive values. As indicated in the figure
below, this limits the maximum positive decimal value to 32767. All
positions are 1 except the far left position.

1x2

14

= 16384

1x2

13

= 8192

1x2

12

= 4096

1x2

11

= 2048

1x2

10

= 1024

1x2

9

= 512

1x2

8

= 256

1x2

7

= 128

1x2

6

= 64

1x2

5

= 32

1x2

4

= 16

1x2

3

= 8

1x2

2

= 4

1x2

1

= 2

1x2

0

= 1

1

0

1 1

1

1

1 1

1

1

1 1

1

1

1 1

16384

8192
4096
2048
1024

512
256
128

64
32
16

8
4
2
1

32767

0x2

15

= 0

This position is always zero for positive numbers.

+

The binary number may also be converted to decimal as follows:

16 bit pattern = 0111111111111111

2

=

2

14

+ 2

13

+ 2

12

+ 2

11

+ 2

10

+ 2

9

+ 2

8

+ 2

7

+ 2

6

+ 2

5

+ 2

4

+ 2

3

+ 2

2

+ 2

1

+ 2

0

= 16384

+

8192

+

4096

+

2048

+

1024

+

512

+

256

+

128

+

64

+

32

+

16

+

8

+

4

+

2

+

0

= 32767

Binary Numbers