Microprocessor Chapter 1 Introduction
Microprocessor Chapter 1 Introduction
Chapter 1 : Introduction
Chapter 1
Introduction
1.1 Introduction
A Microprocessor is a multipurpose programmable, clock driven, register based electronic
device that reads binary instructions from a storage device called memory, accepts binary data
as input, processes data according to those instructions and provide result s as output. The
microprocessor operates in binary 0 and 1 known as bits are represented in terms of electrical
voltages in the machine that means 0 represents low voltage level and 1 represents high
voltage level. Each microprocessor recognizes and processes a group of bits called the word and
microprocessors are classified according to their word length such as 8 bits microprocessor with
8 bit word and 32 bit microprocessor with 32 bit word etc.
CPU: - Central processing unit which consists of ALU and control unit.
Microprocessor: - Single chip containing all units of CPU.
Microcomputer: - Computer having microprocessor as CPU.
Microcontroller: single chip consisting of MPU, memory, I/O and interfacing circuits.
MPU: - Microprocessing unit complete processing unit with the necessary control
signals.
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
Fig 1.2 (b): Block Diagram of a computer with the Microprocessor as CPU
Later on semiconductor fabrication technology became more advanced, manufacturers were
able to place not only MPU but also memory and I/O interfacing circuits on a single chip known
as microcontroller, which also includes additional devices such as A/D converter, serial I/O,
timer etc.
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
B. Register Array: The registers are primarily used to store data temporarily during the
execution of a program and are accessible to the user through instruction. The registers
can be identified by letters such as B, C, D, E, H and L.
C. Control Unit: It provides the necessary timing and control signals to all the operations in
the microcomputer. It controls the flow of data between the microprocessor and
memory & peripherals.
Memory:
Memory stores binary information such as instructions and data, and provides that information
to the up whenever necessary. To execute programs, the microprocessor reads instructions and
data from memory and performs the computing operations in its ALU. Results are either
transferred to the output section for display or stored in memory for later use. Memory has
two sections.
A. Read only Memory (ROM): Used to store programs that do not need alterations and can
only read.
B. Read/Write Memory (RAM): Also known as user memory which is used to store user
programs and data. The information stored in this memory can be easily read and
altered.
Input/Output:
It communicates with the outside world using two devices input and output which are
also Known as peripherals.
The input device such as keyboard, switches, and analog to digital converter transfer
binary information from outside world to the microprocessor.
The output devices transfer data from the microprocessor to the outside world. They
include the devices such as LED, CRT, digital to analog converter, printer etc.
System Bus:
It is a communication path between the microprocessor and peripherals; it is nothing but a
group of wires to carry bits.
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
The data lines provide a path for moving data between system modules. These lines are
collectively called data bus.
The address lines are used to designate the source/destination of data on data bus.
The control lines are used to control the access to and the use of the data and address
lines. Because data and address lines are shared by all components, there must be a
means of controlling their use. Control signals transmit both command and timing
signals indicate the validity of data and address information. Command signals specify
operations to be performed. Control lines include memory read/write, i/o read/write,
bus request/grant, clock, reset, interrupt request/acknowledge etc.
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
Email: haryal4@gmail.com
Microprocessors
1.5
Chapter 1 : Introduction
The simplest way to organize a computer is to have one processor, register and instruction code
format with two parts op-code and address/operand. The memory address tells the control
where to find an operand in memory. This operand is read from memory and used as data to be
operated on together with the data stored in the processor register. Instructions are stored in
one section of same memory. It is called stored program concept.
The task of entering and altering the programs for ENIAC was tedious. It could be facilitated if
the program could be represented in a form suitable for storing in memory alongside the data.
So the computer could get its instructions by reading from the memory and program could be
set or altered by setting the values of a portion of memory. This approach is known as 'storedprogram concept' was first adopted by John Von Neumann and such architecture is named as
von-Neumann architecture and shown in figure below.
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
Harvard Architecture
In von-Neumann architecture, the same memory is used for storing instructions and data.
Similarly, a single bus called data bus or address bus is used for reading data and instructions
from or writing to memory. It also had limited the processing speed for computers.
The hardvard architecture based computer consists of separate memory spaces for the
programs (instructions) and data. Each space has its own address and data buses. So
instructions and data can be fetched from memory concurrently and provides significance
processing speed improvement.
In figure below, there are two data and two address buses multiplexed for data bus and address
bus. Hence, there are two blocks of RAM chips one for program memory and another for data
memory addresses.
Email: haryal4@gmail.com
Microprocessors
Date
1971
1972
1974
1976
1978
1979
1982
1985
1989
1993
1995
1997
1998
1999
2000
2001
2002
2003
1.6
1.7
Chapter 1 : Introduction
Micro-Operations
Email: haryal4@gmail.com
Microprocessors
Chapter 1 : Introduction
Microinstructions
Each instruction is characterized with many machine cycles and each cycle is characterized with
many T-states. The lower instruction level patterns which are the numerous sequences for a
single instruction are known as microinstructions. Suppose we can visualize the
microinstruction with the help of fetch cycle, or read cycle or write cycle.
Fetch Registers
Fetch Sequence
t1:
t2:
t3:
MAR <- PC
MBR <- (memory or MAR)
PC <- PC +1
IR <- MBR
Email: haryal4@gmail.com
10
Microprocessors
Chapter 1 : Introduction
OR
t1:
t2:
MAR <- PC
MBR <- (memory or MAR)
PC <- PC +1
t3:
IR <- MBR
Control Unit
The control unit is the heart of CPU. It gets instruction from memory. The control unit decides
what the instructions mean and directs the necessary data to be moved from memory to ALU.
It must communicate with both ALU and main memory. It coordinates all activities of processor
unit, peripheral devices and storage devices. Two types of control unit can be implemented in
computing systems.
1. Hardwired Control Unit
This CU is essentially a combinatorial circuit. Its i/p logic signals are transformed into set
of o/p logic signals which are control signals.
The CU performs different operations in the basis of op-codes.
We have to derive the Boolean expression for each control signal as a function of input.
Since modern processor needs a Boolean equation, it is very difficult to build a
combinational circuit that satisfies all these operations.
It has faster mode of operation.
A hardwired control unit needs rewiring if design has to be modified.
2.
1.8
The symbolic notation used to describe the micro operation transfers among register is called
register transfer language. It is one of the forms of hardware description language (HDL). The
Compiled by: Er. Hari Aryal
Email: haryal4@gmail.com
11
Microprocessors
Chapter 1 : Introduction
term register transfer implies the availability of hardware logic circuits that can perform a
stated instruction and transfer the data. It also transfers result of the operation to the same or
another register. The term language is borrowed from programmers, who apply this term to
programming language.
RTL is the convenient tool for describing the internal organization of digital computers in
concise and precise manner. It can also be used to facilitate the design process of digital
systems such as microprocessors.
Fetch and execute cycle of MOV A, B in terms of RTL specification:
Within the fetch cycle, the operations performed during execution of instruction MOV A, B are:
i)
The program counter contains the address of the next instruction to be executed. If the
next instruction to be executed is MOV A, B; the program counter contains the address
of the memory location where the instruction code for MOV A, B resides.
In the first operation of fetch cycle, the contents of program counter will be transferred
to the memory address register (MAR). The memory address register then uses the
address bus to transmit its contents that specifies the address of memory location from
where that instruction code of MOV A, B is to be fetched.
Let t1 indicates the period of first operation
t1 : MAR
PC
ii) When the control unit issues the memory read signal, the contents o f the address
memory location specified by MAR will be transferred to the memory buffer register
(MBR).
Suppose t2 is the time period for this operation.
t2 : MBR
Memory or [MAR]
iii) Finally the contents of MBR will be transferred to the instruction register and then the
program counter gets incremented.
Let t3 be the time required by the CPU to complete these operations.
t3 : IR
(MBR)
PC
PC + 1
Email: haryal4@gmail.com
12
Microprocessors
Chapter 1 : Introduction
After the fetch cycle completed, the execution starts. The execute cycle steps:
i) At the start of execution cycle, the instruction register (IR) consists of instruction code
for instruction MOV A, B. The address field of instructions specifies the addresses of
the two memory locations A & B. The first step needed is to obtain the data from the
location B. For this the address field of IR indicating the address of memory location
will be transferred to address bus through the MAR.
Let t1 be this time taken
t1 : MAR
(IR(Address of B))
ii) When the control unit issues a memory read signal, the contents of location B will be
output (written) to the memory buffer register (MBR). Now the content of B which is
to be written to memory location A is contained in MBR.
Let t2 be the time taken for that operation.
t2 : MBR
(B)
iii) Now, we need the memory location of A because it is being written with the data of
location B. For this the address field of IR indicating the address of memory location
A. A will be transferred to MAR in time t3.
t3 : MAR (IR(Address of A))
iv) When the control unit issues the memory write signal, the contents of
MBR will be written to the memory location indicated by the contents of MAR in
time t4.
t4 : A MBR
or
t4 : [MAR] MBR
Note: [MAR] = A
Program consists of instructions which contains different cycles like fetch and execute.
These cycles in turn are made up of the smaller operation called micro operations.
Some RTL Examples
1) MVI A, 02H
Fetch:
T1: MAR PC
T2: MBR [MAR]
T3: IR MBR
PC
Compiled by: Er. Hari Aryal
Email: haryal4@gmail.com
13
Microprocessors
Chapter 1 : Introduction
Execute:
T4:MBR IR [address of immediate data]
T5: MAR IR [address of A]
T6: A MBR
2) LXI B, 0210H
Execute:
T4:MBR IR [address of immediate data]
T5: MAR IR [address of C]
T6:C MBR
T7: MBR IR [address of immediate data (MSB)]
T8: MAR IR [address of (B)
T9:B MBR
3) LDA 2030H
Execute:
T4:MAR IR [address of immediate data]
T5: MBR IR [address of C]
T6: MAR IR [address of A]
T7: A MBR
4) STA 2030H
Execute:
T4:MAR IR [address of immediate A]
T5: MBR
T6: MAR IR [address of immediate data]
T7: [MAR] MBR
Advantages of Microprocessor:
Computational/Processing speed is high
Intelligence has been brought to systems
Automation of industrial process and office automation
Flexible
Compact in size
Maintenance is easier
Email: haryal4@gmail.com
14
Microprocessors
Chapter 1 : Introduction
Applications of Microprocessors:
Microcomputer: Microprocessor is the CPU of the microcomputer.
Embedded system: Used in microcontrollers.
Measurements and testing equipment: used in signal generators, oscilloscopes, counters,
digital voltmeters, x-ray analyzer, blood group analyzers baby incubator, frequency
synthesizers, data acquisition systems, spectrum analyzers etc.
Scientific and Engineering research.
Industry: used in data monitoring system, automatic weighting, batching systems etc.
Security systems: smart cameras, CCTV, smart doors etc.
Automatic system
Communication system
Some Examples are:
Calculators
Accounting system
Games machine
Complex Industrial Controllers
Traffic light Control
Data acquisition systems
Military applications
Email: haryal4@gmail.com
15