Control System Applications (2)

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Machine Instructions Operations
Machine Instructions Operations 1 ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-1.ppt Modification date: March 18, 2015.
ARITHMETIC LOGIC SHIFT UNIT
1 Register Transfer &  -operations Computer Organization Computer Architectures Lab REGISTER TRANSFER AND MICROOPERATIONS Register Transfer Language Register.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
Instruction Set Architecture & Design
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
Computer Basics. Datapath Operations The Register File.
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
Lecture 18 Last Lecture Today’s Topic Instruction formats
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
Machine Instruction Characteristics
I/P Addressing Each input or output is assigned a number on its module, which is referenced to within the program which is refereed to as “address”.
ICS312 Set 9 Logic & Shift Instructions. Logic & Shift Instructions Logic and Shift Instructions can be used to change the bit values in an operand. The.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Data Manipulation, part two Introduction to computer, 2 nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
EEL 3801 Part V Conditional Processing. This section explains how to implement conditional processing in Assembly Language for the 8086/8088 processors.
What is a program? A sequence of steps
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Think Automation and beyond… FT1A Script Programming.
SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb.
© 2015 Pearson Education Limited 2015 Quiz in last 15 minutes Midterm 1 is next Sunday Assignment 1 due today at 4pm Assignment 2 will be up today; due.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
REGISTER TRANSFER AND MICROOPERATIONS
Computer Architecture CST 250
Data Transfers, Addressing, and Arithmetic
Control Unit Lecture 6.
REGISTER TRANSFER AND MICROOPERATIONS
Programming in Machine Language
Chapter 4 Register Transfer and Microoperations
Assembly Language Assembly Language
Microprocessor Systems Design I
Processor Instructions set. Learning Objectives
Chapter 4 The Von Neumann Model
Register Transfer and Microoperations
Assembly Language Programming Part 2
Overview Control Memory Comparison of Implementations
Overview Introduction General Register Organization Stack Organization
BASIC COMPUTER ORGANIZATION AND DESIGN
Falcon-E : Introduction
The 8051 Assembly Language Arithmetic & Logic Instructions
Chapter 11 © 2011, The McGraw-Hill Companies, Inc.
Assembler CASE Tool.
MISP Assembly.
CS149D Elements of Computer Science
Computer Architecture & Operations I
Chapter 8 Central Processing Unit
Programmer’s View of the EAGLE
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Shift & Rotate Instructions)
Unit 12 CPU Design & Programming
MIPS Assembly.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Computer Architecture
University of Gujrat Department of Computer Science
The ARM Instruction Set
Branching instructions
The Stored Program Computer
Chapter 5 Arithmetic and Logic Instructions
MIPS Assembly.
Central Processing Unit.
Control System Applications (2)
Example 1: (expression evaluation)
Basic components Instruction processing
CHAPTER-3 REGISTER TRANSFER LANGUAGE AND MICROOPERATIONS
Presentation transcript:

Control System Applications (2) Programming Logic Controllers PLCs Lect. 9 Dr. Tarek Ahmed Mahmoud Tarek_momeen@yahoo.com

Outlines Numerical Processing Word Objects Word Format Word Types Numerical Instructions

Word Objects Word Format Word objects are addressed in the form of words of 16 bits Word Format 1 16384 +/- 8192 14 15 Bit position Bit state Bit value 13 2 3 4 5 6 7 8 9 10 11 12 4096 2048 1024 512 256 128 64 32 16 Bit 15 at 0 is a positive value. Bit 15 at 1 the word is a negative value (negative values are expressed in two's complement logic).

Word Format (cont.) Decimal 1579 (max : 32767, min :-32768) Hexadecimal 16#A536 (max : 16#FFFF, min : 16#0000) Alternate syntax : #A536.

Word Types in NANO PLC 1- Immediate values 2- Internal words - They are used to store values during the operation. - They are stored in the data memory. - They are read or written to directly by the program. - They are used as working words. %MW0 to %MW255

Word Types in NANO PLC (cont.) 3- Constant words They store constant values Their contents can only be written or modified in the CONFIGURATION editor. - They are read-only access by the program. %KW0 to %KW64 4- Function Block Words - They are read or modified in the program. - Such as %TMi.P and %Ci.P, %Ti.v, . . . etc.

Word Types in NANO PLC (cont.) 5- System words Words have special functions related to the PLC operation %SW0 to %SW127 %SW30 Shows execution time of the last PLC scan cycle 6- I/O exchange words Words %IW and %QW are used to exchange data between PLCs.

Word Types in NANO PLC (cont.) Bit objects extracted from words % Word object : Xk k = 0 to 15 % MW5:x6 Bit position 6 of internal word %MW5.

Word Types in NANO PLC (cont.)

Numerical Instructions Numerical instructions generally apply to 16-bit words They are written - Between square brackets (instruction list) [ Instruction ] - In a rectangular (in ladder diagram). Instruction

Numerical Instructions 1- Assignment instructions These are used to load operand Op2 into operand Op1 Syntax : [Op1:=Op2] Op1 is a memory word Op2 is a memory word or an immediate value Example LD 1 [%MW10:%MW20] %MW10:= %MW20

LDR %I0.3 [%MW10:=100]

Numerical Instructions 2- Arithmetic instructions + : Add two operands - : Subtract two operands * : Multiply two operands / : Divide two operands SQRT : Square root of an operand INC : increment an operand

- Examples

Numerical Instructions 3- Comparison Instructions > : test if greater than. >= : test if greater than or equal. < : test if less than. <= : test if less than or equal. = : test if equal. <> : test if not equal (different from). The result is 1 when the comparison requested is true.

- Examples

Numerical Instructions 4- Logic instructions AND : AND (bit-wise) between two operands OR : Logic OR (bit-wise) between two operands XOR : Exclusive OR (bit-wise) between two operands NOT : Logic complement (bit-wise) of an operand

- Examples LD %M0 [%MW0 := %MW10 AND 16#FF00] LD %I0.3 [%MW102:= NOT (%MW100)] LD 1 [%MW0 := %KW5 OR %MW10]

Numerical Instructions 4- Shift instructions SHL (op2,i) logic shift of i positions to the left. SHR (op2,i) logic shift of i positions to the right.

Application Automatic Traffic Lights steps green yellow red time 15 sec. 1 4 sec. 2 12 sec. 3 3 sec.