Microprocessor Based System Design - 1 - Lec
Microprocessor Based System Design - 1 - Lec
System Design
Ravi S Gupta
Organization
• Goals of the Course
• Historical Perspective - Microprocessors
• The Technology Aspect: Moore’s Law
• Inside a Microprocessor
• Processor system architecture
• Computer Classification
• Advantages of Microprocessor based system design
• Disadvantages of Microprocessor based system design
• Microcontroller
• Digital Signal Processor
• Functional and Architecture description of 8085
• Pin description of 8085
• Memory Interfacing
• Addressing Modes in 8085
• Instruction Set of 8085
• Interrupts of 8085
• Timing Diagram of 8085
Goals and Objectives
In this course, you will:
ALU
Input CU Output
Memory
ROM/RAM Memory
Micro
I/O Ports
Processor
Peripheral Timer
Digital Signal Processors
• A Digital Signal Processor is a special-purpose
CPU (Central Processing Unit) that provides ultra-
fast instruction sequences, such as shift and add,
and multiply and add, which are commonly used in
math-intensive signal processing applications.
• A digital signal processor (DSP) is a specialized
microprocessor designed specifically for digital
signal processing, generally in real time.
• Digital
– operating by the use of discrete signals to
represent data in the form of numbers.
• Signal
– a variable parameter by which information is
conveyed through an electronic circuit.
• Processing
– to perform operations on data according to
programmed instructions.
• Characteristics of Digital Signal
Processors:
– Separate program and data memories.
– Only parallel processing, no multitasking.
– The ability to act as a direct memory access
device if in a host environment.
– Takes digital data from ADC (Analog-Digital
Converter) and passes out data which is finally
output by converting into analog by DAC
(Digital-Analog Converter).
– analog input-->ADC-->DSP-->DAC--> analog
output.
8085 Model
•A model is a conceptual
representation of a real object.
• The Microprocessor can be
represented in terms of its:
– Hardware Model, and
– Programming Model.
8085 Hardware Model
16-bit Address
Bus
Accumulator
Register Array
Flags Memory
Pointer Reg
Instruction Control
Decoder Signals
SIGN FLAG:
After the execution of arithmetic or logical operation, if the resultant
operation is minus then the flag is set, if the resultant operation is
plus then the flag is reset.
ZERO FLAG:
The zero flag is set if the ALU operation results in zero and reset if the
resultant operation is not zero.
CARRY FLAG:
If the carry is generated from MSB (most significant bit) in a arithmetic
operation then carry flag is set otherwise reset.
PARITY FLAG:
After the arithmetic and logical operation if the result as even number
of 1‟s then the flag is set, if odd number of 1‟s then the flag is reset.
AUXILLARY FLAG:
If an arithmetic operation produces carry out from the lower order 4-
bits then the flag is set, otherwise the flag is reset.
Problem on Carry flag:
Hexadecimal Addition: AA+7C
Hexadecimal Addition: 3A+7C
Problem on Zero flag:
Hexadecimal Addition: 84+7C
Hexadecimal Addition: 3A+7C
Problem on Parity flag:
Hexadecimal Addition: 3A+78
Hexadecimal Addition: 3A+7C
Problem on Auxillary-Carry flag:
Hexadecimal Addition: 3A+7C
TIMING AND CONTROL UNIT
• This unit synchronizes all the
microprocessor operations with the
clock and generates the control
signals necessary for communication
between the microprocessor and
peripherals.
INSTRUCTION REGISTER AND
DECODER
• The instruction register and the
decoder are part of the ALU.
• When an instruction register is
fetched from memory, it is loaded in
the instruction register.
• The decoder decodes the instruction
and establishes the sequence of
events to follow.
8085 Architecture
The internal logic design of a µP known
as its architecture reveals what
exactly is happening and how different
operations are executed inside the
micro processing unit (MPU).
Salient features
The salient features of 8085 µp are:
– It is a 8 bit microprocessor.
– It is manufactured with N-MOS technology.
– It has 16-bit address bus and hence can address up to 216 =
65536 bytes (64KB) memory locations through A0-A15.
– The first 8 lines of address bus and 8 lines of data bus are
multiplexed AD0 – AD7.
– Data bus is a group of 8 lines D0 – D7.
– It supports external interrupt request.
– A 16 bit program counter (PC).
– A 16 bit stack pointer (SP).
– Six 8-bit general purpose register arranged in pairs: BC, DE, HL.
– It requires a signal +5V power supply and operates at 3.2 MHZ
single phase clock.
– It is enclosed with 40 pins DIP (Dual in line package).
Busses BATA CAT IIS
Accumulator
Temp Register Instruction Register & Decoder
ALU & Flags Interrupt Control
Serial Control
CPU Registers
Addr,Data Buffer
Timing Unit
Address Buffer and Address/Data Buffer:
• These buffers are used to increase the driving
capacity of address/data busses.
• In the simplest form these form emitter follower
with large current amplification.
Timing and Control Unit:
• It includes an on chip oscillator and a control
sequencer.
• The control sequencer is micro programmed; it
has a ROM that stores all the micro routines
needed for executing the instructions.
Pin Descriptions of 8085
The signals of 8085 can be classified into
seven groups according to their functions.
These are:
• (1) Power supply and frequency signals
• (2) Data and Address buses
• (3) Control bus
• (4) Interrupt signals
• (5) Serial I/O signals
• (6) DMA signals
• (7) Reset signals.
Pin Descriptions of 8085
address
(8 bits)
Pin Descriptions of 8085
address
and data
(8 bits)
dual - use
pins !!
• Pins 1 and 2 (X1, X2 (Input))
Crystal or R-C / L-C network
connections to set the internal clock
generator
X1 can also be an external clock input
instead of a crystal.
The input frequency is divided by 2 to
give the internal operating frequency.
• Pin 3 (RESET OUT (Output))
Indicates CPU is being reset.
Can be used as a system RESET. The signal
is synchronized to the processor clock.
Q) What is the state of registers when they
are reset?
• Pin 4 and 5 (SOD and SID)
It consists of a set of SIPO and PISO flip-flops.
SID (Input)
Serial input data line: RIM instruction
affects this pin.
SOD (output)
Serial output data line. SIM instruction
affects this pin.
• Pins 6 to 11 (Interrupts)
These pins form the interrupt control section. There are 5
hardware interrupt request TRAP, RST 7.5, RST 6.5, RST 5.5
and INTR and 1 acknowledgement INTA. These interrupts are
serviced on the order of priority. TRAP has got the highest
priority while INTR has least.
• Pins 12 to 19 (AD0-AD7)
These pins form the lower order address bus multiplexed with
the data bus to form Address/Data bus AD0-AD7.
This bus is bidirectional one.
• Pins 21 to 28 (A8-A15)
These pins form the higher order address bus.
This bus is unidirectional one.
• Pins 29 and 33 (S0 & S1)
Data Bus Status. Encoded status of the bus cycle:
• Pins 31, 32 and 34 (WR,RD, IO/M)
These pins are to write (store), read (load) either from memory or
from I/O device. RD & WR both together cannot be activated.
As an example, if IO/M = 0, RD=0 & WR = 1 means it is memory
read operation.
• Pin 30 (ALE (Output))
Address Latch Enable: This is an important pin which supports
multiplexing of A0-A7 with D0-D7.
• Pin 35 (READY)
This is another important pin on 8085. It permits the use of cheaper
(slow) peripherals. At first the uP asks the device to get ready. If the
device is ready, then data transfer takes place and if not, the device
sends back a low on READY pin.
If READY = 0 the processor generates WAIT states till it gets ready,
thus enabling the use of slower devices (speed matching).
• Pins 36 and 37 (RESETIN and CLKOUT)
A low signal on pin 36 resets the PC, IR etc and sends a reset signal
(RESET OUT) to peripherals through Pin 3.
Pin 37 is the system clock. The signal generated by the on-chip
oscillator after passing through divide by 2 flip-flop. Is connected to
pin 37 which can be used to synchronize all the peripherals with the
uP.
Generation of Control Signals
DMA
• Pins 20 and 40
Vss Ground Reference.
Vcc +5 volt supply.
Demultiplexing the bus: AD0-AD7
16
Demultiplexing
the address /
data bus
8
• The arrangement uses a Latch 74LS373 and ALE
signal from 8085 for the purpose. The bus AD0-
AD7 is connected to the input of latch. The ALE
signal is connected to the enable (G) pin of Latch
and the o/p control (OC) is connected to Gnd.
• During T1 of every M/C cycle ALE goes high and
remains low for the remaining portion of that M/C
cycle. Thus during T1 of each and every M/C cycle,
the latch follows its i/p (A0 – A7). However, for the
next of the period the latch will be disabled as ALE
(G) remains low. In other words till the next ALE (in
next M/C cycle) the previous low order address
remains on latch. The data bus now carries the
data D0-D7.
Memory: basic concepts
• Stores large number of bits m × n memory
…
– m x n: m words of n bits each
m words
– k = Log2(m) address input signals …
– or m = 2^k words
– e.g., 4,096 x 8 memory: n bits per word
• 32,768 bits
• 12 address input signals memory external view
r/w
2k × n read and write
• 8 input/output data signals enable memory
• Memory access A0
…
– r/w: selects read or write Ak-1
– enable: read or write only when …
asserted
Qn-1 Q0
ROM: “Read-Only” Memory
• Nonvolatile memory
• Can be read from but not written to, by a
processor in an embedded system
External view
• Traditionally written to, “programmed”,
2k × n ROM
before inserting to embedded system enable
A0
• Uses
…
Ak-1
– Store software program for general- …
Truth table
Inputs (address) Outputs
a b c y z
8×2 ROM
0 0 word 0
0 0 0 0 0
0 0 1 0 1 0 1 word 1
0 1 0 0 1 0 1
0 1 1 1 0 enable 1 0
1 0 0 1 0 1 0
1 0 1 1 1 c 1 1
1 1 0 1 1 b 1 1
1 1 1 1 1 1 1 word 7
a
y z
RAM: “Random-access”
memory external view
• Typically volatile memory r/w 2k × n read and write
– bits are not held without power supply enable memory
words …
EPRO M 0 0 xx xx 0 0 0 0 0 0 0 0 0 0 0 0 0000
4 KB 0 0 . . 0 0 0 0 0 0 0 0 0 0 0 1 0001
. . .x .x . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
0 0 1 1 1 1 1 1 1 1 1 1 1 1 0FFF
RAM-I 0 1 xx 0 0 0 0 0 0 0 0 0 0 0 0 0 4000
8 KB 0 1 . 0 0 0 0 0 0 0 0 0 0 0 0 1 4001
. . .x . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5FFF
RAM-II 1 0 xx 0 0 0 0 0 0 0 0 0 0 0 0 0 8000
8 KB 1 0 . 0 0 0 0 0 0 0 0 0 0 0 0 1 8001
. . .x . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 9FFF
Instruction Formats of 8085
• An instruction is a command given to the
uP to perform a specific task or function on
a given data.
• An instruction comprises of an operation
code (called ‘opcode’) which specifies the
nature of the task to be performed by an
instruction and the address of the data
(called ‘operand’), on which the o pcode
operates. The operand may be 8-bit
data,16-bit data, a register/pair, a memory
location, 8-bit/16-bit address. Symbolically,
an instruction looks like
Based on length 8085 instruction set
can be classified into 3 types:
• In 1-byte instruction, the opcode and
the operand are in the same byte i.e.,
• Example: ADD B
• A 2-byte instruction looks like this:
ORING
XORING
CMA A = A’ None
CMC CY = CY’ CY
STC CY = 1 CY
RAL CY, A = A, CY CY
RAR A, CY = CY, A CY
RLC
RRC
RAL
RAR
Branch Group:
The branching instructions alter normal sequential program flow,
either unconditionally or conditionally. The unconditional branching
instructions are as follows:
• JMP : Jump
• CALL : Call
• RET : Return
Conditional branching instructions examine the status of one of four
condition flags to determine whether the specified branch is to be
executed. The conditions that may be specified are as follows:
• NZ : Not Zero (Z = 0)
• Z : Zero (Z = 1)
• NC : No Carry (C = 0)
• C : Carry (C = 1)
• PO : Parity Odd (P= 0)
• PE : Parity Even (P= 1)
• P : Plus (S = 0)
• M : Minus (S = 1)
The conditional branching instructions
are specified as follows:
• Classification of Interrupts
– Interrupts can be classified into two types:
• Maskable Interrupts (Can be delayed or Rejected)
• Non-Maskable Interrupts (Can not be delayed or
Rejected)
IO/M S1 S0 MC
0 1 1 Opcode Fetch
0 1 0 Memory Read
0 0 1 Memory Write
1 1 0 IO read
1 0 1 IO write
1 1 1 INT ACK
0 1 0 BI
0 0 0 HLT
Lower byte address on the multiplexed bus
The status signals are IO/ M, S0 and S1. Their conditions indicate the type
of machine cycle that the system is currently passing through. These three
status signals remain active right from the beginning till the end of each
machine cycle.
RD and WR signals during the Read cycle and Write cycle