Microprocessor System Chapter 3
Microprocessor System Chapter 3
RESET OUT: Tt is the 3rd pin in the diagram. This pin generates a signal to
provide information about the resetting of the microprocessor. Once a
processor is reset then all the connected devices must also be reset.
• So, enabling this signal shows the resetting of the interconnected devices.
• INTA: it is the 11th pin of the 8085 pin configuration. A signal at this pin
acknowledges the generated interrupt.
• 7. Direct Memory Access (DMA):
• Memory and I/O devices are connected with each other by the
microprocessor. So, the intermediator I.e., CPU manages the data
transfer between the input-output device and memory.
• When data in a large amount is to be transferred between
I/O devices and memory the CPU gets disabled by tri-stating its
buses. And this transfer is manageable by external control circuits.
The DMA has 2 pins.
• HOLD- the signal is generated at pin number 39. This pin generates
a signal to notify the processor that more than one request is
present to access the data and address bus.
• When this signal gets enabled, the CPU frees the bus
after completion of the recent operation. Once the hold signal
gets disabled, the processor can access the bus again.
• HLDA- the signal is generated at pin number 38. This signal is enabled
at the time when the processor gets HOLD signal and it releases
HLDA I.e, hold acknowledge signal. In order to show that the multiple
requests are kept on hold and will be considered once the bus gets
free after the recent operation.
• After the disabling of hold request, HLDA signal becomes low.
• READY- This is the 35th numbered pin in the pin diagram that
maintains synchronization between the processor and peripherals,
memory. It is clear that a microprocessor has a much faster response
than peripherals and memory.
• So this pin is enabled when the processor as well as the peripherals
and memory both become ready to begin the next operation.
• In this case when the READY pin is disabled, then the microprocessor
is in the WAIT state.
• Microprocessor Operation
• Operations of ALU is arithmetic as well as logical which includes addition,
increment, subtraction, decrement, logical operations like AND, OR, Ex-OR,
complement, evaluation, left shift or right shift. Both the temporary
registers as well as accumulators are utilized for holding the information
throughout the operations then the outcome will be stored within the
accumulator. The different flags are arranged or rearrange based on the
outcome of the operation.
• Flag Registers Control and Timing Unit
• Decoder and Instruction Register Register Array
• Special Purpose Registers Program Counter
• Stack Pointer in 8085 Increment or Decrement Register
• Address-Buffer & Address-Data-Buffer Address Bus and Data Bus
• Timing & Control Unit
• Flag Registers
• The flag registers of microprocessor 8085 are classified into five types
namely sign, zero, auxiliary carry, parity and carry. The positions of
bit set aside for these types of flags. After the operation of an ALU,
when the result of the most significant bit (D7) is one, then the sign
flag will be arranged. When the operation of the ALU outcome is zero
then the zero flags will be set. When the outcome is not zero then the
zero flags will be reset.
• Control and Timing Unit
• The control and timing unit coordinates with all the actions of the
microprocessor by the clock and gives the control signals which are
required for communication among the microprocessor as well as
peripherals.
• Decoder and Instruction Register
• As an order is obtained from memory after that it is located in the
instruction register, and encoded & decoded into different device
cycles.
• Register Array
• The general purpose programmable registers are classified into
several types apart from the accumulator such as B, C, D, E, H, & L.
These are utilized as 8-bit registers otherwise coupled to stock up the
l6 bit of data. The permitted couples are BC, DE & HL, and the short
term W & Z registers are used in the processor & it cannot be utilized
with the developer.
• Special Purpose Registers
• These registers are classified into four types namely program counter,
stack pointer, increment or decrement register, address buffer or data
buffer.
• Program Counter
• This is the first type of special-purpose register and considers that the
instruction is being performed by the microprocessor. When the ALU
completed performing the instruction, then the microprocessor
searches for other instructions to be performed. Thus, there will be a
requirement of holding the next instruction address to be performed
in order to conserve time. Microprocessor increases the program
when an instruction is being performed, therefore that the program
counter-position to the next instruction memory address is going to
be performed
• Stack Pointer in 8085
• The SP or stack pointer is a 16-bit register and functions similar to a
stack, which is constantly increased or decreased with two
throughout the push and pop processes.
• Increment or Decrement Register
• The 8-bit register contents or else a memory position can be
increased or decreased with one. The 16-bit register is useful for
incrementing or decrementing program counters as well as stack
pointer register content with one. This operation can be performed
on any memory position or any kind of register.
• Address-Buffer & Address-Data-Buffer
• Address buffer stores the copied information from the memory for
the execution. The memory & I/O chips are associated with these
buses; then the CPU can replace the preferred data by I/O chips and
the memory.
• Address Bus and Data Bus
• The data bus is useful in carrying the related information that is to be
stock up. It is bi-directional, but the address bus indicates the
position as to where it must be stored & it is uni-directional, useful
for transmitting the information as well as address input/output
devices.
• Timing & Control Unit
• The timing & control unit can be used to supply the signal to the 8085
microprocessor for achieving the particular processes. The timing and
control units are used to control the internal as well as external
circuits. These are classified into four types namely control units like
RD’ ALE, READY, WR’, status units like S0, S1, and IO/M’, DM like
HLDA, and HOLD unit, RESET units like RST-IN and RST-OUT.
• Instruction Cycle of 8085 Microprocessor:
• During normal operation, the microprocessor sequentially fetches,
decodes and executes one instruction after another until a halt
instruction (HLT) is executed.
• The fetching, decoding and execution of a single instruction
constitutes an instruction cycle, which consists of one to five read or
write operations between processor and memory or input/output
devices.
• Each memory or I/O operation requires a particular time period,
called machine cycle. In other words, to move byte of data in or out
of the microprocessor, a machine cycle is required.
• Each machine cycle consists of 3 to 6 clock periods/cycles, referred to
as T-states.
• Therefore we can say that, one Instruction Cycle of 8085 consists of
one to five machine cycles and one machine cycle consists of three to
six T-states i.e. three to six clock periods.
• There are seven different types of machine cycles in the 8085A. Three
status signals IO/M, S1 and S0 identify each type as shown in Table.
These signals are generated at the beginning of each machine cycle
and remained valid for the duration, of the cycle.
• Clock Signal:
• The 8085 divides the clock frequency provided at X1 and X2 inputs by
2, which is called operating frequency.
• All the operations within the Instruction Cycle of 8085 are
synchronized with this operating frequency.
• Therefore in the timing diagram operating frequency clock is shown
on the top and then the signals are shown with reference to
operating frequency clock.
• Ideally, the clock signal should be square wave with zero rise time and
fall time.
• But in practice, we don’t get zero rise time and fall time.
• Therefore the clock and other signals are always shown with
finite rise and fall times.
• Single Signal
• Single signal is represented by a line. It may have status either logic 0
or logic 1 or tri-state.
• The change in the state of the signal takes finite time and hence the
state change of signal is represented with finite rise time and fall
time, as shown in the figure.
• Group of Signals:
• Group of signals is also called a bus e.g. address bus and data bus.
• To avoid complications in the timing diagram these signal are grouped
and shown in the form of block as shown in figure.
• In the group representation individual state is not considered, but the
group state is considered.
• Change in state of single signal changes the state of group.
• It is represented by the cross as shown the figure.
• The tri-state condition of the group signals is shown by dotted lines.
• Two straight lines represent valid state/stable state.
• In microprocessor systems, activation of signal/signals depends on
the state of other signal/signals.
• Such situations are shown in the timing diagrams with the help of
specific symbols. There are four possibilities :
A8-A15
Higher Address (20 H) Unspecified Higher Address (20 H)
AD0 – AD7
Low (00 H) Data (3EH) Low (01 H) Data (32 H)
ALE
Read
• Timing Diagram of INR M instruction
• C500H address INR M instruction is written
• But at that time memory is pointing to another location D050H
• D050 H contains the data E1H .
• When INR instruction is executed the content of Memory location
need to be increased to E2H. But it can’t be done at Memory Location
itself.
• Steps
1. INR M ( Opcode = 34 H), Read Opcode instruction
2. Read Data of Memory Content (E1 H) = Memory Read
3. Write the incremented value at Memory Location = Memory Write
• Timing diagram
T1 T2 T3 T4 T1 T2 T3 T1 T2 T3
CLK
A8-A15 D0 H
C5 H DOH
AD0- AD7 00 H E2 H
34 H 50H E1 H 50 H
ALE
RD
WR
• Memory Device, Storage, and Classification
• Memory storage is just like a human brain. It is used to store data and
instruction. Computer memory is the storage space in the computer
where data is to be processed and instructions required for
processing are stored.
• In a broad sense, memory can be classified as –
• Main Memory– (Primary memory)
• Main memory has the disadvantage of high-cost and low-capacity storage.
But its advantage or facility is the high speed of data transfer.
• The control unit can be able to directly communicate with the main
memory.
• Main memory can be generally classified into random-access
memory (RAM) and read-only memory (ROM). It is a volatile memory. Due
to the absence of power, the content of this memory will be lost.
1 0 1 Output 1
Input
cell
Write
Write Operation
Read
1 0 1 Output 0
Input
0
cell
Write
• Magnetic SAM Read / Write Head
Read Operation
0 1 0 1 0
0 0 1 0 0 1
Peripherals Memory
DRQ
HLQ HDLA
CPU
• Cache Memory
• It is also called cache, supplementary memory system that
temporarily stores frequently used instruction and data for quicker
processing by the central processing unit (CPU) of a computer.
• It is an extension of a computer’s main memory.
• It is not high cost as registers and not cheaper like main memory.
Therefore we use this memory to reduce bottleneck.
• Cache holds a copy only the most frequently used information or
program codes stored in the main memory.
• The smaller capacity of the cache reduces the time required to locate
data within it and provide it to the CPU for processing.
• When a computer’s CPU accesses its internal memory, it first checks
to see of the information it needs is stored in the cache.
• If it is in the Cache, it returns the data to the CPU.
• If the information is no in the cache, the CPU retrieves it from the
main memory.
Main
Memory CPU
Cache registers
memory
• Advantages of Cache Memory
• Cache memory is faster than the main memory.
• It consumes less access time as compared to the main memory.
• It stores the program that can be executed within a short period of
time.
• It stores data for temporary use.
Page 1
Page 2 Frame 1
Frame 2
Page 3
MAP Frame 3
Page 4
Frame 4
Page 5
Page 6
Page 7
Disk
• Auxiliary Memory (secondary Memory)
• Secondary memory is also known as auxiliary memory.
• It is used to store data and programs permanently.
• In this memory data and programs are retained with the power is
turned off.
• It is a non-volatile memory.
• Characteristics of Auxiliary Memory are following −
• Non-volatile memory − Data is not lost when power is cut off.
• Reusable − The data stays in the secondary storage on a permanent
basis until it is not overwritten or deleted by the user.
• Reliable − Data in secondary storage is safe because of the high
physical stability of secondary storage devices.
• Convenience − With the help of computer software, authorized
people can locate and access the data quickly.
• Capacity − Secondary storage can store large volumes of data in sets
of multiple disks.
• Cost − It is much lesser expensive to store data on a tape or disk than
primary memory.
• Address Decoding
• Interfacing 8085 means the way to properly connect the
microprocessor with the outside unit i.e. I/O unit and the inside unit
i.e. Memory unit. So, there are two types of interfacing: I/O
interfacing and Memory interfacing.
• I/O interfacing means how to connect MP to the peripheral devices .
• Memory interfacing means how to connect MP to the memory
devices e.g. RAM, ROM, EPROM etc.
• For the interfacing, the address pins must be decoded using the
technique called "Address Decoding".
• Address Decoding technique uses following decoders to decode:
• i) Logic Gate Decoder (Simple NAND Gate decoder)
• ii) Line Decoder
- The 1-to-2 line decoder
- The dual 2-to-4 line decoder
- The 3-to-8 line decoder
• 8085 microprocessor has 16-bit address i.e. it uses 16 pins for address
bus.
• When we have to interface with 4 KB RAM. This RAM has 12-bit
address bus ( 2^n *m) = (2^12 = 4*1024 bytes).
• Where n= number of address lines and m = no of data line
• Lower 12-bits (A0-A11) of MP gets directly connected to address pins
of RAM.
• But, other upper 4-bits (A12-A15) address of MP pins are needed to
be decoded by using above decoders.
• RD’ is used by the memory to output/read data on data lines and
WR’ is used to write/ input into specific memory location.
• The memory is enabled by CS’ (Chip select) and operated at CLK
speed at which the memory read and write data.
• Decoder and Address Range
No. of Memory Size Address Range
S2 S1 S0 D0-D7 add
D0 0 0 0 D0 line
S0 D1 4 2^4 =16 0H to FH
0 0 1 D1
D2
0 1 0 D2 8 2^8 = 256 00H to FFH
S13 * 8 Decoder D3
D4 0 1 1 D3 10 2^10 = 1K 000H to 3FFH
D5 11 2^11 = 2K 000H to 8FFH
S2 1 0 0 D4
D6
D7 1 0 1 D5 12 2^12 = 4K 0000H to FFFH
1 1 0 D6 13 2^13 = 8K 0000H to 1FFFH
1 1 1 D7 14 2^14 = 16K 0000H to 3FFFH
15 2^15 = 32K 0000H to 7FFFH
16 2^16 = 64K 0000H to FFFFH
• 8085 has 16 address line and its memory addressing capacity is
• 2^16 = 64 KB addresses
• More than 1 memory chip are connected to processor
• Sum of all memory sizes ≤ processor's memory addressing capacity
• Maximum size of memory connected to 8085 is 64KB, which can be in
any combination of different memory sizes. (1KB, 2KB, 4KB,8KB, 16KB)
• Memory Interfacing
• Control signals of the memory (RD’ and WR’) are connected to
MEMR’ and MEMW’ generated from the processor’s control signals.
• Data lines of the memory are directly connected to the Processor’s
data lines.
• As number of address lines differ in the memory and the
microprocessor (memory has less no of address lines)
• We should connect the required address lines (starting from lower order)
from processor to memory.
• Remaining address lines of the processor are decoded to connect to chip
select (CS’) of memory to generate unique address range for the decoder.
• Example : 2K * 8 Memory
• 11 address lines (2^ = 2048 ie 2K) and 8 data lines
• A0 –A10 and D0-D711 A B Z
A11 – A15 A 0 0 1
Z
B 0 1 1
1 0 1
8085
CS’ 1 1 0
A0- A15 Data Lines
Memory
A0 – A10 (2K*8)
A15 O0’
CE’ O1’
3*8 Decoder
O2’
A14 0 S0 O3’
A13 1 S1 O4’
A12 0 O5’
S2 O6’
O7’
8085
CS’
A0- A15 Data Lines
Memory
A0 – A11 (8K*8)
• Address Range
Chip select Address Lines
GND O0’
CE’ O1’
3*8 Decoder
O2’
A15 1 S0 O3’
A14 0 S1 O4’
A13 0 O5’
S2 O6’
O7’
8085
CS’
A0- A15 Data Lines
Memory
A0 – A12 (8K*8)
• Ashish Dhakal Madhav
• Sanjeev Adhikari Prasant
• Sundar Chettri Himal
• Prabesh Susmita
• Ayush Shiv
• Shraddha Sima
• Soni
• Address Range