Numbers System

  

In This chapter we discuss about Number Systems (Decimal Number , Binary Number , Octal Number , Hexadecimal Number , BCD ) overviews.

Numbers, Codes, and Data Types

Chapter - 8


  • PLC'S connect to a wide variety of devices, some of which use variable voltage and current values. Internally, however, PLC'S use signals that are either off or on.


Switch
ON and OFF SWITCH

  • These off and on signals correspond to binary values 0 and 1.

  • A binary 0, also called logic 0, can be used to indicate that an input or output is off and a binary 1, also called logic 1, can be used to indicate that an input or output is on.

  • Consecutive binary bits are also grouped in lengths ranging from a byte to a double word to represent various types of information.

number system
double word



  • For example, a group of consecutive bits, sometimes called a bit string, may represent a numerical value in various number systems such as Binary, Octal Decimal, and Hexadecimal.

  • Because a bit string can represent many things, it must be assigned a data type so that a PLC can properly interpret the information.


Decimal Numbers


Decimal
Decimal Number

  • The decimal number system is sometimes called base 10, and every position in a decimal number represents a power of 10.

  • The available numbers, digits, for each position range from 0 to 9, and the numerical value of a position is determined by multiplying the position digit by the power of 10 for that position.

  • The total numerical value for a decimal number is found by adding the numerical values for all positions.

  • While binary, octal, and hexadecimal numbers may, at first, seem confusing, they follow the same concepts as decimal numbers, except that the number base and available characters are different.


Binary Numbers

number system
binary number

  • The binary number system has a base of 2 and uses only two characters, 1 and 0. Each position is called a bit and is associated with a power of 2 based on where it is in the number.

  • The further to the left a bit is in a binary number, the higher the power of 2.

  • The number on the far left-hand side is referred to as the most significant bit or MSB and the number on the far right hand side is referred to as the least significant bit or LSB.

  • A1 is placed in a position if that power of 2 is used in the number. Otherwise, a 0 is placed in a position.

  • The number of bits used to represent numbers varies, but, in the example shown, an 8-bit binary number, also called a byte, is used.

  • When a PLC does a calculation, it does not convert a binary number to decimal to make the calculation, however, it is useful to understand how to convert a binary number to decimal.

  • Fortunately, the process of converting a binary number to an equal decimal value is as simple as adding the equivalent decimal value for each position in the binary number where a 1 is shown.


number system

binary number 


  • Position with a 0 do not add to the number value.The process of converting a decimal number into a binary number is easy to do by repeatedly dividing the decimal number by two and placing the remainder in the appropriate position in the binary number.

  • For the example show ,the first remainder , 0 is placed in the 1's column.

  • The next remainder 1, is placed in the 2's column. The process continues as shown with the last remainder of 1 placed in the 128's column.This shows that 11001110 in binary is equal to 206 in decimal.


Octal Numbers


Decimal Number
Octal Number



  • Octal is another number system used with PLC'S. The octal number system has a base of 8 and uses characters 0 through 7.

  • Each position is associated with a power of 8 based on where it is in the number. The further to the left a position is, the higher the power of 8.

  • The process of converting an octal number to an equal decimal value is as simple as adding the equivalent decimal value for each position in the octal number.

  • Although you will not frequently have to convert decimal to octal to use a PLC, it is easy to do this conversion by repeatedly dividing the decimal number by eight and placing the remainder in the appropriate position in the octal number.

  • For the example shown, the first remainder, 1, is placed in the 1's column.

  • The next remainder, 3, is placed in the 8's column.

  • 8 does not divide into 4, so that leaves a remainder of 4 in the 64's column.

  • This shows that 281 in decimal is equal to 431 in octal.

number system


  • The real value of octal comes from its relationship with binary. While a PLC can easily use binary numbers, sometimes it is convenient for humans to see equivalent binary values in octal because octal numbers require fewer place values to represent a number.

  • If you know the equivalent binary number for each of the octal characters, 0 through 7, you can easily convert an octal number of any length to the equivalent binary number

number system
octal example



Hexadecimal Numbers

  • The hexadecimal number system has a base of 16. This means that 16 values must be represented for each position in a hexadecimal number.

number system
Hexadecimal number system

  • This is done by using the numbers 0 through 9 to represent the first 10 values and the letters A through F to represent the remaining six values.

  • Each position in a hexadecimal number is associated with a power of 16 based on where it is in the number. The further to the left a position is, the higher the power of 16.

  • The process of converting a hexadecimal number to an equal decimal value is as simple as adding the equivalent decimal value for each position in the hexadecimal number.

  • Although you will not frequently have to convert decimal to hexadecimal to use a PLC, it is easy to do this conversion by repeatedly dividing the decimal number by 16 and placing the remainder in the appropriate position in the hexadecimal number.

  • For the example shown, the first remainder of 15, represented by F in hexadecimal, is placed in the 1s column.

  • The next remainder of 3, is placed in the 16's column. 16 does not divide into 13, so you are left with a remainder of 13, represented by D in hexadecimal, in the 256's column.

number system
hexadecimal conversion

  • This shows that D3F in hexadecimal is equal to 3391 in decimal. The real value of hexadecimal comes from its relationship with binary.

  • While a PLC can easily use binary numbers, sometimes it is convenient for humans to see equivalent binary values in hexadecimal because hexadecimal numbers require fewer place values to represent a number

Number system
hexadecimal to binary

  • If you know the equivalent binary number for each of the hexadecimal characters, 0 through F, you can easily convert a hexadecimal number of any length to the equivalent binary number.


Binary Coded Decimal (BCD)


  • PLC'S use a variety of input and output device codes.

BCD
BCD


  • Binary coded decimal, BCD, is the most common of these codes.

  • BCD is not a number system, but is used by some input and display devices because it allows people to input or see values in decimal.

  • Internal to the PLC, BCD values must be converted to binary numbers that the PLC can use.

  • An example of a BCD device is a type of four- digit Thumb wheel switch.

  • Each Thumb wheel digit controls four PLC inputs, so a four- digit Thumb wheel uses 16 digital inputs.

  • Each Thumb wheel digit represents decimal values 0 through 9.




we will discuss about Integers,Real number,Data type...

    SIEMENS PLC Class for Beginners

Please Share this article, with your friends and colleagues!








Comments

Popular posts from this blog

QElectro Tech Software Overview

Danfoss VLT micro drive FC 51 Name Plate

SIEMENS V20 VFD DRIVE FAULTS CODE LIST PART-1

SIEMENS V20 VFD DRIVE MAIN PARAMETERS LIST

Siemens RDG400KN Thermostat Parameter List