SESSION NO.2SESSION NO.2
Introduction to MicroprocessorIntroduction to Microprocessor
⇒Simplified CPU Organization
⇒Fetch Execute Cycle
What is Microprocessor?What is Microprocessor?
A microprocessor incorporates most or all of theA microprocessor incorporates most or all of the
functions of a computer's central processing unitfunctions of a computer's central processing unit
(CPU) on a single integrated circuit (IC, or(CPU) on a single integrated circuit (IC, or
A silicon chip that contains a CPU. In the worldA silicon chip that contains a CPU. In the world
of personal computers, the termsof personal computers, the terms microprocessormicroprocessor
and CPU are used interchangeably. It is the heartand CPU are used interchangeably. It is the heart
of computerof computer
A microprocessor, sometimes called aA microprocessor, sometimes called a logic chiplogic chip,,
is a computer processor on a microchip. Theis a computer processor on a microchip. The
microprocessor contains all, or most of, themicroprocessor contains all, or most of, the
central processing unit (CPU) functionscentral processing unit (CPU) functions
John von Neumann Model for Digital ComputerJohn von Neumann Model for Digital Computer
a design model for a stored-program digital computer that uses a central
processing unit (CPU) and a single separate storage structure ("memory")
to hold both instructions and data.
What is a microcomputer?What is a microcomputer?
Ans. A microcomputer is a system which isAns. A microcomputer is a system which is
capable of processing a stream of inputcapable of processing a stream of input
informations and will generate a stream ofinformations and will generate a stream of
output informations taking the help of aoutput informations taking the help of a
program which is stored in the memory ofprogram which is stored in the memory of
the system.the system.
Called “Micro” because of its small size andCalled “Micro” because of its small size and
low costlow cost
Contains Five Element:Contains Five Element:
1. Input Unit1. Input Unit
2. Control Unit (in CPU)2. Control Unit (in CPU)
3. Arthmetic Unit (in CPU)3. Arthmetic Unit (in CPU)
4. Memory (RAM, ROM)4. Memory (RAM, ROM)
5. Output Unit5. Output Unit
Typical Microcomputer OperationTypical Microcomputer Operation
Fig from book page 5
What is meant by instruction?
Ans: An instruction is a command which asks the microprocessor to
perform a specific task or job.
Kill the enemy
2 + 4 = ?
Operation / Operational Code (Op-Code)
Operand / Data
Series or Collection of InstructionsSeries or Collection of Instructions
Program for making a Coffee???
Let A = 10
Let B = 5
C = A + 2
D= C + B
Computer Programming LanguagesComputer Programming Languages
Low Level / Machine LanguageLow Level / Machine Language
Assembly LanguageAssembly Language
High level LanguageHigh level Language
MOVE AX, 2
MOVE BX, 4
STA AX, 10BH
Let A = 2
Let B = 4
A = A+B
Programming LanguagesProgramming Languages
What is machine language programming?
Ans. Programming a computer by utilizing hex or binary code is known
as machine language programming.
What is meant by assembly language programming?
Ans. Programming a microcomputer by writing mnemonics is known as
assembly language programming. Assembly is Machine dependent
What are meant by low level and high level languages?
Ans. Programming languages that are closer to natural languages, these
languages are machine independent, also called high level languages.
Examples are BASIC, FORTRAN, C, ALGOL, COBOL, etc.
What is mnemonic?What is mnemonic?
It is very difficult to understand a program if it is written inIt is very difficult to understand a program if it is written in
either binary or hex code. Thus the manufacturers have devised aeither binary or hex code. Thus the manufacturers have devised a
symbolic code for each instruction, called a mnemonic.symbolic code for each instruction, called a mnemonic.
In assembly language a mnemonic is a code, usually from 1 to 5In assembly language a mnemonic is a code, usually from 1 to 5
letters, that represents an opcode, followed by one or moreletters, that represents an opcode, followed by one or more
numbers (the operands).numbers (the operands).
Examples of mnemonics are:Examples of mnemonics are:
INR A, ADD M, etc.INR A, ADD M, etc.
Translate the program into Machine language code line by lineTranslate the program into Machine language code line by line
Translate the whole program at once into machine language codeTranslate the whole program at once into machine language code
Special translator used for translating the Assembly languageSpecial translator used for translating the Assembly language
program into Machine Language codeprogram into Machine Language code
Bus SystemBus System
Note: You can also use fig:1-2 on page 3 (typical microcomputer organization) of book
Microprocessor Fundamentals by Roger Tokhiem, to understand bus system
Bus System DescriptionBus System Description
A bus is a bunch of wires through which data or address or control signalsA bus is a bunch of wires through which data or address or control signals
The MPU communicates with memory and I/O using the system busThe MPU communicates with memory and I/O using the system bus
consisting of:consisting of:
Address Bus:Address Bus: unidirectional and carries memory and I/O addressesunidirectional and carries memory and I/O addresses
(From where the Data will come or to where the Data would go?)(From where the Data will come or to where the Data would go?)
Data Bus:Data Bus: bidirectional; transfers binary data and instructions betweenbidirectional; transfers binary data and instructions between
MPU and memory and I/O (Who will bring the data to and from?)MPU and memory and I/O (Who will bring the data to and from?)
Control lines:Control lines: Read and Write timing signals asserted by MPU (WhatRead and Write timing signals asserted by MPU (What
to do with Data?)to do with Data?)
Inside CPU/MicroprocessorInside CPU/Microprocessor
Fig from Page 72
Simplified CPU Organization
Description ofDescription of Simplified CPU Organization
Accumulator: Its is the general purpose register(s) associated with the
ALU operations and sometimes I/O operations.
Temporary Register: It is also a general purpose register, use with
Accumulator to perform ALU operations
Program Counter: It holds the address of the next instruction to be
fetched from the memory.
Airthmetic Logic Unit: Performs all calculations of CPU using Adder &
Shifter and results are sent back to Accumulator and it also expresses
status or conditions (if occur) in result of operation through Status
Instruction Register: holds the instruction (op-code)
Instruction Decoder: it translates the instruction that is in Instruction
Timming and Control Section: most complex section of CPU, It affects
and sequences all events within the CPU
Description ofDescription of Simplified CPU Organization
Primary Function of the CPU of a microcomputer:
1. Fetch, decode and execute program instructions in proper order
2. Transfer data to and from memory and to and from input/output
3. Respond to external interrupts
4. Provide overall timming and control signals for entire system
Bit Size/Word SizeBit Size/Word Size of Microprocessorof Microprocessor
It is the width of accumulator.It is the width of accumulator.
Microprocessors are commonly classified as 4-Microprocessors are commonly classified as 4-
bit, 8-bit, 16-bit or 32-bit units.bit, 8-bit, 16-bit or 32-bit units.
8080/8085, 6800, 6502 and Z80 are common 8-8080/8085, 6800, 6502 and Z80 are common 8-
bit microprocessorsbit microprocessors
8086, 8088, 68000, 65816 and Z8000 are typical8086, 8088, 68000, 65816 and Z8000 are typical
16-bit microprocessors16-bit microprocessors
80386, 68020, 32000 and Z-80000 are examples80386, 68020, 32000 and Z-80000 are examples
of 32-bit microprocessorof 32-bit microprocessor