Unit I BCA

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Unit I Fundamentals of Microprocessor

Introduction to Microprocessor
Microprocessor is a controlling unit of a micro-computer, fabricated on a small chip capable of
performing ALU (Arithmetic Logical Unit) operations and communicating with the other devices
connected to it.
Microprocessor consists of an ALU, register array, and a control unit. ALU performs arithmetical
and logical operations on the data received from the memory or an input device. Register array
consists of registers identified by letters like B, C, D, E, H, L and accumulator (register in which
intermediate arithmetic and logic results are stored.). The control unit controls the flow of data
and instructions within the computer.

Block Diagram of a Basic Microcomputer

How does a Microprocessor Work?


The microprocessor follows a sequence: Fetch, Decode, and then Execute.
Initially, the instructions are stored in the memory in a sequential order. The microprocessor
fetches those instructions from the memory, then decodes it and executes those instructions
till STOP instruction is reached. Later, it sends the result in binary to the output port. Between
these processes, the register stores the temporarily data and ALU performs the computing
functions.

Features of a Microprocessor
Here is a list of some of the most prominent features of any microprocessor −
a) Cost-effective − The microprocessor chips are available at low prices and results its low
cost.
b) Size − The microprocessor is of small size chip, hence is portable.
c) Low Power Consumption − Microprocessors are manufactured by using metaloxide
semiconductor technology, which has low power consumption.

d) Versatility − The microprocessors are versatile as we can use the same chip in a number
of applications by configuring the software program.
e) Reliability − The failure rate of microprocessors is very low, hence it is reliable.

1
Microprocessor Architecture & Operation

ALU (Arithmetic/Logic Unit) – It performs such arithmetic operations as addition and


subtraction, and such logic operations as AND, OR, and XOR. Results are stored either in
registers or in memory.

Register Array – It consists of various registers identified by letter such as B, C, D, E, H, L, IX, and
IY. These registers are used to store data and addresses temporarily during the execution of a
program.

Control Unit – The control unit 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 and peripherals.

Input – The input section transfers data and instructions in binary from the outside world to the
microprocessor. It includes such devices as a keyboard, switches, a scanner, and an analog-to-
digital converter.

Output – The output section transfers data from the microprocessor to such output devices as
LED, CRT, printer, magnetic tape, or another computer.

Memory – It stores such binary information as instructions and data, and provides that
information to the microprocessor. To execute programs, the microprocessor reads instructions
and data from memory and performs the computing operations in its ALU section. Results are
either transferred to the output section for display or stored in memory for later use.

System bus – It is a communication path between the microprocessor and peripherals. The
microprocessor communicates with only one peripheral at a time. The timing is provided by the
control unit of the microprocessor.

2
Bus organization of 8085 microprocessor
Bus is a group of conducting wires which carries information, all the peripherals are connected
to microprocessor through Bus.

There are three types of buses.


a) Address bus – It is a group of conducting wires which carries address only. Address bus
is unidirectional because data flow in one direction, from microprocessor to memory or
from microprocessor to Input/output devices (That is, Out of Microprocessor).

b) Data bus –
It is a group of conducting wires which carries Data only. Data bus is bidirectional
because data flow in both directions, from microprocessor to memory or Input/output
devices and from memory or Input/output devices to microprocessor.

c) Control bus –
It is a group of wires, which is used to generate timing and control signals to control all
the associated peripherals, microprocessor uses control bus to process data, that is
what to do with selected memory location. Some control signals are:
- Memory read
- Memory write
- I/O read
- I/O Write

3
8085 Microprocessor & its Operation
8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor
designed by Intel in 1977 using NMOS technology.

It has the following configuration –


- 8-bit data bus
- 16-bit address bus, which can address up to 64KB
- A 16-bit program counter
- A 16-bit stack pointer
- Six 8-bit registers arranged in pairs: BC, DE, HL
- Requires +5V supply to operate at 3.2 MHZ single phase clock

It is used in washing machines, microwave ovens, mobile phones, etc.

8085 Microprocessor Architecture & Functional Units

Fig: Block Diagram of 8085 Microprocessor

4
8085 consists of the following functional units −
1) Accumulator
It is an 8-bit register used to perform arithmetic, logical, I/O & LOAD/STORE operations.
It is connected to internal data bus & ALU.

2) Arithmetic and logic unit


As the name suggests, it performs arithmetic and logical operations like Addition,
Subtraction, AND, OR, etc. on 8-bit data.

3) General purpose register


There are 6 general purpose registers in 8085 processor, i.e. B, C, D, E, H & L. Each
register can hold 8-bit data. These registers can work in pair to hold 16-bit data and
their pairing combination is like B-C, D-E & H-L.

4) Program counter
It is a 16-bit register used to store the memory address location of the next instruction
to be executed. Microprocessor increments the program whenever an instruction is
being executed, so that the program counter points to the memory address of the next
instruction that is going to be executed.

5) Stack pointer
It is also a 16-bit register works like stack, which is always incremented/decremented by
2 during push & pop operations.

6) Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic and logical
operations.

7) Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending
upon the result stored in the accumulator.
These are the set of 5 flip-flops –
- Sign (S)
- Zero (Z)
- Auxiliary Carry (AC)
- Parity (P)
- Carry (C)

Its bit position is shown in the following table –

D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY

5
8) Instruction register and decoder
It is an 8-bit register. When an instruction is fetched from memory then it is stored in
the Instruction register. Instruction decoder decodes the information present in the
Instruction register.

9) Timing and control unit


It provides timing and control signal to the microprocessor to perform operations.
Following are the timing and control signals-
- Control Signals: READY, RD’, WR’, ALE
- Status Signals: S0, S1, IO/M’
- DMA Signals: HOLD, HLDA
- RESET Signals: RESET IN, RESET OUT

10) Interrupt control


As the name suggests it controls the interrupts during a process. When a
microprocessor is executing a main program and whenever an interrupt occurs, the
microprocessor shifts the control from the main program to process the incoming
request. After the request is completed, the control goes back to the main program.
There are 5 interrupt signals in 8085 microprocessor: INTR, RST 7.5, RST 6.5, RST 5.5,
TRAP.

11) Serial Input/output control


It controls the serial data communication by using these two instructions: SID (Serial
input data) and SOD (Serial output data).

12) Address buffer and address-data buffer


The content stored in the stack pointer and program counter is loaded into the address
buffer and address-data buffer to communicate with the CPU. The memory and I/O
chips are connected to these buses; the CPU can exchange the desired data with the
memory and I/O chips.

13) Address bus and data bus


Data bus carries the data to be stored. It is bidirectional, whereas address bus carries
the location to where it should be stored and it is unidirectional. It is used to transfer
the data & Address I/O devices.

6
8085 Pin Configuration

The pins of a 8085 microprocessor can be classified into seven groups −


1) Address bus
A15-A8, it carries the most significant 8-bits of memory/IO address.

2) Data bus
AD7-AD0, it carries the least significant 8-bit address and data bus.

3) Control and status signals


These signals are used to identify the nature of operation. There are 3 control signal and
3 status signals.
Three control signals are RD, WR & ALE.

a) RD − This signal indicates that the selected IO or memory device is to be read and is
ready for accepting data available on the data bus.

7
b) WR − This signal indicates that the data on the data bus is to be written into a selected
memory or IO location.

c) ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes
down it indicates data.

Three status signals are IO/M, S0 & S1.

IO/M
This signal is used to differentiate between IO and Memory operations, i.e. when it is high
indicates IO operation and when it is low then it indicates memory operation.

S1 & S0
These signals are used to identify the type of current operation.

4) Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v power supply and VSS
indicates ground signal.

5) Clock signals
There are 3 clock signals, i.e. X1, X2, CLK OUT.

6) Interrupts & externally initiated signals


Interrupts are the signals generated by external devices to request the microprocessor
to perform a task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and
INTR.

7) Serial I/O signals


There are 2 serial signals, i.e. SID (Serial output data line) and SOD (Serial input data line)
and these signals are used for serial communication.

Instruction cycle, Machine Cycle & T State in 8085 microprocessor


Time required to execute and fetch an entire instruction is called instruction cycle.
It consists:
a) Fetch cycle – The next instruction is fetched by the address stored in program counter
(PC) and then stored in the instruction register.
b) Decode instruction – Decoder interprets the encoded instruction from instruction
register.
c) Reading effective address – The address given in instruction is read from main memory
and required data is fetched. The effective address depends on direct addressing mode
or indirect addressing mode.
d) Execution cycle – consists memory read (MR), memory write (MW), input output read
(IOR) and input output write (IOW).
8
The time required by the microprocessor to complete an operation of accessing memory or
input/output devices is called machine cycle.
One time period of frequency of microprocessor is called t-state. A t-state is measured from the
falling edge of one clock pulse to the falling edge of the next clock pulse.
Fetch cycle takes four t-states and execution cycle takes three t-states.

Addressing Modes in 8085


To perform any operation, we have to give the corresponding instructions to the
microprocessor. In each instruction, programmer has to specify 3 things:
1. Operation to be performed.
2. Address of source of data.
3. Address of destination of result.

The method by which the address of source of data or the address of destination of result is
given in the instruction is called Addressing Modes. The term addressing mode refers to the
way in which the operand of the instruction is specified.

Intel 8085 uses the following addressing modes:


1) Direct Addressing Mode
2) Register Addressing Mode
3) Register Indirect Addressing Mode
4) Immediate Addressing Mode
5) Implicit Addressing Mode

9
Direct Addressing Mode
In direct addressing mode, the data to be operated is available inside a memory location and
that memory location is directly specified as an operand. The operand is directly available in the
instruction itself.
Example:
LDA 2050 (load the contents of memory location into accumulator A)
Register Addressing Mode
In register addressing mode, the data to be operated is available inside the register(s) and
register(s) is(are) operands. Therefore, the operation is performed within various registers of
the microprocessor.
Examples:
MOV A, B (move the contents of register B to register A)
ADD B (add contents of registers A and B and store the result in register A)
INR A (increment the contents of register A by one)

Register Indirect Addressing Mode


In register indirect addressing mode, the data to be operated is available inside a memory
location and that memory location is indirectly specified by a register pair.
Example:
MOV A, M (move the contents of the memory location pointed by the H-L pair to the
accumulator)

Immediate Addressing Mode


In immediate addressing mode the source operand is always data. If the data is 8-bit, then the
instruction will be of 2 bytes, if the data is of 16-bit then the instruction will be of 3 bytes.
Example:
MVI B 45 (move the data 45H immediately to register B)

Implied/Implicit Addressing Mode


In implied/implicit addressing mode the operand is hidden and the data to be operated is
available in the instruction itself.
Examples:
RRC (rotate accumulator A right by one bit)
RLC (rotate accumulator A left by one bit)

Introduction to 8086
8086 Microprocessor is an enhanced version of 8085Microprocessor that was designed by Intel
in 1976. It is a 16-bit Microprocessor having 20 address lines and16 data lines that provides up
to 1MB storage. It consists of powerful instruction set, which provides operations like
multiplication and division easily.

It supports two modes of operation, i.e. Maximum mode and Minimum mode. Maximum mode
is suitable for system having multiple processors and Minimum mode is suitable for system
having a single processor.
10
Features of 8086
a) It has an instruction queue, which is capable of storing six instruction bytes from the
memory resulting in faster processing.
b) It was the first 16-bit processor having 16-bit ALU, 16-bit registers, internal data bus,
and 16-bit external data bus resulting in faster processing.
c) It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage, which improves
performance. Fetch stage can prefetch up to 6 bytes of instructions and stores them in
the queue. Execute stage executes these instructions.
d) It consists of 29,000 transistors.

Comparison between 8085 & 8086 Microprocessor


a) Size − 8085 is 8-bit microprocessor, whereas 8086 is 16-bit microprocessor.
b) Address Bus − 8085 has 16-bit address bus while 8086 has 20-bit address bus.
c) Memory − 8085 can access up to 64Kb, whereas 8086 can access up to 1 Mb of
memory.
d) Instruction − 8085 doesn’t have an instruction queue, whereas 8086 has an instruction
queue.
e) Pipelining − 8085 doesn’t support a pipelined architecture while 8086 supports a
pipelined architecture.
f) I/O − 8085 can address 2^8 = 256 I/O's, whereas 8086 can access 2^16 = 65,536 I/O's.
g) Cost − The cost of 8085 is low whereas that of 8086 is high.

11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy