Programmable Logic Controllers
Programmable Logic Controllers
5th Edition
ISBN: 9780073373843
Author: Frank D. Petruzella
Publisher: McGraw-Hill Education
Question
Book Icon
Chapter 11, Problem 1P
Program Plan Intro

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”...

Blurred answer
Students have asked these similar questions
(d) The table below shows the ALUcontrol signal of the datapath we discussed in class. Instruction Funct ALU Орсode ALUop ALU action operation field control Iw 00 load word XXXXXX add 0010 Sw 00 store word XXXXXX add 0010 beq 01 branch equal subtract 0110 XXXXXX R-type 10 add 100000 add 0010 R-type 10 subtract 100010 subtract 0110 R-type 10 AND 100100 AND 0000 R-type 10 OR 100101 OR 0001 R-type 10 set on less than 101010 set on less than 0111 You want to add the bne instruction into the datapath, which already includes the required hardware for the instruction. Write out the ALUop for bne and how you can determine whether the bne results in the branch to be taken.
Assume AL=35h; CL=05. Write the content of AL after RCR AL, CL - showing the calculation steps. Assume a CLC instruction before this RCR instruction. (Note : Solve the question in paper, scan and upload along with the other Part B and C answers) A- BI E E I E
Given a memory load instruction, "mov R0; [R1+1000]," please give the input that should be selectedat each multiplexer. You can write "none" for the multiplexers that are not used for this instruction.(a) MUX1:(b) MUX2:(c) MUX3:(d) MUX4:
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT