Programmable Logic Controllers
5th Edition
ISBN: 9780073373843
Author: Frank D. Petruzella
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Chapter 11, Problem 7P
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.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write the machine code of the instruction:
subwf Ox53, 1
How to write answer:
Write 4-digits hexadecimal value starting without '0x'.
Example: if answer is 0X245F, then write 245F
Example: if answer is 0X005F, then write 005F
Answer:
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, Multiple
Q:find the actual address for the following instruction assume X=38 and
?=R index=DCE8
LOAD X(Ri), A
address
إجابتك
Chapter 11 Solutions
Programmable Logic Controllers
Ch. 11 - Explain the function of math instructions as...Ch. 11 - Prob. 2RQCh. 11 - What standard format is used for PLC math...Ch. 11 - Prob. 4RQCh. 11 - Prob. 5RQCh. 11 - Prob. 6RQCh. 11 - Prob. 7RQCh. 11 - Prob. 8RQCh. 11 - Prob. 9RQCh. 11 - Prob. 10RQ
Ch. 11 - With reference to the instruction of Figure 11-34,...Ch. 11 - With reference to the instruction of Figure 11-35,...Ch. 11 - Prob. 1PCh. 11 - Prob. 4PCh. 11 - Prob. 5PCh. 11 - Prob. 7PCh. 11 - Prob. 8PCh. 11 - With reference to math instruction program shown...Ch. 11 - With reference to the math instruction program...Ch. 11 - Prob. 11PCh. 11 - Prob. 12P
Knowledge Booster
Similar questions
- 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_forwardA(n) __________ is a storage location implemented in the CPU.arrow_forwardQuestion 36 It is an instruction that illustrates powers of two. A) RCR AL, 03H, with AL = 01H %3D B) RCL AL, 03H, with AL = 01H RCL AL, 03H, with AL = 10H Question 37 It is an instruction that needs to identify a positive or negative value of the register. A MOVZX AX,AL B) IDIV AX MUL AX Question 38 It is an instruction that illustrates the opposite of powers of two. A) RCL AL, 03H, with AL = 10H B) RCL AL, 03H, with AL = 01H RCR AL, 03H, with AL = 80H Question 39 It is an instruction to clear the register. A) XOR AX,AX B) CLC c) CLEARarrow_forward
- The instruction that pushes the contents of the specified register/memory location on to the stack is PUSHF O POPF O PUSH O POP O This flag is used by the instructions that perform BCD .(binary coded decimal) arithmetic Carry Flag O Parity Flag O Auxiliary Carry Flag the Direction Flag Oarrow_forwardThe fetch-execute cycle can be simply described by the following algorithm: the program counter increment the end repeat Blank # 1 Blank # 2 Blank # 3 Blank # 4 Blank # 5 Blank # 6 forever the instruction pointed to by the program counter to point at the next instruction the instruction the instruction A A/ A A/arrow_forwardUsing the following data definitions: bytel BYTE byte2 BYTE word1 WORD word2 WORD 3 OFFh, 1, 2 14h OFFFFh, 1, 2 word3 SWORD 7FFFh, 8000h word4 SWORD 9000h dword1 DWORD 10h, 20h, 30h, 40h dArray DWORD 10 DUP (?) Write an instruction that moves the lower 8 bits of word2 into the AL register.arrow_forward
- 1. In the following instruction sequence, show the value of AL for each line of code. Write the value in hexadecimal. Instructions Value of AL (H) MOV AL, 01100001B AND AL, 00011101B MOV AL, 12H AND AL, 3BH MOV AL, 00001111B OR AL, 72H MOV AL, 83H XOR AL, 26Harrow_forward10. The number of clockcycles that take to wait until the length of the instruction is known in order to start decoding is a) 0 b) 1 c) 2 d) 3arrow_forwardSo each instruction gets its own input data, regardless of how other instructions get theirs. Using a(n): A Multiple data, multiple instruction B Multiple data, multiple instruction C Single data, single instruction D One command, several dataarrow_forward
- Using the MARIE computer assembly language, write a program that computes the following expression:z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result(z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen.Remember that the instruction set does not have an instruction to execute multiplication.Note: If any of the input values a, b, and c is a negative numbers or a zero, then the result printedshould be “0”. Otherwise, the result of the multiplication must be printed.arrow_forwardUsing the MARIE computer assembly language, write a program that computes the following expression: z= a*b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. Note: If any of the input values a, b, and c is a negative numbers or a zero, then the result printed should be “0". Otherwise, the result of the multiplication must be printed.arrow_forwardUsing the MARIE computer assembly language, write a program that computes the following expression:z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result(z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen.Remember that the instruction set does not have an instruction to execute multiplication.Note: If any of the input values a, b, and c is a negative numbers or a zero, then the result printedshould be “0”. Otherwise, the result of the multiplication must be printed. The program must be tested on MARIE simulator.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningPrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning