Basics of Plc-Number System
Basics of Plc-Number System
Logic Controllers
Chapter 3
Number Systems
And Codes
Decimal System
Ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Base: 10
Two digits: 0, 1
Base: 2
Another Method
In the binary number
when you see a 1, multiply
128 64 32 16 8 4 2 1
that 1 times the value that
is directly over it. Where
you see a 0 in the box,
just ignore it.
AEach
One
word bit
16-bit
represents
will output
be file
thein
created word
“on”
the is
orreserved
“off”
table state
only ifforofeach
the oneslot
processor
TheMade
columnup of
onsingle
the right
bitslists
grouped
the output
into 16-bit
module words
address.
output
in the
finds anpoint.
chassis.
outputThese points
module are numbered
residing 0 through15.
in a particular slot.
Negative Numbers
In the binary system it is not possible to use positive
and negative symbols to represent the polarity of a
number.
One method is of representing a binary number as
either a positive or negative value is to use an extra digit,
or sign bit, at the MSB of the number. In the sign bit
position, a “0” indicates that the number is positive,
and a “1” indicates a negative number.
Sign
Sign Decimal
Decimal
Bit Magnitude
Bit MagnitudeBits
Bits Value
Value
Negative Numbers
Eight digits: 0, 1, 2, 3, 4, 5, 6, 7
Base: 8
I:2/16 O:3/22
Octal System
The digits range from 0 to 7; therefore, numbers
8 and 9 are not allowed!
Converting Octal To Decimal
As in all other numbering system, each digit in an
octal number has a weighted decimal value
according to its position.
Converting Octal-to-Binary
Octal is used to handle large binary numbers. One octal
digit is used to express three binary digits.
Hexadecimal System
The hexadecimal (hex) numbering system can
be summarized as follows:
Sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Base: 16
The thumb-wheel
switch outputs the
equivalent 4-bits
of BCD data
Typical PLC Number Conversion Instruction
The keystrokes
on the keyboard
of a computer are
converted directly
into ASCII for
processing by the
computer.
Parity Bit
Some PLC communications systems use a parity bit
to check the accuracy of data transmission. For example,
when data are transferred between PLCs, one of the
binary bits may accidentally change states.
Even parity
means that the
total number of
binary 1 bits in
the character,
including the
parity bit, is even.
Binary Addition
1’s complement
Binary Multiplication
0x0=0
0x1=0
1x0=0
1x1=1
Binary Multiplication
101
x 110
000
101
101
11110
Binary Division
A = B (A equals B)