### PLC Programming-2

By IKTech May 29, 2017  Write about digital electronics today You can call PLC’s numbering system.

It is important to say that many people in TT are experienced in this topic. So hopefully if I have any flaws then give proper advice.

In PLC, there are different numbering systems in addition to 10 decimal base methods. Knowing other systems for a successful programming is very important.

What do you know after the end of this lesson ………

1. Name of different numbering system.
2. Describe the representation of different system numbers.
3. Converting into number system.

Binary Number

In the binary number system, each binary unit, or short, is called Bit. Typically binary is the number two system system, which means there are 2 possible values ​​for each number. Each bit value can be only ‘0’ or ‘1’.

A 4-bit group is called NIBBLE.
A group of 8 bits is called byte bait.
A group of 16 bits is called WORD.

At a bit of position, in a byte or ward, its value is determined. And it starts from the right side, the value of the bit number 0 is “1”. If you go to the left, the quality of the bits will be doubled with each place. The value of bit 1 will be 2, the value of bit 2 will be 4, the value of bit 3 will be 8 this way.

The following example can be seen as a byte:
Conversion from binary to decimal

To do this, the value of the binary “1” is set by adding value (value) to the decimal value. Notice below:

Binary Word Decimal Value
0000 0001 ……………… … 1
0000 0010 ……………… … 2
0000 0100 ……………… … 4
0000 1000 ……………….. 8
0000 0011 ……………… … 3
0000 0101 ……………… … 5
0000 0110 ……………… … 6

The number of 4 bits you can count from 0 to 15 …………

0000 0000 ………………. 0
0000 1111 ………………. 15 (8 + 4 + 2 + 1 = 15)

Hexadecimal is a 16 number system base, which means there are 16 possible values ​​for each number. Each digit represents a number from 0 to 15. It is done using letters for greater quality than 9.

The counting numbers from 0 to 9 are the same as the decimal ….

DECIMAL …………….. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

HEXADECIMAL …….. 0 1 2 3 4 5 6 7 8 9 A B C D E F

Notice that the letters are used in hexadecimal instead of 9 since 10.

Hexadecimal is also written in binary through shorthand.

Each hexadecimal number represents 4 bits of binary information. See below:

BINARY …………………. 0000 0010 0011 0100 1000 1001 1010 1011 1111

HEXADECIMAL ……….. 0 2 3 4 8 9 A B F.
Octal number

The octal is an 8 digit system base, which means there are 8 possible values ​​for each number. The octal system numbers are 0 to 7.

Decimal A, when a counting crosses 9, 19 etc., the resume starts from 0. But ten digits, the value is increased by one (9 comes after 10, 19 comes after 20).

Similarly, when the octal number grows by 7, then restarting the count from 0 and increasing the value in ten digits. So 7 comes after 10, 17 comes later 20. See below:

DECIMAL ………. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

OCTAL …………. 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22

The odds and binary are written in shorthand.

Each octal number represents 3-bit binary information. See below:

BINARY ……. 000 010 011 100 001 101 110 111

OCTAL ………. 0 2 3 4 1 5 6 7

For a hexadecimal and octal chart, it will be easy to convert between hex and octal.

349AFh See the transformation of this hexa octal:

HEXADECIMAL …….. 3 4 9 A F

BINARY ……………… 0011 0100 1001 1010 1111

(Regroup in 3) …… 00 110 100 100 110 101 111

OCTAL ……………….. 0 6 4 4 6 5 7

How to convert from 4 numbers to 3 numbers is defined by different colors. So 349AFh is 644657.
Binary Codet Decimals (BCD):

Binary coded decimal is the same counting sequence as decimal, numbers are 0 ~ 9, but the format as binary is the same. However each decimal number breaks into 4 binary numbers. When BCD is converted to binary, each decimal number breaks into 4 binary numbers.

Decimal 26 =

BCD is developed to use the Decimal device as a way to think. For example, thumbhil and seven segment displays. Decimal devices can only count from 0 to 9. And that’s why they require 4-bit binary numbers.

DECIMAL … 291230

BCD ………….. 0000 0010 0000 1001 0001 0010 0011 0000

The differences between binary and BCD are seen when the decimals are changed.

Decimal 12K by