Math instruction:
- Math instructions refer to all output instructions that uses the data of two words or registers and perform the desired function.
- Math instructions are programmed depending on the type of processor used.
- The data manipulation instructions are almost similar to math instructions.
- Math instructions are normally used to perform arithmetic functions on the values stored in memory words or registers.
Math functions:
The basic math functions performed by PLCs are as follows:
- Addition
- This function is used to add one piece of data to another.
- It is also called as ADD.
- Subtraction
- This function is used to subtract one piece of data from another.
- It is also called as SUB.
- Multiplication
- This function is used to multiply one piece of data by another.
- It is also called as MUL.
- Division
- This function is used to divide one piece of data from another.
- It is also called as DIV.
Terms used:
The following terms are used in the instruction.
- Source A
- Source A refers to the address of the first piece of data that is used in the instruction.
- Source B:
- Source B refers to the address of the second piece of data that is used in the instruction.
- Destination
- Destination refers to the address where the results of the instruction are stored.
Given:
- In the given figure, the instruction ADD is executed to add the values accumulated at “C5:0” and “C5:1” and the result will be stored at the address “N7:1”.
- The instruction GREATER THAN OR EQUAL (GEQ) is executed to activate the PL1 output.
- Here, the instruction will become true when the value accumulated at the address “N7:1” is greater than or equal to the constant value “350”.
Explanation of Solution
b.
Status of output PL1:
“No”, the output PL1 will not be energized when the accumulated value of counter “C5:0” and “C5:1” is “148” and “36” respectively.
Reason:
- The accumulated value of counter “C5:0” is “148” and the accumulated value of counter “C5:1” is “36”...
Explanation of Solution
c.
Value of the numbers stored:
Assume that the accumulated value of counter “C5:0” is “250” and the accumulated value of counter “C5:1” is “175”.
(1)
Value stored in “C5:0.ACC”:
Since, the given program stores the accumulated value of counter addressed at “C5:0”, the “C5:0.ACC” contains the value of the number “250”.
(2)
Value stored in “C5:1.ACC”:
Since, the given program stores the accumulated value of counter addressed at “C5:1”, the “C5:1.ACC”contains the value of the number “175”...
Explanation of Solution
d.
Status of output PL1:
“Yes”, the output PL1 will get energized when the accumulated value of counter “C5:0” and “C5:1” is “175” and “250” respectively.
Reason:
- The accumulated value of counter “C5:0” is “250” and the accumulated value of counter “C5:1” is “175”...
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Programmable Logic Controllers
- A(n) ________________ instruction always alters the instruction execution sequence. A(n) ______________ instruction alters the instruction execution sequence only if a specified Condition is true.arrow_forwardThe time it takes to perform the fetch instruction and decode instruction steps is called the execution time. True or false?arrow_forwardSelect an instruction that tests bit position 8 of register CH. Select the correct response: None of the choices BT CH, 8 TEST CH, 128 a or barrow_forward
- BX=FFFF, after instruction INC BX is executed, CF ||arrow_forwardComplete the following statement: With the CMP instruction no operands are modified the source operand is changed O the destination operand is changedarrow_forwardin 01: Write the code based on the logic instruction for the following program emu8086 expression: A = AC + (B+ C) + AC Where: AL=16,, BL= B7, , and CL=32,arrow_forward
- Each instruction in this situation is given its own data, separate from the data used by any other instructions. To do this, we use a: A Multiple Input/Output B Data or Instruction Repeatedly C Distinct Information Difficulty Level: Single Inst, Single Inst, Multiplearrow_forward4. Which segment will be accessed for the instruction MOV [BX],AH.arrow_forwardGiven R = 20, PC = 12 and index register X = 15, show the value of the accumulator for the following instructions. All memory locations Q contain the value Q + 2. Each instruction uses three memory locations. a) LDAC 10 b) LDAC@10 c) LDAC Rarrow_forward
- 15) Answer each of the following with reference to the counter program shown in the figure below. a. Assume the accumulated count of counters C5:0 and C5:1 to be 148 and 36, respectively. State the value of the number stored in each of the following words at this point: (1) C5:0.ACC (2) C5:1.ACC (3) N7:1 (4) Source B of the GEQ instruction b. Will output PLI be energized at this point? Why? c. Assume the accumulated count of counters C5:0and C5:1 to be 250 and 175, respectively. State the value of the number stored in each of the following words at this point: (1) C5:0.ACC (2) C5:1.ACC (3) N7:1 (4) Source B of the GEQ instruction d. Will output PLI be energized at this point? Why? 17 Inputs Ladder logic program Output L1 L2 -CTU cu)- C5:0 CON) COUNT-UP COUNTER S1 Counter Preset 350 Accumulated CTU (cu)- C5:1 CON) COUNT-UP COUNTER Counter Preset 350 o o-Reset Accumulated ADD ADD Source A C5:0 ACC Source B C5:1.ACC Destination N7:1 PL1 GEQ GREATER THAN OR EQUAL Source A N7:1 Source B 350…arrow_forwardFind the machine code for the instruction: SUB.B #15, W10 Machine code in HEX is: Ox What would be W10 value after executing the instruction. Assume W10 intial value is 0x1300 W10=0xarrow_forwardCategory: CPU Wiring Look at the following (incomplete) diagram of the Hack CPU taken from figure 5.9 of the textbook. ALU output outM instruction AM inM writeM A addressM inc reset PC po Match the wires A, B, C, D and E with the logic expression that describes the signal they should carry. The logic expressions use the operators not (!), and (&&) and or (I). The 16 wire instruction is named instr. The A and C instruction formats are: A-instruction: 0 V. V. V C-instruction: 1 1 1 a c1 c2 c3 c5 c6 d1 d2 d3 j1 j2 j3 Mire number: 15 14 13 12 11 10 9 8 6. 4 3 1 instr[15) && instr[3] B. instr[14] ALUarrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningPrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT