Microprocessor 1
Microprocessor 1
Multiple Word : The 64, 128, ... bit /digit binary numbers or codes are called
multiple words.
CPU Bus : The group of conducting lines that are directly connected to the
microprocessor is called CPU bus. In a CPU bus, the signals are
multiplexed, i.e., more than one signal is passed through the
same line but at different timings.
System Bus : The group of conducting lines that carries data, address and
control signals in a microcomputer system is called System bus.
Multiplexing is not allowed in a system bus
The high and low level states are normal logic levels for data,
address or control signals.
The high impedance state is an electrical open-circuit condition.
The high impedance state is provided to keep the device
electrically isolated from the system.
Microcomputer:
Microprocessor:
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.
Memory: Memory stores such binary information as instructions and data,
and provides that information to the microprocessor whenever necessary. 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. Read-Only memory (ROM) and Read/Write memory (R/WM),
popularly known as Random- Access memory (RAM).
I/O (Input/Output): It communicates with the outside world. I/O includes
two types of devices: input and output; these I/O devices are also known as
peripherals.
Evolution of Microprocessors
The first µP was introduced in 1971 by Intel Corporation. This was the Intel 4004,
a processor on a single chip. It had the capability of performing simple arithmetic
and logical operations.
The first 8 bit µP, which would perform arithmetic and logic operations on 8 bit
words, was introduced in 1973, by Intel. This was 8008 that was followed by an
improved version- the 8080 from the same company.
The µPs introduced between 1971and 1972 were the first generation systems
They were designed using the PMOS technology. This technology provided low
cost, slow speed and low output currents and was compatible with TTL
After 1973, the second generation µPs such as Motorola 6800 and 6809, Intel
8085 and Zilog Z80 evolved. These µPs were fabricated using NMOS technology
The distinction between the 1st & 2nd generation devices was primarily the use of
new a semiconductor technology to fabricate the chips
After 1978, the 3rd generation microprocessors were introduced. Typical µPs
were Intel 8086/ 80186/ 80286 and Motorola 68000/ 68010. These µPs were
designed using HMOS technology. HMOS provides the following advantages over
NMOS.
The third generation introduced in 1978 was typically separated by the Intel 8086
iAPX8086, iAPX80186, iAPX80286, Zilog 8000, and the Motorola 68000 which
are 16- bit µPs with minicomputer like performance.
.
In 1980, the fourth generation µPs were evolved. Intel introduced the first
commercial 32 bit microprocessor, Intel 432. Since 1985, more 32-bit µPs have
been introduced. These include Intel iAPX80386, Intel 80486, Motorola
MC68020/68030/68040, National semiconductor NS 32032.
These processors were fabricated using the low power version of HMOS
technology called HCMOS, and they include an on-chip RAM called the cache
memory to speed up program execution.
Microcomputer
Microprocessor is a central processing unit (CPU) with its related timing functions
on a single chip. A microprocessor combined with memory and input/output
devices forms a microcomputer. Therefore, the basic components of a
microcomputer are:
CPU
Program memory
Data memory
Output ports
Input ports
Clock generator
Data Program
Memory Memory
Input Ports
Central Processing Unit: The CPU consists of ALU (Arithmetic and Logic Unit),
register unit and control unit. The CPU fetches the stored instructions from the
program memory, data word from data memory or from an input device and after
processing the data stores the result in data memory or sends it to an output device.
Program Memory: The basic task of a microcomputer system is to ensure that its
CPU executes the desired instructions sequence i.e., the program properly. The
instructions sequence is stored in the program memory. On initialization- usually
on power up or manual reset the processor starts executing the instructions from a
predetermined location in program memory.
8085 Microprocessor
It is an 8 bit microprocessor.
It is manufactured with N-MOS technology.
It has 16-bit address bus and hence can address up to 2 16 = 65536 (64K)
memory locations through A0 –A15 .
The lower 8 lines of address bus and 8 lines of data bus are multiplexed AD 7 –
AD0 .
Data bus is a group of 8 lines D0 to D7
It supports external interrupt request.
A Program counter (PC) of 16-bit
A stack pointer (SP) of 16-bit
Six 8-bit general purpose register arranged in pairs: BC, DE, HL.
It requires a signal +5V power supply and operates at 3MHZ single phase
clock.
It is enclosed with 40 pins DIP (Dual in line package).
Architecture of INTEL 8085/8085A
register and decoder, register array, interrupt control and serial I/O control in
a package of 40 pins, requires +5V single power supply and can operate with
a 3MHz single phase clock.
Flags
The ALU includes five flip-flops, which are set or reset after an operation
according to data conditions of the result in the accumulator and other registers.
They are called Zero(Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry
(AC) flags; they are listed in the Table and their bit positions in the flag register are
shown in the Figure below. The most commonly used flags are Zero, Carry, and
Sign. The microprocessor uses these flags to test data conditions.
These flags have critical importance in the decision-making process of the
microprocessor. The conditions (set or reset) of the flags are tested through the
software instructions. For example, the instruction JC (Jump on Carry) is
implemented to change the sequence of a program when CY flag is set. The
thorough understanding of flag is essential in writing assembly language programs.
Control Unit
Generates signals within microprocessor to carry out the instruction, which has
been decoded. In reality causes certain connections between blocks of the uP to be
opened or closed, so that data goes where it is required, and so that ALU
operations occur.
Registers
The 8085/8080A-programming model includes six registers, one accumulator, and
one flag register, as shown in Figure. In addition, it has two 16-bit registers: the
stack pointer and the program counter. They are described briefly as follows.
Fig: Programming model of 8085 microprocessor
The 8085/8080A has six general-purpose registers(GPR) to store 8-bit data; these
are identified as B, C, D, E, H, and L as shown in the above figure. They can be
combined as register pairs - BC, DE, and HL
to perform some16-bit operations. The programmer can use these registers to
store or copy data into the registers by using data copy instructions
Instruction Register/Decoder
Temporary storage for the current instruction of a program. Latest instruction sent
here from memory prior to execution. Decoder then takes instruction and „decodes‟
or interprets the instruction. Decoded instruction then passed to next stage.
Control Generator
Generates signals within microprocessor to carry out the instruction which has
been decoded. In reality causes certain connections between blocks of the uP to be
opened or closed, so that data goes where it is required, and so that ALU
operations occur
Memory
Program, data and stack memories occupy the same memory space. The total
addressable memory size is 64 KB.
Program memory - program can be located anywhere in memory. Jump, branch
and call instructions use 16-bit addresses, i.e. they can be used to jump/branch
anywhere within 64 KB. All jump/branch instructions use absolute addressing.
Data memory - the processor always uses 16-bit addresses so that data can be
placed anywhere.
Stack memory is limited only by the size of memory. Stack grows downward.
• First 64 bytes in a zero memory page should be reserved for vectors used by RS
instructions
Interrupts
INTR is maskable 8085 compatible interrupt. When the interrupt occurs the
processor fetches from the bus one instruction, usually one of these instructions
One of the 8 RST instructions (RST0 - RST7). The processor saves current
program counter into stack and branches to memory location N * 8 (where N 3-bit
number from 0 to 7 supplied with the RST instruction).
RST5.5 is a maskable interrupt. When this interrupt is received the processor saves
the contents of the PC register into stack and branches to 002CH (hexadecimal)
address.
RST6.5 is a maskable interrupt. When this interrupt is received the processor saves
the contents of the PC register into stack and branches to 0034H (hexadecimal)
address.
RST7.5 is a maskable interrupt. When this interrupt is received the processor saves
the contents of the PC register into stack and branches to 003CH (hexadecimal)
address.
SID - Serial Input Data Line: The data on this line is loaded into accumulator bit 7
whenever a RIM instruction is executed.
SOD – Serial Output Data Line: The SIM instruction loads the value of bit 7 of the
accumulator into SOD latch if bit 6 (SOE) of the accumulator is 1.
RESET IN
When this signal goes low, the program counter (PC) is set to Zero µp is reset
and resets the interrupt enable and HLDA flip-flops
The data and address buses and the control lines are tri-stated during RESET
because of asynchronous nature of RESET, the processor internal registers
and flags may be altered by RESET with unpredictable results
Upon power-up, RESET IN must remain low for at least 10 ms after minimum
Vcc has been reached.
• For proper reset operation after the power – up duration, RESET IN should be
kept low a minimum of three clock periods.
RESET OUT:
This signal indicates that µp is being reset. This signal can be used to reset other
devices. The signal is synchronized to the processor clock and lasts an integral
number of clock periods
DMA Signals
HOLD:
Indicates that another master is requesting the use of the address and data buses.
The CPU, upon receiving the hold request, will relinquish the use of the bus as
soon as the completion of the current bus transfer.
• Internal processing can continue. The processor can regain the bus only after the
HOLD is removed.
• When the HOLD is acknowledged, the Address, Data RD, WR and IO/M lines
are tri-stated.
HLDA:
Hold Acknowledge: Indicates that the CPU has received the HOLD request and
that it will relinquish the bus in the next clock cycle.
• HLDA goes low after the Hold request is removed. The CPU takes the bus one
half-clock cycle after HLDA goes low.
READY:
This signal Synchronizes the fast CPU and the slow memory, peripherals.
• If READY is high during a read or write cycle, it indicates that the memory or
peripheral is ready to send or receive data.
• If READY is low, the CPU will wait an integral number of clock cycle for
READY to go high before completing the read or write cycle. • READY must
conform to specified setup and hold times.
SO, S1 (Output) Data Bus Status. Encoded status of the bus cycle:
Opcode fetch 0 1 1 𝑅𝐷 = 0
Memory Read 0 1 0 𝑅𝐷 = 0
Memory Write 0 0 1 𝑊𝑅 = 0
I/O Read 1 1 0 𝑅𝐷 = 0
I/O Write 1 0 1 𝑊𝑅 = 0
Interrupt Acknowledge 1 1 1 𝐼𝑁𝑇𝐴 = 0
HALT Z 0 0 𝑅𝐷, 𝑊𝑅 = 𝑍 𝑎𝑛𝑑 𝐼𝑁𝑇𝐴 = 1
HOLD Z X X 𝑅𝐷, 𝑊𝑅 = 𝑍 𝑎𝑛𝑑 𝐼𝑁𝑇𝐴 = 1
RESET Z X X 𝑅𝐷, 𝑊𝑅 = 𝑍 𝑎𝑛𝑑 𝐼𝑁𝑇𝐴 = 1
𝐑𝐞𝐚𝐝 𝐒𝐢𝐠𝐧𝐚𝐥( 𝑹𝑫) (𝑶𝒖𝒕𝒑𝒖𝒕); It is low active read control signal, this signal
indicates that the selected memory or I/0 or memory device is to be read and data
are available on data bus..
Write Signal (𝑾𝑹) 𝑶𝒖𝒕𝒑𝒖𝒕 : It is low active write control signal; This indicates
the data on the data bus to be written into the selected memory or I/0 location.
Address Bus:
The 8085 has 16 signal lines(pins) that are used as the address bus.
These lines are breaks into two segments : (A15 – A8) and : (AD7 – AD0)
The eight lines, (A15 – A8) are unidirectional and used for most significant
bits, called the high order address of 16 bit address.
The signal lines AD7 – AD0 are used for dual purpose.
Data Bus:
This is used for the exchange of data between processor, memory and
peripherals
It is bidirectional so that it allows data flow in both directions
The signal lines AD7 – AD0 are bidirectional: they serve a dual purpose.
These lines are used as low–order address bus as well as data bus. The low
order address bus can be separated from data signals using the latch.
8085 Interrupts:
A microprocessor has only two ways to determine the condition that exist in
internal & external circuitry.
– Hardware Interrupts
• Application of an appropriate logic status (HIGH/LOW) on a
hardware pin of processor causes an interrupt to processor.
Software Interrupts:
8085 has a special instruction “RST n” that can be used as software interrupt.
0 RST 0 0000H
1 RST 1 0008H
2 RST 2 0010H
3 RST 3 0018H
4 RST 4 0020H
5 RST 5 0028H
6 RST 6 0030H
7 RST 7 0038H
Hardware Interrupts:
8085 has several hardware pins through which, an interrupt request can be lodged.
Below are list of interrupt signals offered by 8085
Vector
RST n Instruction Vector Address
(n)
0 RS T 0 0000
HH
1 RS T 1 0008
HH
2 RS T 2 0010
HH
3 RS T 3 0018
H
H
4 RS T 4 0020
H
H
TRAP 0024
4.5 H
RST 4.5 H
5 RS T 5 0028
H
H
6 RS T 6 0030
H
7 RS T 7 0038
H
H
RST7.5
It is a maskable interrupt, having the second highest priority among all interrupts.
When this interrupt is executed, the processor saves the content of the PC register
into the stack and branches to 003CH address.
RST 6.5 It is a maskable interrupt, having the third highest priority among all
interrupts. When this interrupt is executed, the processor saves the content of the
PC register into the stack and branches to 0034H address.
RST 5.5
It is a maskable interrupt. When this interrupt is executed, the processor saves the
content of the PC register into the stack and branches to 002CH address.
INTRs It is a maskable interrupt, having the lowest priority among all interrupts.
It can be disabled by resetting the microprocessor.
When INTR signal goes high, the following events can occur −
The microprocessor checks the status of INTR signal during the execution of
each instruction.
When the INTR signal is high, then the microprocessor completes its current
instruction and sends active low interrupt acknowledge signal.
When instructions are received, then the microprocessor saves the address of
the next instruction on stack and executes the received instruction.
Interrupt Structure
VECTOR
MASK LOCATION
TRAP 0024
1
RST D Q I 7.5
2 7.5
003C
CLR
R 7.5 M 7.5
RST
3 6.5 0034
M 6.5
0030
RST
4 5.5 002C
M 5.5 0028
EI S Q
0020
DI
RESET R 0018
ANY INTERRUPT RECOGANISED INTERRUPT
ENABLE 0010
GET RST CODE
FROM EXTERNAL 0008
INTR HARDWARE
5
0000
SIM Instruction:
Opcode Operand Description
SIM None Set Interrupt Mask
Example: SIM
RIM Instruction:
Opcode Operand Description
RIM None Read Interrupt Mask
This is a multipurpose instruction used to read the status of pending
interrupts RST7.5, RST6.5, RST5.5 and read serial data input bit.
The instruction loads eight bits in the accumulator with the following
interpretations.
Example: RIM
Think over it:
What is T-state?
T-state is the time period of the internal clock signal of the processor. The time
taken by the processor to execute a machine cycle is expressed in T-state.
What is the need for timing diagram?
The timing diagram provides information regarding the status of various signals,
when a bus cycle is executed. The knowledge of timing diagram is essential for
system designer to select matched peripheral devices like memories, latches, ports,
etc., to form a microprocessor system