Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The contents here are for Aricent internal training purposes only and do not carry any commercial value
Objective
Computation & Computers Computer Hardware Instruction Set Assembly & High Level Language
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The Machine (I) knows how to do multiplication so it can provide the result. This is a program written in a set of instructions which can be executed by the Machine called Me.
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The program changes, because the programming language changes because the machine changes
You can't have multiplication instruction in a program written for the child
Conclusion:
With every machine you have an instruction set which can be used to instruct the machine
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Mostly you can change a program written in a language to an equivalent program in another language as it happened in our previous example and both will give you the desired result How will you ask the machine to execute multiple instructions in a program
There has to be an interface through which you instruct the machine
Car has parts like clutch, gear, accelerator, brake and you can operate these devices to do the required thing
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Processing
Take the value measured in Celsius Convert from Celsius to Farenheit Show the value in Farenheit
Computer
Equipment which can do Information Processing by an algorithmic process
Algorithm
Is a finite list of well-defined instructions for accomplishing some task that, given an initial state, will terminate in a defined end-state
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Machines has to provide interface to provide/display the result to the user Provide capability to store data and instructions, the defining feature
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Peripherals
Systems Interconnection
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Computer Hardware
CPU
Register1 Register2 Registern Stack Pointer Program Counter Instruction Register
Memory-I/O BUS
Device 1 (DISK)
Device 2
Device n
Main Memory
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Components
The Control Unit and the Arithmetic and Logic Unit constitute the Central Processing Unit Data and instructions need to get into the system and results out
Input/output
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
What is a program?
A sequence of steps For each step, an arithmetic or logical operation is done For each operation, a different set of control signals is needed
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
A hardware segment accepts the code and issues the control signals We have a computer!
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Cycle
Two steps:
Fetch Execute
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Fetch Cycle
Program Counter (PC) holds address of next instruction to fetch Processor fetches instruction from memory location pointed to by PC Increment PC
Unless told otherwise
Instruction loaded into Instruction Register (IR) Processor interprets instruction and performs required actions
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Execute Cycle
Processor-memory
data transfer between CPU and main memory
Processor I/O
Data transfer between CPU and I/O module
Data processing
Some arithmetic or logical operation on data
Control
Alteration of sequence of operations e.g. jump
Combination of above
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Interrupts
Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing Program
e.g. overflow, division by zero
Timer
Generated by internal processor timer Used in pre-emptive multi-tasking
I/O
from I/O controller
Hardware failure
e.g. memory parity error
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Interrupt Cycle
Added to instruction cycle Processor checks for interrupt
Indicated by an interrupt signal
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Multiple Interrupts
Disable interrupts
Processor will ignore further interrupts while processing one interrupt Interrupts remain pending and are checked after first interrupt has been processed Interrupts handled in sequence as they occur
Define priorities
Low priority interrupts can be interrupted by higher priority interrupts When higher priority interrupt has been processed, processor returns to previous interrupt
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Connecting
All the units must be connected Different type of connection for different type of unit
Memory Input/Output CPU
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Memory Connection
Receives and sends data Receives addresses (of locations) Receives control signals
Read Write Timing
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Input/Output Connection
Similar to memory from computers viewpoint Output
Receive data from computer Send data to peripheral
Input
Receive data from peripheral Send data to computer
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
CPU Connection
Reads instruction and data Writes out data (after processing) Sends control signals to other units Receives (& acts on) interrupts
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Buses
There are a number of possible interconnection systems Single and multiple BUS structures are most common e.g. Control/Address/Data bus (PC) e.g. Unibus (DEC-PDP)
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
What is a Bus?
A communication pathway connecting two or more devices Usually broadcast Often grouped
A number of channels in one bus e.g. 32 bit data bus is 32 separate single bit channels
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Data Bus
Carries data
Remember that there is no difference between data and instruction at this level
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Address bus
Identify the source or destination of data e.g. CPU needs to read an instruction (data) from a given location in memory Bus width determines maximum memory capacity of system
e.g. 8080 has 16 bit address bus giving 64k address space
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Control Bus
Control and timing information
Memory read/write signal Interrupt request Clock signals
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Instruction Set of a Machine
Operands & Operators
Operators are those operations that are supported on the machine, e.g., add, subtract
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Instruction Set of a Machine Types of Instructions
Instructions to perform fundamental Arithmetic/Logical Operations
Add/subtract operation Example a = b + c //sum of b and c is placed in a Converted into machine language of a particular machine
00000010001100100100000000100000 Basically means: add $R1, $R2, $R3, i.e., sum of values kept in CPU registers R2 and R3 is to be placed in register R1 Similarly sub $R1, $R2, $R3 Value kept in register $R3 subtracted from value in $R2 is placed in register $R1
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Instruction Set of a Machine
Data Movement Instructions
Load and Store Instructions 10001101001010000000010010110000
Load $R1, ($A1) //Load data from memory location M1 into Register R1
10101101001010000000010010110000
Store $R1, ($A1) //Store data from Register R1 into memory location M1
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Instruction Set of a Machine
Logical Operations
AND
Instruction looks as follows: AND $R1, $R2, $R3 // $R1 = $R2 & $R3
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Instruction Set of a Machine
What Distinguishes a Computer from a Calculator? Instructions for making Decisions
Conditional Branch Instructions, an example
Branch on equal beq $R1, $R2, L1 //go to the statement labelled L1 if value in R1 == R2
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
An Issue
CPU Instruction Set is in the binary form as the CPU understands only 0s and 1s
very difficult for human beings to read/write such instructions Programming is very difficult
Solution
Assembly Language
Symbolic Representation of CPU Instruction Set
Symbolic name for operators and operands add $R1, $R2, $R3 sub $R1, $R2, $R3
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Assembly Language
Symbolic Representation of CPU Instruction Set How do you write a program in this language
Start an Editor Type characters corresponding to instructions These characters are saved in ascii format
e.g., Assembly language statement: add $R1, $R2, $R3 Stored form: a d d $ R 01100001011001000110010000100000001001000101 00100011 0001
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Instruction Set
Assembly Language
program written in this language can not run as it is in not in binary format You need a converter from Assembly language to machine language
Assembler
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Disclaimer
Aricent Group makes no representations or warranties with respect to contents of these slides and the same are being provided as is. The content/materials in the slides are of a general nature and are not intended to address the specific circumstances of any particular individual or entity. The material may provide links to internet sites (for the convenience of users) over which Aricent Group has no control and for which Aricent Group assumes no responsibility for the availability or content of these external sites. While the attempt has been to acknowledge sources of materials wherever traceable to an individual or an institution; any materials not specifically acknowledged is purely unintentional
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Revision History
Version No. Date of Release Author Reviewer Approver Changes
3.0
16-May-11
Soma Tiwari
BS
The contents here are for Aricent Group internal training purposes only and do not carry any commercial value
Thank You