Programmable Logic Controllers. Su Chen Jonathon Lin

Чтение книги онлайн.

Читать онлайн книгу Programmable Logic Controllers - Su Chen Jonathon Lin страница 15

Автор:
Жанр:
Серия:
Издательство:
Programmable Logic Controllers - Su Chen Jonathon Lin

Скачать книгу

place value, and place value as power of 10 for decimal number system.

      The sum of the weights method is used to compute the value of a number. The value of a decimal number is computed by multiplying each digit by its corresponding place value and adding the results. The number 8357, for instance, can be expressed as 8(1000) + 3(100) + 5(10) + 7(1).

      The binary number system uses the number 2 as the base. It has only two symbols: 0 and 1. The binary is the main number system used in digital devices including computers and PLCs. The binary number can be readily applied to such devices that operate on only two states: a switch is ON or OFF; a valve is Open or Closed, etc. The two states of binary are normally distinguished by two voltage levels: +5V and 0V. The 0 (or low) volt represents binary 0 and +5 (or high) volts represents the binary 1.

      Any number greater than 1 is expressed in multiple digits in binary number system. A place value is assigned to each position starting from right to left. The place value is computed as the base 2 raised to the power of the position. Table 3.3 illustrates the position, place value, and place value as power of 2 of binary numbers.

      Table 3.2 Position and place values of decimal number system

image

      Table 3.3: Position and place value of binary numbers

image

      Table 3.4 shows the corresponding binary numbers of some decimal numbers. All binary numbers are represented using only ones and zeros

      Each digit of a binary number is referred to as a bit. The term BIT comes from the contraction of two words Binary digIT. A binary number 110011 has 6 bits. A group of 8 bits is a byte. A word normally consists of 2 bytes (16 bits). Bytes and words are the most commonly used units for storing and manipulating digital data. Figure 3.1 shows a word of 2 bytes (or 16 bits). The right-most bit is the least significant bit (LSB) and the left-most bit is the most significant bit (MSB). The decimal equivalent of a binary number can be computed by multiplying each binary digit by its corresponding place value and summing the results of each position. The decimal equivalent of a binary number 11001 becomes 25 (or 16 + 8 + 0 + 0 + 1).

      Table 3.4: Binary and decimal numbers

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
image

      Figure 3.1: A 2-byte word

      The octal number system uses the number 8 as its base. It has eight unique counting symbols (0, 1, 2, 3, 4, 5, 6, and 7). Table 3.5 shows octal numbering with their decimal and binary equivalents.

      Each digit in an octal number has a place value that is a power of eight raised to n (or 8n), where n is the position, as shown in Table 3.6.

      The octal number 25738 is equivalent to the decimal number 1403 (or 1024 + 320 + 56 + 3). Its conversion is shown below.

image

      We can express 25738 = 140310.

      The octal numbering system uses one digit to represent three binary digits (or bits). In this way, a large binary number can be readily represented by an octal number with much fewer digits (Figure 3.2). As can be seen, that one 15-bit binary number is expressed by a 5-digit octal number.

      Table 3.5: Octal numbering with decimal and binary equivalents

OctalDecimalBinary
000
111
2210
3311
44100
55101
66110
77111
1081000
1191001
12101010
13111011
14121100
15131101
16141110
17151111

      The hexadecimal number system uses the number 16 as its base. It has sixteen unique counting symbols, the numerals 0 – 9 and the letters A – F. Table 3.7 shows hexadecimal numbering with their decimal and binary equivalents.

      Each digit in a hexadecimal number has a place value 16n that is a power of sixteen raised to n, where n is the position as shown in Table 3.8.

      Table 3.6: Place values of octal numbers

image image

      Figure 3.2: An octal number

      The hexadecimal number 23B16 is equivalent to the decimal number 57110 (or 512 + 48 + 11). Its conversion is shown below:

image

      The decimal equivalent of 23B16 = 57110.

      The hexadecimal numbering system uses one digit to represent four binary digits (or bits). In this way, a very large binary number can be concisely represented by a hexadecimal number with very few digits (Figure 3.3). In this example, one 16-bit binary number is expressed by a 4-digit hexadecimal number.

      Table 3.7:: Hexadecimal numbering with decimal and binary equivalents

HexadecimalDecimalBinary
000
111
2210
3311
44100
55101
66110
77111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

      The same numerical quantity can be expressed in different numbering systems and their expressions are equivalent to each other. To facilitate the number conversions in various numbering systems, numbers need to be expressed with their numbering base. A numerical quantity of 12 is expressed in four number systems as follows:

      1210 = 148 = C16 = 11002

      Table 3.8: Place values of hexadecimal numbers

Скачать книгу