V-Memory; Binary-Coded Decimal Numbers; Hexadecimal Numbers - Automationdirect.com DirectLOGIC DL205 Series User Manual

Table of Contents

Advertisement

Chapter 3: CPU Specifications and Operations
V–Memory
1
Variable memory (called "V-memory") stores data for the ladder program and for configuration settings.
V-memory locations and V-memory addresses are the same thing, and are numbered in octal. For
example, V2073 is a valid location, while V1983 is not valid ("9" and "8" are not valid octal digits).
2
Each V-memory location is one data word wide, meaning 16 bits. For configuration registers, our manuals will
show each bit of a V-memory word. The least significant bit (LSB) will be on the right, and the most significant bit
3
(MSB) on the left. We use the word "significant," referring to the relative binary weighting of the bits.
4
5
V-memory data is 16-bit binary, but we rarely program the data registers one bit at a time. We use
instructions or viewing tools that let us work with binary, decimal, octal, and hexadecimal numbers. All
6
these are converted and stored as binary for us. A frequently-asked question is "How do I tell if a number is
binary, octal, BCD, or hex"? The answer is that we usually cannot tell by looking at the data, but it does not
7
really matter. What matters is: the source or mechanism which writes data into a V-memory location and
the thing which later reads it must both use the same data type (i.e., octal, hex, binary, or whatever). The V-
memory location is a storage box... that's all. It does not convert or move the data on its own.
8

Binary-Coded Decimal Numbers

Since humans naturally count in decimal, we prefer to enter and view PLC data in decimal as well (via
9
operator interfaces). However, computers are more efficient in using pure binary numbers. A compromise
solution between the two is Binary-Coded Decimal (BCD) representation. A BCD digit ranges from 0 to
10
9, and is stored as four binary bits (a nibble). This permits each V-memory location to store four BCD
digits, with a range of decimal numbers from 0000 to 9999.
11
12
In a pure binary sense, a 16-bit word represents numbers from 0 to 65535. In storing BCD numbers, the
range is reduced to 0 to 9999. Many math instructions use BCD data, and DirectSOFT and the handheld
13
programmer allow us to enter and view data in BCD. Special RLL instructions convert from BCD to
binary, or visa–versa.
14

Hexadecimal Numbers

Hexadecimal numbers are similar to BCD numbers, except they utilize all possible binary values in each 4-
A
bit digit. They are base-16 numbers so we need 16 different digits. To extend our decimal digits 0 through
9, we use A through F as shown.
B
A 4-digit hexadecimal number can represent all 65536 values in a V-memory word. The range is from
C
0000 to FFFF (hex). PLCs often need this full range for sensor data, etc. Hexadecimal is a convenient way
for humans to view full binary data.
D
3–36
DL205 User Manual, 4th Edition, Rev. B
V-memory address
(octal)
V2017
BCD number
8
0 1 0 0
V-memory storage
Decimal
0 1 2 3
Hexadecimal
0 1 2 3
Hexadecimal number
1 0 1 0
V-memory storage
V-memory data
(binary)
MSB
0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 1
4
9
4
2
1
8
4
2
1
1 0 0 1
4 5
6
7
8 9 10 11 12 13 14 15
4 5
6
7
8 9
A
7
0 1 1 1
LSB
3
6
8
4
2
1
8
4
2
1
0 0 1 1
0 1 1 0
A
B
C D E F
F
4
1 1 1 1
0 1 0 0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF