Читать книгу Programmable Logic Controllers - Su Chen Jonathon Lin - Страница 11

Оглавление

CHAPTER 3

Number Systems and Codes

Objectives: Identify four commonly used number systems.

Describe the common features of numbering systems.

Describe the decimal number system and its place values.

Describe the binary number system and its equivalency with decimal numbers.

Explain the octal number system and its equivalency with decimal numbers and binary numbers.

Explain the hexadecimal number system and its equivalency with decimal numbers and binary numbers.

Identify the techniques of number conversions between two number systems.

Convert decimal numbers to their binary, octal, and hexadecimal equivalents.

Convert binary numbers to decimal, octal, and hexadecimal equivalents.

Convert octal and hexadecimal to binary.

Identify three binary coding standards.

Understand the ASCII code.

Explain BCD code and its use.

Explain Gray code and its use.

Describe the data structure for PLC data.

Know how PLC handles signed and unsigned numbers.

Use one’s complement and two’s complement to represent negative numbers.

Identify the floating-point decimal numbers.

Overview

PLCs use numbers to implement control functions. We will introduce four commonly used number systems, digital code standards, and PLC data formats in this chapter. The four number systems are binary, octal, decimal, and hexadecimal systems. Number conversions between two different number systems are presented. The digital code standards include binary coded decimal (BCD), Gray code, and ASCII code. The format in which data is represented determines how the binary pattern is to be interpreted. The basic word format, decimal numbers, negative numbers, and floating point decimal numbers to represent numeric values in PLCs are presented.

3.1 Number Systems

PLCs are digital machines that rely on numbers to implement their basic operations and store various types of information. A number system is a standardized scheme whereby a fixed set of symbols is used to represent numeric values. Each number system has the following characteristics:

•Has a base number

•Has a set of symbols

•Is used for counting

The base number or radix of a number system determines the maximum number of unique symbols used by that number system. The base 10 number system, for instance, has the number 10 as its base and has ten unique symbols, 0 through 9. The largest valued symbol has a value of one less than the base.

PLCs use four number systems: base 2, base 8, base 10, and base 16. These four number systems are also referred to as binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Table 3.1 summarizes the base and counting symbols of these four commonly used number systems.

Extra digits are used to express any number that is greater than the base number. The place value, also referred to as position weight, is used to assign a value to each position of a number. The second digit from the right in a base 10 number, for instance, is assigned a place value of 10. The third digit from the right in a base 10 number has a place value of 100.

Table 3.1: Four number systems

Number SystemBaseCounting Symbols
Binary20, 1
Octal80, 1, 2, 3, 4, 5, 6, 7
Decimal100, 1, 2, 3, 4, 5, 6, 7, 8, 9
Hexadecimal160, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

3.2 Decimal Number System

The decimal number system uses the base number 10. It has a total of 10 unique symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) to count the numbers. Multiple-digit numbers are used to count any number greater than 9. The position of each digit in a number determines its weighted value. The zero position is the right-most position and increments by one to the left. The right-most position is the least significant position, and the left-most is the most significant position. The weighted-value of each position can be expressed as the base raised to the power of position. In decimal number system, the position weights from right to left are 1 (or 100), 10 (or 101), 100 (or 102), 1000 (or 103), etc. Table 3.2 illustrates the position, 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).

3.3 Binary Number System

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


Table 3.3: Position and place value of binary numbers


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

Figure 3.1: A 2-byte word

3.4 Octal Number System

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.


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

3.5 Hexadecimal Number System

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



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:


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

3.6 Number Conversions

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



Figure 3.3: A hexadecimal number

The focus of this section is to show the techniques of converting a numerical quantity from one number system to another. A decimal number can be converted to binary, octal, and hexadecimal. Converting a decimal number to its equivalent in another number system involves the process of dividing the decimal number by the base number of the system from which the conversion is made. The conversion to binary involves division by 2, conversion to octal involves division by 8, and conversion to hexadecimal involves division by 16. The generic procedure involves:

a.Dividing the decimal number by the base number.

Decimal number ÷ Base number = Quotient (Q1) + Remainder (R1)

Quotient (Q1) ÷ Base number = Quotient (Q2) + Remainder (R2)

Quotient (Q2) ÷ Base number = Quotient (Q3) + Remainder (R3)

Quotient (Qn-1) ÷ Base number = Quotient (Qn) + Remainder (Rn)

Repeat the process until the quotient of the division becomes 0.

b.Arranging the remainders in proper sequence to express the number in the new number system.

Use the following tips to express the number in the new number system:

•The remainder (R1) is placed in the least significant digit (LSD, right-most) position of the new base number.

•The remainder (R2) is placed in the second position from the right of the new base number.

•The last remainder (Rn) is the most significant digit (MSD, left-most digit) of the new base number.

The new base number is expressed as (Rn… R3R2R1)base number

This procedure can be applied to converting decimal numbers to all three other number systems: binary, octal, and hexadecimal.

3.6.1Converting Decimal to Binary

Converting a decimal number to its binary equivalent involves repeatedly dividing the decimal number by 2 until a quotient of 0 is obtained. Each remainder obtained is a digit of the equivalent binary number, starting from right to left.

Example 3.1: Converting decimal 125 to its binary equivalent

The procedure of converting 12510 to its binary equivalent is outlined below. The binary equivalent of 12510 becomes 11111012.

DivisionQuotientRemainder
125 ÷ 2621 (LSD)
62 ÷ 2310
31 ÷ 2151
15 ÷ 271
7 ÷ 231
3 ÷ 211
1 ÷ 201 (MSD)

Example 3.2: Converting decimal 70 to its binary equivalent

The procedure of converting 7010 to the binary number is listed below. The binary equivalent of 7010 becomes 10001102.

DivisionQuotientRemainder
70 ÷ 2350 (LSD)
35 ÷ 2171
17 ÷ 281
8 ÷ 240
4 ÷ 220
2 ÷ 210
1 ÷ 201 (MSD)

3.6.2Converting Decimal to Octal

Converting a decimal number to its octal equivalent involves repeatedly dividing the decimal number by 8 until a quotient of 0 is obtained. Each remainder obtained is a digit of the equivalent binary number, starting from right to left.

Example 3.3: Converting decimal 253 to its octal equivalent

The procedure of converting 25310 to octal number is as follows:

DivisionQuotientRemainder
253 ÷ 8315 (LSD)
31 ÷ 837
3 ÷ 803 (MSD)

The octal equivalent of 25310 is 3758.

3.6.3Converting Decimal to Hexadecimal

Converting a decimal number to its hexadecimal equivalent involves repeatedly dividing the decimal number by 16 until a quotient of 0 is reached. Each remainder obtained is a digit of the equivalent hexadecimal number, starting from right to left.

Example 3.4: Converting decimal 895 to its hexadecimal equivalent

The procedure of converting 89510 to hexadecimal number is as follows:

DivisionQuotientRemainder
895 ÷ 165515 (F) (LSD)
55 ÷ 1637
3 ÷ 1603 (MSD)

The hexadecimal equivalent of 89510 becomes 37F16.

3.6.4Converting Binary to Decimal

The procedure of converting a binary number to its decimal equivalent starts by multiplying the place values to their corresponding digits and summing the results. The procedure of converting binary number 11012 to decimal follows. We can see that 11012 = 1310.


Example 3.5: Converting 110112 to its decimal equivalent

The decimal equivalent of 110112 is found as follows:

110112 = 1x24 + 1x23 + 0x22 + 1x21 + 1x20 = 16 + 8 + 0 + 2 + 1 = 2710

3.6.5Converting Octal to Decimal

The procedure of converting an octal number to its decimal equivalent starts with multiplying the place values (1, 81, 82,…, 8n) by their corresponding digits and summing the results. An example of converting octal number 5348 to its decimal equivalent follows.


Example 3.6: Converting 6278 to its decimal equivalent

The decimal equivalent of 6278 is:


3.6.6Converting Hexadecimal to Decimal

The procedure of converting a hexadecimal number to its decimal equivalent starts by multiplying the place values (1, 161, 162,…, 16n) to their corresponding digits and summing the results. For example, the procedure of converting 5AC16 to decimal follows.


Example 3.7: Converting B9516 to its decimal equivalent

The decimal equivalent of B9516 is calculated as below:


3.6.7Converting Binary to Octal

Converting a binary number to its octal equivalent involves three steps (Figure 3.4). The first step separates the binary number into groups of three digits, starting from right to left. The second step assigns its octal equivalent for each three-digit group. The last step assembles the octal equivalent values in the proper sequence.


Figure 3.4: Converting a binary number to its octal equivalent

Example 3.8: Converting 110011012 to its octal equivalent

110011012 has a total of 8 digits that can form three 3-digit groups with the third group having only 2 most significant digits. The binary digits in these three groups are:


The octal equivalent of 110011012 becomes 3158.

3.6.8Converting Octal to Binary

Converting an octal number to its binary equivalent is the reverse of converting binary to octal. It involves the following two steps:

•Convert each octal digit to its 3-digit equivalent.

•Assemble the binary equivalent values in the proper sequence.

Example 3.9: Converting 6358 to its binary equivalent

The converting process follows:


The binary equivalent of 6358 becomes 1100111012.

3.6.9Converting Binary to Hexadecimal

Converting a binary number to its hexadecimal equivalent involves the same three steps as converting binary to octal, except hexadecimal conversion involves 4-bit binary groupings. Four-bit groupings are used because each hexadecimal digit can be represented in four binary digits (Figure 3.5).


Figure 3.5: Converting a binary number to its hexadecimal number

Example 3.10: Converting 101100111010102 to its hexadecimal equivalent

The binary 101100111010102 has 14 digits that can form four 4-bit groups with the fourth group having only 2 digits. The binary digits in these four groups are:


The hexadecimal equivalent of 101100111010102 becomes 2CEA16.

3.6.10Converting Hexadecimal to Binary

Converting a hexadecimal number to its binary equivalent is the reverse of converting binary to hexadecimal. It involves the following two steps:

•Convert each hexadecimal digit to its 4-digit equivalent.

•Assemble the binary equivalent values in the proper sequence.

Example 3.11: Converting A3C16 to its binary equivalent

The converting process is as follows:


The binary equivalent of A3C16 becomes 1010001111002.

3.7 ASCII Codes

The operation of PLCs involves manipulation, transmission, and storage of data in various forms. PLCs are digital devices that can readily handle binary data. However, binary data in series of ones and zeros are intuitively difficult for humans to understand and interpret. The binary data must be converted to interpretable formats of numerals, letters, and symbols. The techniques to assign binary patterns to numerals, letters, and symbols are referred to as binary encoding. Several binary coding standards have been established. Some commonly used binary coding standards are ASCII, BCD, and Gray codes. They are introduced in the following three sections.

ASCII code, pronounced as-kee, stands for American Standard Code for Information Interchange. This coding standard provides a set of alphanumeric characters to be used for information interchange in communication systems, computing systems, and peripheral equipment manufactured by different vendors.

ASCII code can be 6, 7, or 8 bits. A 6-bit code can represent a total of 64 (or 26) possible characters; 7-bit code for 128 (or 27) characters; and 8-bit code for 256 (or 28) characters. Standard ASCII uses a 7-bit code with 128 possible characters to represent upper and lower case alphabets, 0 through 9 numerals, punctuation marks, standard symbols, and other special symbols. The 8-bit ASCII character set is referred to as extended ASCII. The 8-bit ASCII set allows the parity check function to be added to a standard 7-bit code (Table 3.9). In communication, parity checking refers to the use of parity bits to check that data has been transmitted accurately. The parity bit is added to every data unit (typically 7 or 8 bits) that is transmitted.

3.8 Binary Coded Decimal (BCD)

The development of binary coded decimal (BCD) arose from the need for allowing data to be input to, and output from, digital devices such as computers and PLCs, in the form of decimal numbers. The purpose of BCD code is to facilitate the communication between the operator and digital devices; that is, to allow humans to use decimal numbers and digital devices to process binary numbers. BCD represents each of ten decimal numbers (0 – 9) as a 4-bit binary number. Table 3.10 summarizes the binary and BCD equivalents of ten decimals (0 – 9).

The BCD representation of a decimal number can be readily obtained by replacing each decimal digit by its BCD equivalent, which can be found from Table 3.10.

Table 3.9: Partial listing of 8-bit ASCII code


Table 3.10: Binary and BCD equivalents of ten decimals (0 – 9)

DecimalBinaryBCD
000000
1010001
2100010
3110011
41000100
51010101
61100110
71110111
810001000
910011001

Example 3.12: Deriving the BCD equivalent for a decimal number 5763

The four digits in the decimal number 5763 are replaced by four 4-digit groups of equivalents. It has a total of 16 binary bits to represent this 4-digit decimal number. The BCD equivalent of this number is as follows:


3.9 Gray Codes

The Gray code is a set of modified binary code that is designed to suit in such applications for which only one bit changes as the counting number increases. This means that the sequential numbers must not have more than one bit changes as the count increments by one. This code is especially useful in working with transducers for linear and angular position sensing. Table 3.11 summarizes the Gray code with binary and decimal equivalents.

3.10 PLC Data Formats

3.10.1Basic Data Structure

The data in PLCs is stored in binary word format. A word normally consists of two bytes, each having eight bits. A byte of 8 bits can express a maximum value of 255 decimals (Figure 3.6). The right-most bit in a one-byte word is called the least significant bit and left-most bit, the most significant bit. A two-byte word is used to express numbers larger than 255. It can hold up to 65535 decimals (Figure 3.7). With the signed decimal format, a two-byte word can store up to +32767 decimal numbers and up to –32767 decimal numbers (Figure 3.8).

PLCs use two words of 16 bits to store decimal numbers larger than +32,767. Two words of 16 bits form a 32-bit decimal format (Figure 3.9). This 32-bit decimal format is referred to as double precision. With the signed numbers, a double precision word can have the maximum decimal value of +2,147,483,647 and the smallest value of –2,147,483,647.

Table 3.11: Gray code with binary and decimal equivalents.

Gray CodeBinaryDecimal
000000
000111
0011102
0010113
01101004
01111015
01011106
01001117
110010008
110110019
1111101010
1110101111
1010110012
1011110113
1001111014
1000111115

Figure 3.6: One-byte word


Figure 3.7: Two-byte word


Figure 3.8: Signed decimal numbers


Figure 3.9: Double precision

3.10.2The One’s Complement Method

Two methods are used to represent negative numbers in PLCs: one’s complement and two’s complement. With the one’s complement method, a negative number is obtained by inverting or complementing each bit of the positive binary number. Inverting a bit means to change 1 to 0 and 0 to 1. The procedure of one’s complement is as follows (using 16-bit word format):

•Express the decimal number in the binary form with a positive sign.

•Complement each bit.

Example 3.13: Use the one’s complement method to express the negative number of 150

The binary number of 150 expressed in 16-bit word is:

00000000100101102

Convert each bit of this binary number as below.


The binary number for –15010 in one’s complement becomes

–15010 = 11111111011010012

The one’s complement of a negative number expressed in binary becomes a positive number with the same quantity. The one’s complement of a negative number is obtained in the same fashion.

Example 3.14: Find the one’s complement of binary 11010101111110012 (-1075810)

The procedure is listed below.


The binary number for the one’s complement of –1075810 becomes

+1075810 = 00101010000001102

3.10.3The Two’s Complement Method

The two’s complement method is similar to the one’s complement except that only those bits after the first 1 is detected are inverted. The first 1 is examined from right to left.

Example 3.15: Find the two’s complement of +5010

The binary number for 5010 is 1100102

Fill in this binary number to a 16-bit word and convert the digits as follows:


The binary number for the two’s complement of +5010 becomes

–5010 = 11111111110011102

If a negative number is given in two’s complement, its complement becomes a positive number. Its complement is derived in the same way.

Example 3.16: Find the two’s complement of a negative number –2110

The binary number of –2110 given in two’s complement is

1111111111101011

Convert the binary number as follows:


The two’s complement of –2110 becomes:

+2110 = 00000000000101012

3.11 Floating-Point Decimal Numbers

A floating-point number consists of two parts: whole number and decimal fraction. The number 648.35 is an example of a floating-point number with 648 being the whole number and 0.35 being the decimal fraction. Floating-point numbers provide a greater accuracy for arithmetic calculations and measured quantities.

Scientific notation is a common form of expressing very large or very small numbers. It expresses numbers in two parts: fractional part and power of ten. Some examples are:

4.56789 x 104for 45678.9
2.356 x 10-5for 0.00002356

The floating-point format is very similar to scientific notation. It also consists of two parts: mantissa and exponent. The mantissa has a fixed number of digits to express the significant digits of the number. The exponent has two digits for expressing the signed power of ten. It determines the direction and the number of places the decimal point must be moved with respect to the most significant digit for finding the actual decimal number being expressed. Table 3.12 shows the floating-point expression with its corresponding decimal and scientific notation.

PLCs use two words to represent a floating-point number in binary (Figure 3.10). The numbers are stored in memory in 3 parts — the sign, the exponent, and the mantissa; the base is assumed to be 2 or binary.

IEEE Standard 754 is a technical standard for floating-point computation established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). IEEE floating-point numbers have three basic components: the sign, the exponent, and the mantissa.

Table 3.12: Floating point, decimal, and scientific notation

DecimalFloating-PointScientific Notation
9876.549.87654 +039.87654 x 103
0.0003453.45000 -043.45000 x 10-4
–23.456–2.34560 +01–2.34560 x 101
–0.004567–4.56700 -03–4.56700 x 10-3

Figure 3.10: Representing a fl oating-point number in binary

3.11.1The Sign Bit

The sign bit is the most significant bit. The value of 0 denotes a positive number; 1 denotes a negative number.

3.11.2The Exponent

The exponent field needs to represent both positive and negative exponents. To do this, a bias is added to the actual exponent in order to get the stored exponent.

3.11.3The Mantissa

The mantissa, also called the significand, represents the precision bits of the number. It is composed of an implicit leading bit and the fraction bits. To find out the value of the implicit leading bit, consider that any number can be expressed in scientific notation in many different ways. For example, the number 5.6 can be represented as any of these:

5.6 x 100

0.056 x 102

5600 x 10-3

In order to maximize the quantity of representable numbers, floating-point numbers are typically stored in normalized form. This puts the radix point after the first non-zero digit. In normalized form, 5.6 is represented as 5.6 x 100.

Example 3.17: Find the effective range

6497.3 = 6.4973 x 103

0.000075 = 7.5 x 10-5

The effective range of IEEE floating-point numbers:

BinaryDecimal
Single precision (32 bits)± (2 – 2-23) x 2127~ ± 1038.53

Review Questions

1. Describe the characteristics of a number system.

2. What is the base number of a number system?

3. What four number systems do PLCs use?

4. List the counting symbols of the binary system.

5. List the counting symbols of the octal system.

6. List the counting symbols of the decimal system.

7. List the counting symbols of the hexadecimal system.

8. Write the corresponding binary numbers of the decimal numbers from 0 to 10.

9. What is the octal number system?

10. Write the corresponding octal numbers of the decimal numbers from 0 to 15.

11. Write the corresponding binary numbers of the octal numbers from 0 to 17.

12. Convert the octal number 34748 to its equivalent decimal number.

13. Write the corresponding hexadecimal numbers of the decimal numbers from 0 to 15.

14. Write the corresponding binary numbers of the hexadecimal numbers from 0 to F.

15. Convert the hexadecimal number 67E16 to its equivalent decimal number.

16. Describe the generic procedure of converting a number from one number system to another number system.

17. Describe the technique of converting a decimal number to its equivalent in other number systems.

18. Convert decimal 532 to its binary equivalent.

19. Convert decimal 90 to its binary equivalent.

20. Describe how to convert a decimal number to its octal equivalent.

21. Convert decimal 357 to its octal equivalent.

22. Convert decimal 4367 to its octal equivalent.

23. Describe how to convert a decimal number to its hexadecimal equivalent.

24. Convert decimal 965 to its hexadecimal equivalent.

25. Describe how to convert a binary number to its decimal equivalent.

26. Convert 1101012 to its decimal equivalent.

27. Describe how to convert an octal number to its decimal equivalent.

28. Convert 6748 to its decimal equivalent.

29. Describe how to convert a hexadecimal number to its decimal equivalent.

30. Convert EC5816 to its decimal equivalent.

31. Describe how to convert a binary number to its octal equivalent.

32. Convert 101110012 to its octal equivalent.

33. Describe how to convert an octal number to its binary equivalent.

34. Convert 76428 to its binary equivalent.

35. Describe how to convert a binary number to its hexadecimal equivalent.

36. Convert 11000111012 to its hexadecimal equivalent.

37. Describe how to convert a hexadecimal number to its binary equivalent.

38. Convert CD5316 to its binary equivalent.

39. What is binary encoding?

40. Describe the ASCII code.

41. What is extended ASCII?

42. What is binary coded decimal (BCD)?

43. Derive the BCD equivalent for a decimal number 7654.

44. What is the Gray code?

45. What is a word?

46. Describe the least significant bit and the most significant bit.

47. How many decimals can a two-byte word hold?

48. Describe the difference between signed numbers and unsigned numbers.

49. What are the two methods of expressing negative numbers?

50. Explain the one’s complement method of inverting a positive number to a negative number.

51. Use one’s complement method to express the negative number of 98.

52. Explain the two’s complement method of inverting a positive number to a negative number.

53. Find the two’s complement of +5010.

54. What is a floating-point number?

55. Explain how to use scientific notation to express very large or very small numbers.

Programmable Logic Controllers

Подняться наверх