Industrial Computing Overview and Applications
Industrial Computing Overview and Applications
Industrial Computing
Course -
Industrial Computing
Indusaritlcompunitgrefers ot htebranchofcompunitg
regrouping all the design, analysis, and techniques of
programming of computer systems for industrial purposes.
2
Application Areas
Domains
of applications
GPAO
Production Management
FAO
Computer-Assisted:
Assisted Fabrication
Provides a cycle follow-up
by computer
completion of production
Allows to MAO
since the purchase of materials
program and pilot Maintenance
firsts until the
the tools of Assisted by delivery of the finished product
production Computer
3
Areas of Applications
Applications
❑ Automobile: use of industrial robots to perform
the assembly and painting of car bodies
❑ Automation of services: Scheduled door openings and
windows, centralized building management.
❑ instrumentation
❑ Mobile telephony,
❑ Medical,
❑ Payment terminals for credit card....
4
Avantages & Inconvénients
The advantages
Accelerated production capacity;
The ability to adapt to all production environments;
The flexibility of use;
The reduction of production costs.
The creation of automation technician positions.
The disadvantages
The complexity of maintenance: it must be structured;
.
Job cuts
5
Coding of information
Definition
= n-1, … 1 0= ×
=0
Examples:
é = ,… 1 0= × 10
=0
3
2016 = d3 2 1 0= × 10
=0
3= 2 2= 0 1= 1 0= 6
7
Encoding of information
Conversion
7 B A 3
Binary-hexadecimal: 0111 1011 1010 0011 = (7BA3)16
7 5 6 4 3
Binary-Octal 0 111 101 110 100 011 =(75643)8
Decimal-hexadecimal:4610(2E)16
Binary-Decimal: (1 0 0 1) 2= 9
8
Encoding of information
Exercises
9
Data bus
Definition
Unbus allows for the transfer of information (serial/parallel connection)
encoded in binary between two points. Typically, the information is
grouped in words: Octet (8 bits), Word (16 bits) or double Word (32 bits)
bits).
Characteristics of a bus:
10
Data bus
Different Types of Buses
❑ Data bus: allows data transfer between components; it
vehicle the instructions coming from or going to the processor. This is
from a bidirectional bus.
Example: Result of an operation, value of a variable, etc.
❑ Address bus: allows addresses to be transferred between components; it
transport the memory addresses that the processor wants to access for
read or write a data. This is a unidirectional bus.
Example: Address of a memory cell, etc.
❑ Control bus: allows the exchange of information between components
control.
Exemple : Périphériqueprêt/occupé, erreur/exécution réussie, etc.
Definition
An address is a binary number that indicates a location in a
memory zone.
11
Binary arithmetic operations
Definitions
1. Addition:
Addition in binary is done with the same rules as in decimal.
Addition rule:
0+0=0
0+1=1
1+0=1
1 + 1 = 0 with a carry of 1
Subtraction
We calculate the sum between A and the two's complement of B (two's complement and
addition).
3. Multiplication
We multiply numbers in binary in the same way as we multiply them.
decimal numbers.
4. Division in binaries
The principle is the same as for a division in decimal.
5. Two's complement
Two's complement: replace the 1s with 0s (and vice versa), then add 1.
(1011) gives (0100) + (1) = (0101) 12
Binary arithmetic operations
Examples:
Addition
Subtraction
25 -17 = 25 + (- 17) = ?
25 = 00011001
17 = 00010001
We conclude:
- 17 = 11101111(2)
So: 25 –17 = 00011001(2) + 11101111(2)
It is noted that the result is written in 9 bits, which exceeds the writing format.
of 8 bits. In this case, we ignore the leftmost bit (called overflow) and
the result is good: 00001000
13
Microprocessor System
Definition
A microprocessor is a complex integrated circuit. It results from
the integration on a chip of combinational logic functions (logic
and/or arithmetic) and sequential (registers, counters, etc...). It is
capable of interpreting and executing the instructions of a program. Its
the scope of use is almost unlimited.
❑ A program is a set of instructions,
❑ An instruction is a sequence of micro-instructions.
An instruction can be encoded on one or more bytes. Format of a
instruction :
14
Types of MicroprocessorArchitectures
From the point of view of program and data distribution, there are 2
Main types of architectures: Harvard and von Neumann:
15
Von Neumann Architecture Model
16
Harvard Architecture Model
18
Microprocessor System
The functions of a microprocessor:
❑ It allows control, command, and the
sequencing of operations
❑Perform arithmetic and logical operations.
19
Architecture of the µProcessor
Internal architecture
The basic element of a computer consists of the Central Unit of
Processing (UCT, CPU: Central Processing Unit).
An arithmetic and logic unit (ALU: Arithmetic and Logic)
Unit) : it is the calculation organ of the calculator;
The registers: storage areas for the working data of the UAL
(operands, intermediate results) ;
A control unit (CU : Control Unit) : it sends the orders
(or commands) to all other elements of the calculator so that
to execute a program.
20
Architecture of the microprocessor
External architecture
The microprocessor exchanges data with its surroundings (memories, I/O,
...) by means of a bus network.
21
Architecture of the microprocessor
Clock
The sequencer is controlled by a clock that delivers a signal of
frequency data allowing to link the different stages of
the execution of an instruction.
The clock is made up of a quartz oscillator whose circuits
can be internal or external to the microprocessor.
Example: 5 MHz clock, period T = 1/f = 0.2 µs. If the instruction executes in 3
microcycles, the execution duration of the instruction is: 3 × 0.2 = 0.6 µs.
22
Architecture of the microprocessor
23
Exercises
Exercise 1:
Give the duration of a cycle for a 100MHz clock.
Exercise 2:
Let it be a µProcessor that operates at 100MHz. Knowing that an operation
Addition requires 5 cycles. Calculate the number of addition operations.
which can be performed in one second by this microprocessor.
24
The memories
25
The memories
26
The memories
Types of memories
1. The volatile memories (RAM): Random Access Memory)
volatile memories. They lose their content in case of
power supply. They are used to store
temporarily data and programs. They
can be read and written by the microprocessor;
Access to this memory is fast (a few tens of
nanoseconds) which is important not to slow down
the rate at which the processor can operate.
27
The memories
Types of memories
2. Dead memories (ROM): Read Only Memory)
non-volatile memories. They retain their content in
cases of power failure. They can only be
read by the microprocessor (no writing capability).
They are used to store data and programs.
definitively.
-However, the access times to these memories are much
slower than for access to RAM.
Note: The term read-only memory (ROM) is
preserved for historical reasons, however most
current mass storage devices (such as the
hard drives, USB keys using FLASH technology are
accessible for reading AND writing.
28
Classification of RAM memories
RAM Memory
❑ Dynamic DRAM:
Based on the load of capacitors: charged capacitor
= 1, capacitor discharged = 0.
The disadvantage of this simple technique is that the
capacitor discharges by itself over time (currents
of escape). It is therefore necessary to refresh all the
capacitor
Low cost, reliable power consumption, high density
integration
29
Classification of RAM memories
RAM Memory
❑ Static SRAM
Static Random Access Memory.
Used as memory in PC cache.
The information is stored by a switch of
type D
SRAMs allow shorter access times than
the DRAM, but are more expensive because their
construction requires 4 times more transistors than the
DRAM.
30
Classification of RAM memories
Dead memories
❑ ROM: Read Only Memory. Memory for reading only, without writing. Sound
Content is programmed once and for all by the manufacturer.
Advantage: low cost. Disadvantage: requires production in very
large quantity.
❑ PROM: Programmable Read Only Memory. ROM programmable one
only time used by the user (ROM OTP: One Time Programming) in
blowing fuses.
❑ EPROM: Erasable PROM, also called UVPROM. ROM
electrically programmable with a programmer and erasable by
exposure to ultraviolet radiation for 30 minutes.
❑ EEPROM: Electrically Erasable PROM. ROM programmable and
electrically erasable. Normal speed reading. Writing (=
very slow erasure. Application: the EEPROMs contain a
data that can be modified from time to time, example:
computer configuration settings.
31
Functional diagram of a memory
Memory capacity
❑ Capacity represents the amount of information that can
to be stored in memory.
It characterizes the number of elements (bits, bytes, or words):
it is often expressed in Kbits.
The number of address lines depends on the capacity of
the memory: k address lines allow addressing2
memory cases.
é= ∗ é
é= ∗
Example: In a memory, the size of the address bus
K=14 and the data bus size n=4. Calculate the capacity.
of this memory?
33
The characteristics of a memory
Memory capacity
34
The characteristics of a memory
Capacity of a memory
35
The characteristics of a memory
36
Microprocessor/memory interfacing
37
Reading/writing chronograms in memory
Chronogramme de lecture en mémoire :
The information is available
Chargerdans le Launch it
in the data bus register
register RAM the address order of
after an uncertain time
the word to read. lecture (R/W=1)
(access time).
38
Reading/Writing Chronograms in Memory
39
Cache Memory
Indeed, memory components benefit from the same advances.
technological elements that microprocessors but the decoding of addresses and the
Writing/reading data are difficult steps to accelerate.
Technological progress
Memoirs Microprocessor
42
Cache Memory
43
Pyramid of memories
44
Design of memories
We want to achieve a memory of capacity C, but we
we only have enclosures (circuits) of size
lower?
45
Design of memories
46
Memory design
47
Design of memories
= =
’ ′
-P: Allows to determine the number of necessary housings
to obtain the number of words in memory M (extension
lines )
Allows to determine the number of necessary cases
to obtain the word size of memory M (extension
words or column extensions.
Give the total number of cases needed for
create the memory M.
48
Design of memories
Example 1:
Create a memory of 1KB (the size of a word is 8 bits)
using 256-word, 8-bit size boxes?
Example 2:
We want to create a memory of 1KB (the size of a word is
16 bits) using 1KB packages of 4 bits words)?
(m,n)=(1024,16) : the address bus size is 10 bits
(A9…A0), the data bus size is 16 bits
(D15….D0)
(m',n')=(1024,4) : the address bus size is 10 bits
(A9'...A0'), the data bus size is 4 bits
(D3'....D0')
1024
- = = 1( line extensions )
1024
- = 164(extension columns)
4
The total number of boxes P.Q=4
50
Design of the theses
Example 3:
Create a memory of 1KB (the size of a word is 8 bits)
using boxes of size 256 words of 4 bits?
Example 4 :
Connection of three memory units with a capacity of 8 KB
each (13 address lines) on a 16-bit address bus:
52
Design of theses
53
Design of memories
Memory 1
Memory 2
Memory 3
54
Memory design
55
Decoding of addresses
A13 000
A14 8 combinations à
A15 111
8 Memory boxes
The total installed memory: 8 × 8 Ko = 64 Ko
56
Decoding of addresses
3 to 8 decoder 57
Decoding of addresses
58
Decoding of addresses
59
Chapter 3
The Microprocessor
60
Processor
The number of instructions varies depending on the type of processors.
We distinguish 2 types of processors:
62
Processing unit
64
Arithmetic and Logic Unit
Memory Memory
Source Destination
Accumulator
67
Accumulator or Work Register
Example
Z = X + Y corresponds to
LOAD X ;
ADD Y;
STORE Z Loading of
the accumulator with x
(2): Preparation of operands x and
and towards the UAL
Order launch of
the operation in the UAL copy of the accumulator in z
Result transferred to
the accumulator
68
Command and Control Unit
69
Command and Control Unit
70
Command and Control Unit
Decoder
He is the one who will 'decode' the instruction contained in RI and
generate the corresponding logic signals and the
communicate with the sequencer.
He retrieves the instruction coded in machine language in the
registered instruction (RI)
decode it to translate it into a basic instruction
understandable by the processor (that is to say a
instruction of his game instructions).
5. The sequencer
It manages the sequencing of operations and generates the signals.
of commands that will activate all the elements that
will participate in the execution of the instruction and in particular
the ALU.
71
Functional diagram
72
Assembly programming
the microprocessor
Software aspect
73
Execution cycle of an instruction
The processing of an instruction can be broken down into three phases.
Phase 1: Research of the instruction to be processed
1. The PC contains the address of the next instruction of the program. This value
is placed on the address bus by the control unit which issues a command of
lecture.
2. After a certain amount of time (memory access time), the content of the
Selected memory case is available on the data bus.
3. The instruction is stored in the instruction register of the processor.
74
Execution cycle of an instruction
Phase 2: Decoding the instruction and searching for the operand
The instruction register now contains the first word of
the instruction that can be encoded over several words. This first word
contains the operating code that defines the nature of the operation to be performed
(addition, rotation, ...) and the number of words of the instruction.
The command unit transforms the instruction into a sequence of
elementary commands necessary for processing the instruction.
2. If the instruction requires data from memory,
The control unit retrieves its value from the data bus.
The operand is stored in a register.
75
Execution cycle of an instruction
Phase 2: Decoding the instruction and searching for the operand
76
Execution cycle of an instruction
Phase 3: Execution of the instruction
The microprogram executing the instruction is executed.
2. The flags are positioned (state register).
The control unit positions the CPU for the next instruction.
77
Instruction coding
The instructions and their operands (parameters) are stored in memory.
main. The size of an instruction (number of bits required
to represent it in memory) depends on the instruction type and also on the
operand typed.
78
Addressing mode of an instruction
An addressing mode defines how the microprocessor will
access the operand. According to the addressing mode, the size of the instruction
can vary from 1 to 4 bytes.
79
Addressing mode of an instruction
▪ Immediate addressing where the value is defined immediately.
data.
MOVAX,500H ;
Means that the value 500H will be stored immediately in the AX register.
80
Addressing mode of an instruction
▪ Direct addressing: The instruction contains the address of the case.
memory where the data is located.
MOVAX
The value addresses a constant (a displacement) that must be added.
to the contents of the registerDS.
81
The processor registers
Data records
AX, BX, CX and DX
82
The processor registers
Registered addresses
SI, DI, BP and SP
Index registers:
▪ Source index
▪ Destination index
Basic records:
▪ Base pointer
▪ SP: "Stack pointer"
Segment registers
These registers are responsible for selecting the different segments of the
memory pointing to the beginning of each of them.
▪ CSCode base address for the program.
▪ DSData base address segment for data.
▪ Extra segment base address for other data.
▪ SSStack base address segment for the stack.
83
The processor registers
Segment registers
These registers are responsible for selecting the different segments of the
memory pointing to the beginning of each of them.
16 bits 0-15
SC, DS, ES and SS
85
The processor registers
Registers
of data Instruction counter
Registers
address
AH 8 Bits AL 8 Bits
Civil registry
86
Instruction game
87
Instruction game
Definition
The instruction sheet describes the set of operations
elementary operations that the microprocessor will be able to execute.
Examples:
1. mov ax,bx: Load the content of register BX into register AX
register addressing.
2. mov al,12H : Load the AL register with the value 12H
addressing
immediate.
3. mov bl,[1200H] :Transfers the content of the memory location
to the effective address 1200H towards the BL register (direct addressing) 89
Arithmetic instructions
The basic arithmetic operations are addition, subtraction,
multiplication and division that include various variants. Several
addressing modes are possible
Addition :
Examples:
1. ADD ah,[1100H]
Add the content of memory cell 1100H to accumulator AH
(direct addressing).
2. ADD ah,[bx]
Add the content of the memory cell pointed to by BX to the accumulator AH.
(address-based)
3. ADD [DI], AL :
The content of the memory location pointed to by DI is added to AL, the
The result is placed in the memory location pointed to by DI.
90
Arithmetic instructions
Subtraction :
Examples:
Multiplication :
MUL performs an unsigned multiplication of the source operand and the accumulator
Multiplicand
91
The arithmetic instructions
92
Logical instructions
➢ ET ;
➢ OU ;
➢ Exclusive OR;
➢ Supplement to 1;
➢ Complement to 2
➢ Shifts and rotations.
93
Logical Instructions
ET logic:
Examples:
94
Logical instructions
OR logic :
95
Logical instructions
Supplement to 1:
The operation performed is:
NO Operand operand é .
Example:
Complement to 2:
NEGoperand operator é + 1.
96
Logical instructions
Exclusive OU:
The operation performed is:
Example:
Resetting a register
97
Logical instructions
Operations Instruction Examples
Arithmetic shift
SARopérande, n
to the right
99
The logical instructions
Applications of shift instructions:
3. Multiplication or division by a power of 2:
a right shift is equivalent to dividing by 2
and a left shift, a multiplication by 2.
Calculate .
100
The connection instructions
101
The wiring instructions
Unconditional jump instruction:
This instruction jumps to the specified label. A
label is a symbolic representation of a
instruction in memory:
JMPlabel
Example:
102
The wiring instructions
Conditional jump instructions:
A conditional jump is executed only if a certain
the condition is met, otherwise the execution continues
sequentially to the next instruction
Jconditionlabel
103
The connection instructions
Conditional jump instructions:
There is another type of conditional jump, the jumps
arithmetic. They usually follow the instruction of
comparison:
CMP operand1, operand2
Examples:
104
Wiring instructions
Application
we want to add two signed numbers N1 and N2
respectively located at offsets 1100H and 1101H. The
The result is stored at offset 1102H if it is positive, at offset
1103 If it is negative and at the offset 1104 If it is zero:
105
The connection instructions
Organigram
106
The wiring instructions
Program:
107