UNIT 1 Microprocessor
UNIT 1 Microprocessor
UNIT 1
Introduction
Course Objectives
CO 1: Apply the basic concepts of digital fundamentals to Microprocessor
based personal computer system.
CO 3: Illustrate how the different peripherals (8085/8086) are interfaced with
Microprocessor.
CO 5: Evaluate the data transfer information through serial & parallel ports.
DIAGRAM OF A COMPUTER SYSTEM
A computer is a programmable machine that receives input, stores and
manipulates data//information, and provides output in a useful
format.
Address bus
4
Basic Component of Microcomputer
CPU - Central Processing Unit
• the portion of a computer system that carries out the
instructions of a computer program
• the primary element carrying out the computer's functions.
It is the unit that reads and executes program instructions.
• The opcode in the instruction tells the processor what to do.
6
I/O Unit
7
DATA SIZE
Nibble 4 bit
Byte 8 bit
Word 16 bit
8
Internal structure and basic operation of
microprocessor
Address bus
ALU Register
Section
Data bus
10
Internal structure of ALU
11
Control unit
• The circuitry that controls the flow of information through the processor,
and coordinates the activities of the other units within it.
• In a way, it is the "brain within the brain", as it controls what happens
inside the processor, which in turn controls the rest of the PC.
• On a regular processor, the control unit performs the tasks of fetching,
decoding, managing execution and then storing results.
12
Register sets
• The register section/array consists completely of circuitry used to
temporarily store data or program codes until they are sent to the ALU or
to the control section or to memory.
• The number of registers are different for any particular CPU and the more
register a CPU have will result in easier programming tasks.
• Registers are normally measured by the number of bits they can hold, for
example, an "8-bit register" or a "32-bit register".
13
Evolution of Microprocessors
Technology Advancement
Microprocessor Types:
• Microprocessor are classified into various category on the following 3
bases-
Based on size of data bus
Based on Application
Based on architecture used in microprocessor
Based on size of data bus
• 4 bits microprocessor (Ex: intel 4004)
• 8 bits microprocessor (Ex: 8080,8085)
• 16 bits microprocessor (Ex 8086, 80286)
• 32 bits microprocessor (Ex: 80386, 80486, Pentium-I)
• 64 bits microprocessor (intel Core 2 duo,core I3,I5,I7)
Based on Application
• General Purpose microprocessor
• Specific purpose microprocessor(Microcontroller)
Based on architecture used in
microprocessor
• Reduced instruction set computer processor (RISC)
• Complex instruction set computer processor(CISC)
• Example – Suppose we have to add two 8-bit number:
• CISC approach: There will be a single command or instruction for this like ADD which will perform the
task.
• RISC approach: Here programmer will write first load command to load data in registers then it will use
suitable operator and then it will store result in desired location.
• So, add operation is divided into parts i.e. load, operate, store due to which RISC programs are longer and
require more memory to get stored but require less transistors due to less complex command.
CISC, RISC and EPIC
We have three basic types of microprocessors.
CISC (Complex Instruction Set Computer)
• As the name suggests, the instructions are in a complex form. It
means that a single instruction can contain many low-level
instructions.
• For example loading data from memory, storing data to the memory,
performing basic operations, etc.
• Besides, we can say that a single instruction has multiple addressing
modes. Furthermore, as there are many operations in single
instruction they use very few registers.
• Examples of CISC are Intel 386, Intel 486, Pentium, Pentium Pro,
Pentium II, etc.
RISC (Reduced Instruction Set Computer)
• As per the name, in this, the instructions are quite simple, and hence,
they execute quickly.
• Moreover, the instructions get complete in one clock cycle and also
use a few addressing modes only.
• Besides, it makes use of multiple registers so that interaction with
memory is less.
• Examples are IBM RS6000, DEC Alpha 21064, DEC Alpha 21164, etc.
EPIC (Explicitly Parallel Instruction Computing)
• It allows the instructions to compute parallelly by making use of
compilers.
• Moreover, the complex instructions also process in fewer clock
frequencies.
• It encodes the instructions in 128-bit bundles. Where each bundle
contains three instructions encoded in 41 bits each and a 5-bit
template. This 5-bit template contains information about the type of
instructions and that which instructions can be executed in parallel.
• Examples are IA-64 (Intel Architecture-64), etc.
RISC CISC
It has fixed format instruction. It has variable format instruction.
The program written for RISC architecture needs Program written for CISC architecture tends to
to take more space in memory. take less space in memory.
Can perform only Register to Register Arithmetic Can perform REG to REG or REG to MEM or MEM
operations to MEM
The execution time of RISC is very short. The execution time of CISC is longer.
It uses a limited number of instruction that It uses a large number of instruction that requires
requires less time to execute the instructions. more time to execute the instructions.
Few addressing modes are used Long variety of addressing modes
Uses only Hardwired control unit Uses both hardwired and micro programmed
control unit
Requires more number of registers Requires less number of registers
Data transfer schemes
Contents
Mode of Data Type of
Transmission Transmission
Parallel Simplex
Serial
• Synchronous Half Duplex
• Asynchronous
Full Duplex
MODE OF DATA TRANSMISSION 3
This diagram shows that 8 Wires are used simultaneously to transfer 8-bit digital data.
It is possible only for those device which are at less distance from each other.
ADVANTAGES OF PARALLEL TRANSMISSION:
All the data bits will be transmitted simultaneously, so time required for
transmission of N number of bits will be only one clock cycle.
Due to transmission in only one clock cycle, clock frequency can be kept low
without affecting speed of operation.
It is used in between the devices that are not match in speed. Invariably used in
To help receiver ‘start’ and ‘stop’ bits are used along with data in middle.
Ideal Time between bytes are not constant. They are also known as gaps.
19
DIAGRAMMATIC REPRESENTATION3
TRANSMISSION MODE 3
The term transmission mode defines the direction of the flow of
information between two communication devices.
HALF DUPLEX
In half duplex transmission data can be sent in both the directions, but one device can transmit at a time, when one device is
sending the other can only
receive and vice-versa.
FULL DUPLEX
In full duplex transmission, data can be sent in both the directions simultaneously means both the connected devices can transmit
and receive at the same time.
Memory Addressing and
Interfacing
• Memory
• Calculating the number of address lines
• Memory Address Map
Memory
• Memory is the integral part of the microcomputer
system.
• For example:
• If we have 4 registers on a chip, the number of address lines will be 2.
• If we have 8 registers on a chip, the number of address lines will be 3.
Dealing with more than one Chip
• For example:
• We have 4 registers on a chip; the chip will
have 2 address pins A1A0.
• In 8085 microprocessor 16 address lines are available. 16 address lines are capable of identifying
216 registers.
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 8000H
1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 = 80FFH
Interrupts
Contents
Introduction
Types of interrupts
Hardware Interrupts
Maskable & Non-Maskable Interrupts
Software Interrupts
Conclusion
Introduction1, 2
The meaning of ‘interrupts’ is to break the sequence of operation.
While the Microprocessor is executing a program, an ‘interrupt’ breaks the normal sequence of execution of
instructions, diverts its execution to some other program called Interrupt Service Routine (ISR). After
executing , control returns the back again to the main program.
Hardware
Interrupts
Maskable Non-Maskable
Interrupts Interrupts
Source: https://www.includehelp.com/embedded-system/pin-diagram-of-8086-microprocessor.aspx
Interrupts
Hardware
Interrupts
Source: https://www.includehelp.com/embedded-system/pin-diagram-of-8086-microprocessor.aspx
Interrupts
Hardware
Interrupts
Maskable Non-Maskable
Interrupts Interrupts
Source: https://www.includehelp.com/embedded-system/pin-diagram-of-8086-microprocessor.aspx
Maskable & Non-Maskable Interrupts 1, 2
Interrupts
Hardware
Interrupts
The programmer can choose
to mask specific interrupts
and re-enable them later.
Maskable Non-Maskable
Interrupts Interrupts
Maskable & Non-Maskable Interrupts 1, 2
Interrupts The programmer cannot
control when a Non-
Maskable Interrupts
is serviced
Hardware
Interrupts
Used to handle external hardware peripherals , such as key boards , mouse , hard disks , floppy
disks , DVD drivers, and printers.
While running a program, if software interrupt instruction is encountered then the processor initiates
an interrupt.
The software interrupt instruction is INT n, where n is the type number in the range 0 to 255.
Software Interrupt (INT n)
• The timer is an important application in Embedded systems. The timer has so many
applications such as measure time generating delays.
• TIMER/COUNTER is designed to count the time interval between events. It counts the
cycle of the peripheral clock or an externally supplied clock [1].
Timing Diagram
• Timing Diagram is a graphical representation of process in step with respect to time. It
helps to understand the process of microprocessor step by step with respect to time.
• Timing diagram gives the representation of various control signals generated during
execution of an instruction.
Important terms related to timing diagrams
Instruction Cycle
• Instruction cycle is defined as the time required to complete the execution of an
instruction.
Machine cycle
• Machine cycle is defined as the time required to complete one operation of
accessing memory, I/O, or acknowledge an external request.
T-state
• T-state is the time corresponding to one clock period. T-state
is defined as on subdivision of the operation performed in one
clock period. The term t-state and clock period are often used
synonymously.
Instruction Format
• For timing diagram, it is important to know “number of bytes in an
instruction”. Generally instruction can be:
• One byte instruction
• Two byte instruction
• Three byte instruction
T2 Clock Cycle:
• Multiplexed bus now changed to data bus.
• RD’ signal is made low by the processor.
• ALE is made LOW indicating that AD0-AD7 act as lower data
bus.
• RD’ signal makes the memory device load the data bus with
the contents of the location addressed by the processor.
Opcode Fetch machine cycle:
T3 Clock Cycle:
• The opcode available on the data bus is read by the
processor and moved to the Instruction Register.
• RD’ signal is deactivated by making it at logic 1.
T4 Clock Cycle:
• The processor decodes the instruction in the IR
register and generates the necessary control
signals to execute the instruction.
• Based on the decoded instruction, further
operations such as fetching/writing into memory
etc take places.