V–Memory
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).
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
(MSB) on the left. We use the word “significant,” referring to the relative binary weighting of the bits.
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
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
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.
Binary-Coded Decimal Numbers
Since humans naturally count in decimal, we prefer to enter and view PLC data in decimal as well (via
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
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.
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
Direct
SOFT and the handheld
programmer allow us to enter and view data in BCD. Special RLL instructions convert from BCD to
binary, or visa–versa.
Hexadecimal Numbers
Hexadecimal numbers are similar to BCD numbers, except they utilize all possible binary values in each 4-
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.
A 4-digit hexadecimal number can represent all 65536 values in a V-memory word. The range is from
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.
DL205 User Manual, 4th Edition, Rev. B
3–36
Chapter 3: CPU Specifications and Operations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
0
1
0 0
1 1 1
0 0 0
1
0
1
0 0
1
MSB
L
SB
V
-memory
data
(bin
a
ry
)
V
-memory
add
re
ss
(
o
c
ta
l
)
V
2
0
1
7
0
1
0 0
1
0 0
1
0 0
1 1
0
1 1
0
4
9
3
6
V
-memory
st
or
ag
e
BCD
nu
m
b
er
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
8
9
10 11 1
2
1
3
1
4
1
5
0 1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0 1
2
3
4
5
6
7
D
ecimal
H
e
x
a
d
ecimal
1
0
1
0
0
1 1 1
1 1 1 1
0
1
0 0
A
7
F
4
V
-memory
st
or
ag
e
H
e
x
a
d
e
ci
m
a
l
nu
m
b
er