Programmable Logic Controllers
Programmable Logic Controllers
5th Edition
ISBN: 9780073373843
Author: Frank D. Petruzella
Publisher: McGraw-Hill Education
Question
Book Icon
Chapter 11, Problem 5P
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 based 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.

MOV instruction:

  • Move (MOV) instruction is used to copy the data of the source register into destination register.
  • Here, the contents of the source register will not be altered.
  • In other words, it is used to copy the value in one word or register to another word or register.

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.

Blurred answer
Students have asked these similar questions
Write a C# Sharp program to swap two numbers.Test Data:Input the First Number : 5Input the Second Number : 6Expected Output:After Swapping :First Number : 6.
Write a C program that calculates Xn and Yn for n = 1 - 12 and that displays the values in three columns: n ,Xn, Yn with correct headings. Xn = 15(Xn-1) + 120 Yn = 2.5(Xn-1) + 4
Write a program using signed 8-bit variables that computes finalVal = 2*X + 3*Y - Z. X, Y, and Z should be variables that are created in your .data section. Additionally, start with X = 1; Y should be set to five times the value of X. Z should be two times the value of X. Only X should be set in the data section; Y and Z should start uninitialized and then set in the main procedure as described. Create the program in assembly to compute finalVal. Does the value that is computed make sense (show work). In separate runs of the program double your value of X continuing to set the values for X, Y, and Z such that Y = 5X and Z = 2X until the value stored in finalVal no longer make sense. What are the values of X, Y, and Z before and after the result stored is correct. Show the contents in memory and describe why the value in finalVal no longer makes sense.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage