0% found this document useful (0 votes)
28 views33 pages

Embedded Microprocessors and Its Applications

Embedded microprocessors are integral components in various devices, providing functionalities such as signal processing and real-time computing. They consist of several parts, including the ALU, memory unit, control unit, and registers, and can be classified into different types based on their architecture and application. Their applications range from general-purpose computing in personal computers to specialized functions in industrial automation and medical instrumentation.

Uploaded by

numbert163
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views33 pages

Embedded Microprocessors and Its Applications

Embedded microprocessors are integral components in various devices, providing functionalities such as signal processing and real-time computing. They consist of several parts, including the ALU, memory unit, control unit, and registers, and can be classified into different types based on their architecture and application. Their applications range from general-purpose computing in personal computers to specialized functions in industrial automation and medical instrumentation.

Uploaded by

numbert163
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Embedded Microprocessors and Its

Applications
An embedded microprocessor is a computer chip used inside several devices and equipments
to provide added functionality. A microprocessor is a digital-electronic component with
transistors integrated on a single semiconductor IC that is small and consumes less power.
Due to flexibility, cost, programmability and adaptability microcontrollers are
popular to implement various types of controllers that we know from the electronics
history. The functions of the microprocessor include fetching, decoding and processing the
data.

embedded microprocessor
Embedded microprocessor systems are nothing but computer chips that
are integral part of lighting system, home appliances, industrial
equipments, etc. Generally, microprocessors are used in signal processing,
general computing and real-time computing data. As a signal processor,
microprocessors’ uses in digital televisions include decoding of the digital
and radio signals. In real-time systems, microprocessors are embedded in
security devices like anti-lock breaking system; these systems are widely
used in automobiles. Its importance includes:

Handling many functions like calculations and word processing at higher


speeds

Performing operations for the repetitive, continuous, progressive and


sequential functions without human labor

Communicating with the internet, telephones and other interfacing


devices

Block diagram of an Embedded


Microprocessor
A microprocessor chip is built by using semiconductor devices wherein
thousands of transistors are integrated into a single chip for better
performance. When we look at microprocessor’s history, the Pentium 4
processors have around 40-50 million transistors. The major
microprocessor’s parts include:

ALU (Arithmetic Logic Unit)


Memory unit

Control Unit

Registers

System Bus

Arithmetic Logic Unit


An ALU is also known as integer unit as it is used to perform logical
operations like Not, OR AND, and math calculations like add, subtract,
divide, multiply and comparisons like greater then, less than, etc.

Memory Unit
Cache memory is a small amount of memory located on the chip of a
microprocessor. A microprocessor stores a copy of data and instructions in
its cache memory while executing the program. Types of microprocessor
memory include ROM and RAM.

Control Unit
Control Unit is the brain of a microprocessor as it manages complete
operations. It performs the operations like managing input, output
devices, storing data and fetching instructions.

Registers
Registers are small, fast memories built into the central processing unit
(CPU) to speed up its operation. General purpose registers store arbitrary
data and special purpose registers control the processor.

System Bus
System bus is a single wire used to attach different components to
communicate with the internal and external parts of the microprocessor.
The bus receives data and instructions from the main memory, and then
sends them to instruction cache and data cache. Finally these are
processed and the results are again sent to the main memory through this
bus.
Types of Microprocessors
The classification of embedded-microprocessor depends on several factors
like computing performance, availability of memory, type of application,
etc., and some of these microprocessors include:

Complex instruction set microprocessors

Reduced instruction set microprocessors

Superscalar microprocessors

Application specific integrated circuit (ASIC)

Digital signal microprocessors (DSPs)

Applications of Microprocessor

Applications of Microprocessor
These microprocessors can be used for general purpose applications or
special purpose applications. The applications of microprocessors include
the following:

1. General Purpose Applications

Microprocessors for general purpose applications include personal


computers, single-board micro computers, super minis and Computer
Aided Designs (CAD).
Personal Computers
Personal computers have 8-bit or 16-bit microprocessors. Home computers
come with 8-bit microprocessor for learning programs and playing video
games, whereas the computers with 16- bit microprocessor are used for
business, accounts, word processing, and other purposes.

Single-Board Micro Computers


The single-board micro computers have simple hardware and software
configuration and are cheaper. These micro computers are used to build
small computer systems and to train students.

Super minis and CAD


32 -bit processors are used in powerful microcomputers. And, as a result,
the performance of these computers is far better than the mini computers;
and, these are used in engineering side as CAD machines.

2. Special Purpose Application

special purpose application includes control, communication,


instrumentation, office automation and publication.

Communication
In telephone industry, microprocessors are used in modems, telephone
exchanges, digital telephone sets, and also in air reservation systems and
railway reservation systems both at international and national levels.
Mobile phones and televisions also use microprocessors.

Instrumentation
In various instruments, microprocessors are implemented as main
controllers and also used in medical instruments to measure
temperature and blood pressure.

Control
Microprocessors are now available in home appliances like washing
machines and microwave ovens; and, in industrial-
automation sectors, microcontrollers are used to control various
parameters like temperature, speed, moisture and pressure.

Publication and Office Automation


These are used in office to perform spread sheet operations, and storage.
In publication, microprocessors are used in LASER printers for good speed
and making automatic photo copies.

This is all about the embedded microprocessor systems and their


applications. We believe that the information given in this topic is worth
considering the importance of microprocessors. Please share your
suggestions and opinions about this article or electrical and electronic
projects in the comment section.

MICROPROSESSOR

Microprocessor, any of a type of miniature electronic device that


contains the arithmetic, logic, and control circuitry necessary to perform
the functions of a digital computer’s central processing unit. In effect, this
kind of integrated circuit can interpret and execute program instructions
as well as handle arithmetic operations.

In the early 1970s the introduction of large-scale integration (LSI)—which


made it possible to pack thousands of transistors, diodes,
and resistors onto a silicon chip less than 0.2 inch (5 mm) square—led to
the development of the microprocessor. The first microprocessor was
the Intel 4004, which was introduced in 1971. During the early 1980s very
large-scale integration (VLSI) vastly increased the circuit density of
microprocessors. In the 2010s a single VLSI circuit holds billions of
electronic components on a chip identical in size to the LSI circuit. (For
more about the history of microprocessors, see computer: The
microprocessor.)

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.

List of Terms Used in a Microprocessor

Here is a list of some of the frequently used terms in a microprocessor −

 Instruction Set − It is the set of instructions that the microprocessor can understand.
 Bandwidth − It is the number of bits processed in a single instruction.
 Clock Speed − It determines the number of operations per second the processor can perform. It
is expressed in megahertz (MHz) or gigahertz (GHz).It is also known as Clock Rate.
 Word Length − It depends upon the width of internal data bus, registers, ALU, etc. An 8-bit
microprocessor can process 8-bit data at a time. The word length ranges from 4 bits to 64 bits
depending upon the type of the microcomputer.
 Data Types − The microprocessor has multiple data type formats like binary, BCD, ASCII, signed
and unsigned numbers.

Features of a Microprocessor

Here is a list of some of the most prominent features of any microprocessor −

 Cost-effective − The microprocessor chips are available at low prices and results its low cost.
 Size − The microprocessor is of small size chip, hence is portable.
 Low Power Consumption − Microprocessors are manufactured by using metaloxide
semiconductor technology, which has low power consumption.
 Versatility − The microprocessors are versatile as we can use the same chip in a number of
applications by configuring the software program.
 Reliability − The failure rate of an IC in microprocessors is very low, hence it is reliable.

A microprocessor can be classified into three categories −


RISC Processor

RISC stands for Reduced Instruction Set Computer. It is designed to reduce the execution time by
simplifying the instruction set of the computer. Using RISC processors, each instruction requires only
one clock cycle to execute results in uniform execution time. This reduces the efficiency as there are
more lines of code, hence more RAM is needed to store the instructions. The compiler also has to work
more to convert high-level language instructions into machine code.

Some of the RISC processors are −

 Power PC: 601, 604, 615, 620


 DEC Alpha: 210642, 211066, 21068, 21164
 MIPS: TS (R10000) RISC Processor
 PA-RISC: HP 7100LC
Architecture of RISC

RISC microprocessor architecture uses highly-optimized set of instructions. It is used in portable


devices like Apple iPod due to its power efficiency.
Characteristics of RISC

The major characteristics of a RISC processor are as follows −

 It consists of simple instructions.


 It supports various data-type formats.
 It utilizes simple addressing modes and fixed length instructions for pipelining.
 It supports register to use in any context.
 One cycle execution time.
 “LOAD” and “STORE” instructions are used to access the memory location.
 It consists of larger number of registers.
 It consists of less number of transistors.

CISC Processor

CISC stands for Complex Instruction Set Computer. It is designed to minimize the number of
instructions per program, ignoring the number of cycles per instruction. The emphasis is on building
complex instructions directly into the hardware.
The compiler has to do very little work to translate a high-level language into assembly level
language/machine code because the length of the code is relatively short, so very little RAM is required
to store the instructions.

Some of the CISC Processors are −

 IBM 370/168
 VAX 11/780
 Intel 80486
Architecture of CISC

Its architecture is designed to decrease the memory cost because more storage is needed in larger
programs resulting in higher memory cost. To resolve this, the number of instructions per program can
be reduced by embedding the number of operations in a single instruction.

Characteristics of CISC
 Variety of addressing modes.
 Larger number of instructions.
 Variable length of instruction formats.
 Several cycles may be required to execute one instruction.
 Instruction-decoding logic is complex.
 One instruction is required to support multiple addressing modes.

Special Processors

These are the processors which are designed for some special purposes. Few of the special
processors are briefly discussed −

Coprocessor

A coprocessor is a specially designed microprocessor, which can handle its particular function many
times faster than the ordinary microprocessor.

For example − Math Coprocessor.

Some Intel math-coprocessors are −

 8087-used with 8086


 80287-used with 80286
 80387-used with 80386
Input/Output Processor

It is a specially designed microprocessor having a local memory of its own, which is used to control I/O
devices with minimum CPU involvement.

For example −

 DMA (direct Memory Access) controller


 Keyboard/mouse controller
 Graphic display controller
 SCSI port controller
Transputer (Transistor Computer)

A transputer is a specially designed microprocessor with its own local memory and having links to
connect one transputer to another transputer for inter-processor communications. It was first designed
in 1980 by Inmos and is targeted to the utilization of VLSI technology.

A transputer can be used as a single processor system or can be connected to external links, which
reduces the construction cost and increases the performance.

For example − 16-bit T212, 32-bit T425, the floating point (T800, T805 & T9000) processors.

DSP (Digital Signal Processor)


This processor is specially designed to process the analog signals into a digital form. This is done by
sampling the voltage level at regular time intervals and converting the voltage at that instant into a
digital form. This process is performed by a circuit called an analogue to digital converter, A to D
converter or ADC.

A DSP contains the following components −

 Program Memory − It stores the programs that DSP will use to process data.
 Data Memory − It stores the information to be processed.
 Compute Engine − It performs the mathematical processing, accessing the program from the
program memory and the data from the data memory.
 Input/Output − It connects to the outside world.

Its applications are −

 Sound and music synthesis


 Audio and video compression
 Video signal processing
 2D and 3d graphics acceleration.

Microprocessor – Functional Units

8085 consists of the following functional units −

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.

Arithmetic and logic unit

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

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.

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.

Stack pointer

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

Temporary register

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

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

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.

Timing and control unit

It provides timing and control signal to the microprocessor to perform operations. Following are the
timing and control signals, which control external and internal circuits −

 Control Signals: READY, RD’, WR’, ALE


 Status Signals: S0, S1, IO/M’
 DMA Signals: HOLD, HLDA
 RESET Signals: RESET IN, RESET OUT
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.

Serial Input/output control

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

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.

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.

Architecture

We have tried to depict the architecture of 8085 with this following image −
Address bus

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

Data bus

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

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.

 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.
 WR − This signal indicates that the data on the data bus is to be written into a selected memory
or IO location.
 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.

Power supply

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

Clock signals

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

 X1, X2 − A crystal (RC, LC N/W) is connected at these two pins and is used to set frequency of
the internal clock generator. This frequency is internally divided by 2.
 CLK OUT − This signal is used as the system clock for devices connected with the
microprocessor.

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. We will discuss
interrupts in detail in interrupts section.

 INTA − It is an interrupt acknowledgment signal.


 RESET IN − This signal is used to reset the microprocessor by setting the program counter to
zero.
 RESET OUT − This signal is used to reset all the connected devices when the microprocessor is
reset.
 READY − This signal indicates that the device is ready to send or receive data. If READY is low,
then the CPU has to wait for READY to go high.
 HOLD − This signal indicates that another master is requesting the use of the address and data
buses.
 HLDA (HOLD Acknowledge) − It indicates that the CPU has received the HOLD request and it
will relinquish the bus in the next clock cycle. HLDA is set to low after the HOLD signal is
removed.

Addressing Modes

These are the instructions used to transfer the data from one register to another register, from the
memory to the register, and from the register to the memory without any alteration in the content.
Addressing modes in 8085 is classified into 5 groups −

Immediate addressing mode

In this mode, the 8/16-bit data is specified in the instruction itself as one of its operand. For
example: MVI K, 20F: means 20F is copied into register K.

Register addressing mode

In this mode, the data is copied from one register to another. For example: MOV K, B: means data in
register B is copied to register K.

Direct addressing mode

In this mode, the data is directly copied from the given address to the register. For example: LDB
5000K: means the data at address 5000K is copied to register B.

Indirect addressing mode

In this mode, the data is transferred from one register to another by using the address pointed by the
register. For example: MOV K, B: means data is transferred from the memory address pointed by the
register to the register K.

Implied addressing mode

This mode doesn’t require any operand; the data is specified by the opcode itself. For example: CMP.
Interrupts in 8085

Interrupts are the signals generated by the 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.

Interrupt are classified into following groups based on their parameter −

 Vector interrupt − In this type of interrupt, the interrupt address is known to the processor. For
example: RST7.5, RST6.5, RST5.5, TRAP.
 Non-Vector interrupt − In this type of interrupt, the interrupt address is not known to the
processor so, the interrupt address needs to be sent externally by the device to perform
interrupts. For example: INTR.
 Maskable interrupt − In this type of interrupt, we can disable the interrupt by writing some
instructions into the program. For example: RST7.5, RST6.5, RST5.5.
 Non-Maskable interrupt − In this type of interrupt, we cannot disable the interrupt by writing
some instructions into the program. For example: TRAP.
 Software interrupt − In this type of interrupt, the programmer has to add the instructions into the
program to execute the interrupt. There are 8 software interrupts in 8085, i.e. RST0, RST1,
RST2, RST3, RST4, RST5, RST6, and RST7.
 Hardware interrupt − There are 5 interrupt pins in 8085 used as hardware interrupts, i.e. TRAP,
RST7.5, RST6.5, RST5.5, INTA.

Features of 8086

The most prominent features of a 8086 microprocessor are as follows −

 It has an instruction queue, which is capable of storing six instruction bytes from the memory
resulting in faster processing.
 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.
 It is available in 3 versions based on the frequency of operation −
o 8086 → 5MHz
o 8086-2 → 8MHz
o (c)8086-1 → 10 MHz
 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.
 It has 256 vectored interrupts.
 It consists of 29,000 transistors.

Comparison between 8085 & 8086 Microprocessor

 Size − 8085 is 8-bit microprocessor, whereas 8086 is 16-bit microprocessor.


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

Data Transfer Instructions

These instructions are used to transfer the data from the source operand to the destination operand.
Following are the list of instructions under this group −

Instruction to transfer a word


 MOV − Used to copy the byte or word from the provided source to the provided destination.
 PPUSH − Used to put a word at the top of the stack.
 POP − Used to get a word from the top of the stack to the provided location.
 PUSHA − Used to put all the registers into the stack.
 POPA − Used to get words from the stack to all registers.
 XCHG − Used to exchange the data from two locations.
 XLAT − Used to translate a byte in AL using a table in the memory.
Instructions for input and output port transfer
 IN − Used to read a byte or word from the provided port to the accumulator.
 OUT − Used to send out a byte or word from the accumulator to the provided port.
Instructions to transfer the address
 LEA − Used to load the address of operand into the provided register.
 LDS − Used to load DS register and other provided register from the memory
 LES − Used to load ES register and other provided register from the memory.

Instructions to transfer flag registers


 LAHF − Used to load AH with the low byte of the flag register.
 SAHF − Used to store AH register to low byte of the flag register.
 PUSHF − Used to copy the flag register at the top of the stack.
 POPF − Used to copy a word at the top of the stack to the flag register.

Arithmetic Instructions

These instructions are used to perform arithmetic operations like addition, subtraction, multiplication,
division, etc.

Following is the list of instructions under this group −

Instructions to perform addition


 ADD − Used to add the provided byte to byte/word to word.
 ADC − Used to add with carry.
 INC − Used to increment the provided byte/word by 1.
 AAA − Used to adjust ASCII after addition.
 DAA − Used to adjust the decimal after the addition/subtraction operation.
Instructions to perform subtraction
 SUB − Used to subtract the byte from byte/word from word.
 SBB − Used to perform subtraction with borrow.
 DEC − Used to decrement the provided byte/word by 1.
 NPG − Used to negate each bit of the provided byte/word and add 1/2’s complement.
 CMP − Used to compare 2 provided byte/word.
 AAS − Used to adjust ASCII codes after subtraction.
 DAS − Used to adjust decimal after subtraction.
Instruction to perform multiplication
 MUL − Used to multiply unsigned byte by byte/word by word.
 IMUL − Used to multiply signed byte by byte/word by word.
 AAM − Used to adjust ASCII codes after multiplication.
Instructions to perform division
 DIV − Used to divide the unsigned word by byte or unsigned double word by word.
 IDIV − Used to divide the signed word by byte or signed double word by word.
 AAD − Used to adjust ASCII codes after division.
 CBW − Used to fill the upper byte of the word with the copies of sign bit of the lower byte.
 CWD − Used to fill the upper word of the double word with the sign bit of the lower word.
Bit Manipulation Instructions

These instructions are used to perform operations where data bits are involved, i.e. operations like
logical, shift, etc.

Following is the list of instructions under this group −

Instructions to perform logical operation


 NOT − Used to invert each bit of a byte or word.
 AND − Used for adding each bit in a byte/word with the corresponding bit in another byte/word.
 OR − Used to multiply each bit in a byte/word with the corresponding bit in another byte/word.
 XOR − Used to perform Exclusive-OR operation over each bit in a byte/word with the
corresponding bit in another byte/word.
 TEST − Used to add operands to update flags, without affecting operands.
Instructions to perform shift operations
 SHL/SAL − Used to shift bits of a byte/word towards left and put zero(S) in LSBs.
 SHR − Used to shift bits of a byte/word towards the right and put zero(S) in MSBs.
 SAR − Used to shift bits of a byte/word towards the right and copy the old MSB into the new
MSB.
Instructions to perform rotate operations
 ROL − Used to rotate bits of byte/word towards the left, i.e. MSB to LSB and to Carry Flag [CF].
 ROR − Used to rotate bits of byte/word towards the right, i.e. LSB to MSB and to Carry Flag [CF].
 RCR − Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB.
 RCL − Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB.

String Instructions

String is a group of bytes/words and their memory is always allocated in a sequential order.

Following is the list of instructions under this group −

 REP − Used to repeat the given instruction till CX ≠ 0.


 REPE/REPZ − Used to repeat the given instruction until CX = 0 or zero flag ZF = 1.
 REPNE/REPNZ − Used to repeat the given instruction until CX = 0 or zero flag ZF = 1.
 MOVS/MOVSB/MOVSW − Used to move the byte/word from one string to another.
 COMS/COMPSB/COMPSW − Used to compare two string bytes/words.
 INS/INSB/INSW − Used as an input string/byte/word from the I/O port to the provided memory
location.
 OUTS/OUTSB/OUTSW − Used as an output string/byte/word from the provided memory location
to the I/O port.
 SCAS/SCASB/SCASW − Used to scan a string and compare its byte with a byte in AL or string
word with a word in AX.
 LODS/LODSB/LODSW − Used to store the string byte into AL or string word into AX.

Processor Control Instructions

These instructions are used to control the processor action by setting/resetting the flag values.

Following are the instructions under this group −

 STC − Used to set carry flag CF to 1


 CLC − Used to clear/reset carry flag CF to 0
 CMC − Used to put complement at the state of carry flag CF.
 STD − Used to set the direction flag DF to 1
 CLD − Used to clear/reset the direction flag DF to 0
 STI − Used to set the interrupt enable flag to 1, i.e., enable INTR input.
 CLI − Used to clear the interrupt enable flag to 0, i.e., disable INTR input.

Iteration Control Instructions

These instructions are used to execute the given instructions for number of times. Following is the list of
instructions under this group −

 LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0
 LOOPE/LOOPZ − Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0
 LOOPNE/LOOPNZ − Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0
 JCXZ − Used to jump to the provided address if CX = 0

Interrupt Instructions

These instructions are used to call the interrupt during program execution.
 INT − Used to interrupt the program during execution and calling service specified.
 INTO − Used to interrupt the program during execution if OF = 1
 IRET − Used to return from interrupt service to the main program

Interrupt is the method of creating a temporary halt during program execution and allows peripheral
devices to access the microprocessor. The microprocessor responds to that interrupt with
an ISR (Interrupt Service Routine), which is a short program to instruct the microprocessor on how to
handle the interrupt.

The following image shows the types of interrupts we have in a 8086 microprocessor −

Hardware Interrupts

Hardware interrupt is caused by any peripheral device by sending a signal through a specified pin to the
microprocessor.

The 8086 has two hardware interrupt pins, i.e. NMI and INTR. NMI is a non-maskable interrupt and
INTR is a maskable interrupt having lower priority. One more interrupt pin associated is INTA called
interrupt acknowledge.

NMI

It is a single non-maskable interrupt pin (NMI) having higher priority than the maskable interrupt request
pin (INTR)and it is of type 2 interrupt.

When this interrupt is activated, these actions take place −


 Completes the current instruction that is in progress.
 Pushes the Flag register values on to the stack.
 Pushes the CS (code segment) value and IP (instruction pointer) value of the return address on
to the stack.
 IP is loaded from the contents of the word location 00008H.
 CS is loaded from the contents of the next word location 0000AH.
 Interrupt flag and trap flag are reset to 0.
INTR

The INTR is a maskable interrupt because the microprocessor will be interrupted only if interrupts are
enabled using set interrupt flag instruction. It should not be enabled using clear interrupt Flag
instruction.

The INTR interrupt is activated by an I/O port. If the interrupt is enabled and NMI is disabled, then the
microprocessor first completes the current execution and sends ‘0’ on INTA pin twice. The first ‘0’
means INTA informs the external device to get ready and during the second ‘0’ the microprocessor
receives the 8 bit, say X, from the programmable interrupt controller.

These actions are taken by the microprocessor −

 First completes the current instruction.


 Activates INTA output and receives the interrupt type, say X.
 Flag register value, CS value of the return address and IP value of the return address are pushed
on to the stack.
 IP value is loaded from the contents of word location X × 4
 CS is loaded from the contents of the next word location.
 Interrupt flag and trap flag is reset to 0

Software Interrupts

Some instructions are inserted at the desired position into the program to create interrupts. These
interrupt instructions can be used to test the working of various interrupt handlers. It includes −

INT- Interrupt instruction with type number

It is 2-byte instruction. First byte provides the op-code and the second byte provides the interrupt type
number. There are 256 interrupt types under this group.
Its execution includes the following steps −

 Flag register value is pushed on to the stack.


 CS value of the return address and IP value of the return address are pushed on to the stack.
 IP is loaded from the contents of the word location ‘type number’ × 4
 CS is loaded from the contents of the next word location.
 Interrupt Flag and Trap Flag are reset to 0

Coprocessor Configuration

A Coprocessor is a specially designed circuit on microprocessor chip which can perform the same task
very quickly, which the microprocessor performs. It reduces the work load of the main processor. The
coprocessor shares the same memory, IO system, bus, control logic and clock generator. The
coprocessor handles specialized tasks like mathematical calculations, graphical display on screen, etc.

The 8086 and 8088 can perform most of the operations but their instruction set is not able to perform
complex mathematical operations, so in these cases the microprocessor requires the math coprocessor
like Intel 8087 math coprocessor, which can easily perform these operations very quickly.

Block Diagram of Coprocessor Configuration

How is the coprocessor and the processor connected?


 The coprocessor and the processor is connected via TEST, RQ-/GT- and QS0 & QS1 signals.
 The TEST signal is connected to BUSY pin of coprocessor and the remaining 3 pins are
connected to the coprocessor’s 3 pins of the same name.
 TEST signal takes care of the coprocessor’s activity, i.e. the coprocessor is busy or idle.
 The RT-/GT-is used for bus arbitration.
 The coprocessor uses QS0 & QS1 to track the status of the queue of the host processor.

Closely Coupled Configuration


Closely coupled configuration is similar to the coprocessor configuration, i.e. both share the same
memory, I/O system bus, control logic, and control generator with the host processor. However, the
coprocessor and the host processor fetches and executes their own instructions. The system bus is
controlled by the coprocessor and the host processor independently.

Block Diagram of Closely Coupled Configuration

How is the processor and the independent processor connected?


 Communication between the host and the independent processor is done through memory
space.
 None of the instructions are used for communication, like WAIT, ESC, etc.
 The host processor manages the memory and wakes up the independent processor by sending
commands to one of its ports.
 Then the independent processor accesses the memory to execute the task.
 After completion of the task, it sends an acknowledgement to the host processor by using the
status signal or an interrupt request.

Loosely Coupled Configuration

Loosely coupled configuration consists of the number of modules of the microprocessor based systems,
which are connected through a common system bus. Each module consists of their own clock
generator, memory, I/O devices and are connected through a local bus.

Advantages
 Having more than one processor results in increased efficiency.
 Each of the processors have their own local bus to access the local memory/I/O devices. This
makes it easy to achieve parallel processing.
 The system structure is flexible, i.e. the failure of one module doesn’t affect the whole system
failure; faulty module can be replaced later.

8087 numeric data processor is also known as Math co-processor, Numeric processor
extension and Floating point unit. It was the first math coprocessor designed by Intel to pair with
8086/8088 resulting in easier and faster calculation.

Once the instructions are identified by the 8086/8088 processor, then it is allotted to the 8087 co-
processor for further execution.

The data types supported by 8087 are −

 Binary Integers
 Packed decimal numbers
 Real numbers
 Temporary real format

The most prominent features of 8087 numeric data processor are as follows −

 It supports data of type integer, float, and real types ranging from 2-10 bytes.
 The processing speed is so high that it can calculate multiplication of two 64-bits real numbers in
~27 µs and can also calculate square-root in ~35 µs.
 It follows IEEE floating point standards.

Disadvantages of a microprocessor
 The main disadvantages are it's overheating physically.
 It is only based on machine language.
 The overall cost is high.
 The large size of PCB is required for assembling all components.
 The physical size of the product is big.
 Overall product design requires more time.

Memory Interfacing

When we are executing any instruction, we need the microprocessor to access the memory for reading
instruction codes and the data stored in the memory. For this, both the memory and the microprocessor
requires some signals to read from and write to registers.
The interfacing process includes some key factors to match with the memory requirements and
microprocessor signals. The interfacing circuit therefore should be designed in such a way that it
matches the memory signal requirements with the signals of the microprocessor.

IO Interfacing

There are various communication devices like the keyboard, mouse, printer, etc. So, we need to
interface the keyboard and other devices with the microprocessor by using latches and buffers. This
type of interfacing is known as I/O interfacing.

Block Diagram of Memory and I/O Interfacing

Interfacing Pins

Following is the list of 8085 pins used for interfacing with other devices −

 A15 - A8 (Higher Address Bus)


 AD7 - AD0(Lower Address/Data Bus)
 ALE
 RD
 WR
 READY

Ways of Communication − Microprocessor with the Outside World

There are two ways of communication in which the microprocessor can connect with the outside world.

 Serial Communication Interface


 Parallel Communication interface

Serial Communication Interface − In this type of communication, the interface gets a single byte of
data from the microprocessor and sends it bit by bit to the other system serially and vice-a-versa.

Parallel Communication Interface − In this type of communication, the interface gets a byte of data
from the microprocessor and sends it bit by bit to the other systems in simultaneous (or) parallel fashion
and vice-a-versa.

Difference between Microprocessor and Microcontroller

The following table highlights the differences between a microprocessor and a microcontroller −

Microcontroller Microprocessor

Microcontrollers are used to execute a single task within an application. Microprocessors are used for big
applications.

Its designing and hardware cost is low. Its designing and hardware cost is
high.

Easy to replace. Not so easy to replace.

It is built with CMOS technology, which requires less power to operate. Its power consumption is high
because it has to control the entire
system.

It consists of CPU, RAM, ROM, I/O ports. It doesn’t consist of RAM, ROM,
I/O ports. It uses its pins to
interface to peripheral devices.
Types of Microcontrollers

Microcontrollers are divided into various categories based on memory, architecture, bits and instruction
sets. Following is the list of their types −

Bit

Based on bit configuration, the microcontroller is further divided into three categories.

 8-bit microcontroller − This type of microcontroller is used to execute arithmetic and logical
operations like addition, subtraction, multiplication division, etc. For example, Intel 8031 and 8051
are 8 bits microcontroller.
 16-bit microcontroller − This type of microcontroller is used to perform arithmetic and logical
operations where higher accuracy and performance is required. For example, Intel 8096 is a 16-
bit microcontroller.
 32-bit microcontroller − This type of microcontroller is generally used in automatically controlled
appliances like automatic operational machines, medical appliances, etc.
Memory

Based on the memory configuration, the microcontroller is further divided into two categories.

 External memory microcontroller − This type of microcontroller is designed in such a way that
they do not have a program memory on the chip. Hence, it is named as external memory
microcontroller. For example: Intel 8031 microcontroller.
 Embedded memory microcontroller − This type of microcontroller is designed in such a way
that the microcontroller has all programs and data memory, counters and timers, interrupts, I/O
ports are embedded on the chip. For example: Intel 8051 microcontroller.
Instruction Set

Based on the instruction set configuration, the microcontroller is further divided into two categories.

 CISC − CISC stands for complex instruction set computer. It allows the user to insert a single
instruction as an alternative to many simple instructions.
 RISC − RISC stands for Reduced Instruction Set Computers. It reduces the operational time by
shortening the clock cycle per instruction.

Applications of Microcontrollers

Microcontrollers are widely used in various different devices such as −


 Light sensing and controlling devices like LED.
 Temperature sensing and controlling devices like microwave oven, chimneys.
 Fire detection and safety devices like Fire alarm.
Input Configuration

If any pin of this port is configured as an input, then it acts as if it “floats”, i.e. the input has unlimited
input resistance and in-determined potential.

Output Configuration

When the pin is configured as an output, then it acts as an “open drain”. By applying logic 0 to a port bit,
the appropriate pin will be connected to ground (0V), and applying logic 1, the external output will keep
on “floating”.

In order to apply logic 1 (5V) on this output pin, it is necessary to build an external pullup resistor.

Port 1

P1 is a true I/O port as it doesn’t have any alternative functions as in P0, but this port can be configured
as general I/O only. It has a built-in pull-up resistor and is completely compatible with TTL circuits.

Port 2

P2 is similar to P0 when the external memory is used. Pins of this port occupy addresses intended for
the external memory chip. This port can be used for higher address byte with addresses A8-A15. When
no memory is added then this port can be used as a general input/output port similar to Port 1.

Port 3

In this port, functions are similar to other ports except that the logic 1 must be applied to appropriate bit
of the P3 register.

Pins Current Limitations

 When pins are configured as an output (i.e. logic 0), then the single port pins can receive a
current of 10mA.
 When these pins are configured as inputs (i.e. logic 1), then built-in pull-up resistors provide very
weak current, but can activate up to 4 TTL inputs of LS series.
 If all 8 bits of a port are active, then the total current must be limited to 15mA (port P0: 26mA).
 If all ports (32 bits) are active, then the total maximum current must be limited to 71mA.

Operating Modes

8255A has three different operating modes −

 Mode 0 − In this mode, Port A and B is used as two 8-bit ports and Port C as two 4-bit ports.
Each port can be programmed in either input mode or output mode where outputs are latched
and inputs are not latched. Ports do not have interrupt capability.
 Mode 1 − In this mode, Port A and B is used as 8-bit I/O ports. They can be configured as either
input or output ports. Each port uses three lines from port C as handshake signals. Inputs and
outputs are latched.
 Mode 2 − In this mode, Port A can be configured as the bidirectional port and Port B either in
Mode 0 or Mode 1. Port A uses five signals from Port C as handshake signals for data transfer.
The remaining three signals from Port C can be used either as simple I/O or as handshake for
port B.

Features of 8255A

The prominent features of 8255A are as follows −

 It consists of 3 8-bit IO ports i.e. PA, PB, and PC.


 Address/data bus must be externally demux'd.
 It is TTL compatible.
 It has improved DC driving capability

Data Bus Buffer


It is a tri-state 8-bit buffer, which is used to interface the microprocessor to the system data bus. Data is
transmitted or received by the buffer as per the instructions by the CPU. Control words and status
information is also transferred using this bus.

Read/Write Control Logic

This block is responsible for controlling the internal/external transfer of data/control/status word. It
accepts the input from the CPU address and control buses, and in turn issues command to both the
control groups.

CS

It stands for Chip Select. A LOW on this input selects the chip and enables the communication between
the 8255A and the CPU. It is connected to the decoded address, and A 0 & A1 are connected to the
microprocessor address lines.

Mode 0 ─ Interrupt on Terminal Count

 It is used to generate an interrupt to the microprocessor after a certain interval.


 Initially the output is low after the mode is set. The output remains LOW after the count value is
loaded into the counter.
 The process of decrementing the counter continues till the terminal count is reached, i.e., the
count become zero and the output goes HIGH and will remain high until it reloads a new count.
 The GATE signal is high for normal counting. When GATE goes low, counting is terminated and
the current count is latched till the GATE goes high again.

Mode 1 – Programmable One Shot

 It can be used as a mono stable multi-vibrator.


 The gate input is used as a trigger input in this mode.
 The output remains high until the count is loaded and a trigger is applied.

Mode 2 – Rate Generator

 The output is normally high after initialization.


 Whenever the count becomes zero, another low pulse is generated at the output and the counter
will be reloaded.

Mode 3 – Square Wave Generator

 This mode is similar to Mode 2 except the output remains low for half of the timer period and high
for the other half of the period.

Mode 4 − Software Triggered Mode

 In this mode, the output will remain high until the timer has counted to zero, at which point the
output will pulse low and then go high again.
 The count is latched when the GATE signal goes LOW.
 On the terminal count, the output goes low for one clock cycle then goes HIGH. This low pulse
can be used as a strobe.

Mode 5 – Hardware Triggered Mode

 This mode generates a strobe in response to an externally generated signal.


 This mode is similar to mode 4 except that the counting is initiated by a signal at the gate input,
which means it is hardware triggered instead of software triggered.
 After it is initialized, the output goes high.
 When the terminal count is reached, the output goes low for one clock cycle.

You might also like