EE3404 MPMC 02 - by WWW - Learnengineering.in
EE3404 MPMC 02 - by WWW - Learnengineering.in
in
.in
2. Mention the use of ALE. (Dec-2015, Dec-2013, May-2010)
The ALE signal is used to demultiplex (separate) AD0 – AD7 lines to A0 – A7
ng
(address lines) and D0 – D7 (data lines). The separation of address lines and
data lines is achieved by connecting a external latch to AD 0 – AD7 lines and
eri
enabling the latch when signal is active.
3. State the functions of keyboard interrupts. (Dec-2014)
e
Keyboard interrupt is special case of signal usually generated by the keyboard in
gin
the text user interface. This signal is used to generate a hardware interrupt when
a key is pressed or released.
En
S (Sign flag), Z (Zero flag), AC (Auxiliary carry flag), P (Parity flag), CY (Carry
flag).
5. What is meant by level-triggered interrupt? Which of the interrupts in 8085
Le
at a high or low level. A device wishing to signal a level triggered interrupt drives
the interrupt request line to its active level (high or low), and then holds it at that
ww
www.LearnEngineering.in
www.LearnEngineering.in
.in
triggered. This means that the TRAP must go high and remain high until it is
acknowledged. This avoids false triggering caused by noise and transients.
ng
8. List the control and status signals of 8085 and mention its
need. (Dec-2012)
eri
ALE (Address Latch Enable)
and (Read and Write)
IO/ , S0 S1 e
gin
READY
9. Define the function of parity flag and zero flag in 8085. (May-2012)
En
Parity flag – Parity is defined by the number of one‟s present in the accumulator.
After an arithmetic or logical operation if the result has an even number of ones,
arn
ie., even parity, the flag is set. If the parity is odd, flag is reset.
Zero flag – the zero flag sets if the result of operation in ALU is zero and flag
resets if result is non zero. The zero flag is also is also set if a certain register
Le
10. To obtain a 320 ns clock, what should be the input clock frequency? What
is the frequency of clock signal at CLK OUT? (May-2014)
ww
2 www.LearnEngineering.in
www.LearnEngineering.in
.in
of memory word = 8-bits Memory capacity = 64 Kbytes
13. What is interrupt? (May-2006, May-2009)
ng
Interrupt is an external signal that causes a microprocessor to jump to a specific
subroutine.
eri
14. How performance of a microprocessor is measured in terms of MIPS?
(June-2007)
e
The performance of a microprocessor is measured in terms of MIPS (Million
gin
instructions per Second).
MIPS rate = 1/(Average time required for the execution of instruction * 106)
En
15. What are the different machine cycles in 8085 microprocessor? (May-2008)
arn
Opcode fetch, Memory read, Memory write, I/O read, I/O write, Interrupt
acknowledge, Bus idle.
Le
PART B
Address Bus:
ww
The address bus is a group of 16 lines generally identified as A0 to A15. The address
bus is unidirectional and bits flow in one direction-from the MPU to peripheral
devices.The MPU uses the address bus to identify a peripheral or a memory (2 16 =
65,536) locations
Data Bus:
www.LearnEngineering.in
www.LearnEngineering.in
The data bus is a group of 8 lines used for data flow. These lines are bi-directional and
data flow in both directions between the MPU and memory and peripheral devices. The
MPU uses the data bus to transfer data.
Control Bus:
The control bus carries synchronization signals and providing timing signals.The MPU
generates specific control signals for every operation it performs.These signals are used
to identify a device type with which the MPU wants to communicate.
.in
Registers of 8085:
The 8085 have six general-purpose registers to store 8-bit data during program execution.
ng
These registers are identified as B, C, D, E, H, and L.They can be combined as
registerpairs-BC, DE, and HL-to perform some 16-bit operations.
eri
Accumulator (A):
e
The accumulator is an 8-bit register that is part of the arithmetic/logic unit (ALU).This
gin
register is used to store 8-bit data and to perform arithmetic and logical operations.The
result of an operation is stored in the accumulator.
En
Flags:
The microprocessor uses the 5 flags for testing the data conditions.They are Zero (Z),
arn
Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags.The flagsare set or reset
according to the result of an operation.The bit position for the flags in flag register is,
Le
w.
ww
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
arn
2. Zero Flag (Z): If the result of arithmetic and logical operation is zero, then zero flag is
ww
3. Auxiliary Carry Flag (AC): If D3 generates any carry when doing any arithmetic and
logical operation, this flag is set. Otherwise it is reset.
www.LearnEngineering.in
www.LearnEngineering.in
4. Parity Flag (P): If the result of arithmetic and logical operation contains even number
of 1's then this flag will be set and if it is odd number of 1's it will be reset.
5. Carry Flag (CY):If any arithmetic and logical operation result any carry then carry
flag is set otherwise it is reset.
.in
It is used to perform the arithmetic operations like addition,subtraction, multiplication,
division, increment and decrement and logical operations like AND,OR and EX-OR.
ng
It receives the data from accumulator and registers.According to the result the flag
register was set or reset.
eri
Program Counter (PC):
e
This 16-bit register sequencing the execution of instructions. The function of the
gin
program counter is to point to the memory address of the next instruction to be
executed.When an opcode is being fetched, the program counter is incremented by one
En
Temporary Register:
It is used to hold the data during the arithmetic and logical operations.
ww
Instruction Register:
When an instruction is fetched from the memory, it is loaded in the instruction register.
Instruction Decoder:
www.LearnEngineering.in
www.LearnEngineering.in
It gets the instruction from the instruction register and decodes the instruction. It
identifies the instruction to be performed.
.in
It has three control signals ALE, RD (Active low) and WR (Active low) and three status
signals IO/M(Active low), S0 and S1.
ng
ALE is used for provide control signal to synchronize the components of
eri
microprocessor and timing for instruction to perform the operation.
e
RD (Active low) and WR (Active low) are used to indicate whether the operation is
gin
eading the data from memory or writing the data into memory respectively.
En
IO/M(Active low) is used to indicate whether the operation is belongs to the memory
or peripherals.
arn
2.Draw the signal (pin diagram) configuration of 8085 and explain the purpose of
each signals. (Dec-2012)
Le
8085 is a 40 pin IC, DIP package. The signals from the pins can be grouped as
follows
w.
Address bus
Data bus
Control and status signals
Interrupts and externally initiated signals
Serial I/O ports
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
arn
Le
w.
www.LearnEngineering.in
www.LearnEngineering.in
two. Since the basic operating timing frequency is 3 MHz, a 6 MHz crystal is
connected externally.
CLK (OUT):Clock Output is used as the system clock for peripheral and
devices interfaced with the microprocessor.
.in
address;
ng
Multiplexed Address / Data Bus:AD0 - AD7 (Input/Output)
These multiplexed set of lines used to carry the lower order 8 bit address as well as
eri
data bus.
e
During the opcode fetch operation, in the first clock cycle, the lines deliver the
gin
lower order address A0 - A7.
In the subsequent IO / memory, read / write clock cycle the lines are used as
En
data bus.
The CPU may read or write out data through these lines.
arn
This signal helps to capture the lower order address presented on the
multiplexed address / data bus.
ww
This indicates that the selected memory location or I/O device is to be read and
the data bus is ready for accepting data from the memory or I/O device.
www.LearnEngineering.in
www.LearnEngineering.in
This indicates that the data on the data bus is to be written into the selected
memory location or I/O device.
This status signal indicates that the read / write operation relates to whether the
.in
memory or I/O device.
It goes high to indicate an I/O operation.
ng
It goes low for memory operations.
eri
Status Signals:S1,S0
e
It is used to know the type of current operation of the microprocessor.
gin
S1 S0 Operation Specified
0 0 Halt
En
1 1 Instruction Fetch
Le
They are the signals initiated by an external device to request the microprocessor
w.
1. TRAP
2. RST 7.5
3. RST 6.5
4. RST 5.5
5. INTR
10
www.LearnEngineering.in
www.LearnEngineering.in
RESTART INTERRUPTS: These three inputs have the same timing as INTR. They
are RST 7.5,RST 6.5, RST 5.5
.in
TRAP Highest
RST 7.5
ng
RST 6.5
RST 5.5
eri
INTR Lowest
e
On receipt of an interrupt, the microprocessor acknowledges the interrupt by the
gin
active low INTA (Interrupt Acknowledge) signal.
11
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
Serial input data line The data on this line is loaded into accumulator bit 7
ww
12
www.LearnEngineering.in
www.LearnEngineering.in
HOLD :HOLD signal is generated by the DMA controller circuit. The I/O device
request the processor for the address/data bus for bulk data transfer.
HLDA:(HOLD ACKNOWLEDGE) On receipt of HOLD signal, the microprocessor
acknowledges the request by sending out HLDA signal and leaves out the control
of the buses. After the HLDA signal the DMA controller starts the direct transfer
.in
of data.
ng
READY (input)
eri
microprocessors.
Before completing the present job such a slow peripheral may not be able to
e
handle further data or control signal from CPU.
gin
The processor sets the READY signal after completing the present job to access
the data.
En
The microprocessor enters into WAIT state while the READY pin is disabled.
particular task or work. Mainly in the microprocessor based system the interrupts are
used for data transfer between the peripheral and the microprocessor. When a
w.
interrupt then the processor suspends its current activity and executes an interrupt
service subroutine to complete the data transfer between the peripheral and processor.
After executing the interrupt service routine the processor resumes its current activity.
This type of data transfer scheme is called interrupt driven data transfer scheme.
13
www.LearnEngineering.in
www.LearnEngineering.in
Types of Interrupts :
The interrupts are classified into software interrupts and hardware interrupts.
SOFTWARE INTERRUPTS:
The software interrupts are program instructions. These instructions are inserted at
desired locations in a program. While running a program, lf a software interrupt
instruction is encountered, then the processor executes an interrupt service routine
.in
(ISR).
The software interrupts of 8085 are RST 0, RST 1, RST 2, RST 3, RST 4, RST 5,
ng
RST6 and RST7.
All software interrupts of 8085 are vectored interrupts. The software interrupts cannot be
eri
masked and they cannot be disabled. When the processor encounters the software
instruction, it pushes the content of PC to stack. Then loads the Vector address in PC
e
and starts executing the ISR stored in this vector address. At the end of ISR, a return
gin
instruction – RET will be placed. When the RET instruction is executed, the processor
POP the content of stack to PC.
En
RST 0 0000H
arn
RST 1 0008H
Le
RST 2 0010H
RST 3 0018H
w.
RST 4 0020H
ww
RST 5 0028H
RST 6 0030H
RST 7 0038H
14
www.LearnEngineering.in
www.LearnEngineering.in
HARDWARE INTERRUPTS:
The hardware interrupts are initiated by an external device by placing an appropriate
signal at the interrupt pin of the processor.The processor keeps on checking the
interrupt pins at the second T-state of last machine cycle of every instruction.If the
processor finds a valid interrupt signal and if the interrupt is unmasked and enabled,
then the processor accepts the interrupt.The acceptance of the interrupt is
acknowledged by sending an INTA signal to the interrupted device. The processor
.in
saves the content of PC in stack and then loads the vector address of the interrupt in
PC.If the interrupt is non-vectored, then the interrupting device has to supply the
ng
address of ISR when it receives INTA signal. It starts executing ISR in this address.At
the end of ISR, a return instruction, RET will be placed.When the processor executes
eri
the RET instruction, it POP the content of top of stack to PC. Thus the processor control
returns to main program after servicing interrupt.
e
The hardware interrupts of 8085 are TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR
gin
Further the interrupts may be classified into VECTORED and NON-VECTORED
INTERRUPTS.
En
VECTORED INTERRUPT:
arn
TRAP 0024H
15
www.LearnEngineering.in
www.LearnEngineering.in
NON-VECTORED INTERRUPT:
In non-vectored interrupts the interrupted device should give the address of the interrupt
service routine (ISR).
The INTR is a non-vectored interrupt.
.in
When a device interrupts through INTR, it has to supply the address of ISR after
receiving interrupt acknowledge signal.
ng
TRIGGERING EDGE OF 8085 INTERRUPTS:
eri
The TRAP interrupt is edge and level sensitive.To initiate TRAP, the interrupt signal has
to make a low to high transition and then it has to remain high until the interrupt is
e
recognized.The RST 7.5 interrupt is positive edge sensitive. To initiate the RST 7.5, the
gin
interrupt signal has to make a low to high transition and it need not remain high until it is
recognized.The RST 6.5, RST 5.5 and INTR are level sensitive interrupts.Hence for
these interrupts the interrupting signal should remain high, until it is recognized.
En
Non-maskable Interrupts.
w.
Non-maskable Interrupts:
The interrupts which cannot be disabled are called Non-maskable Interrupts.
ww
Maskable Interrupts:
The interrupts which can be enabled or disabled are called Maskable Interrupts.
RST 7.5, RST 6.5, RST 5.5 and INTR are Maskable interrupt.
16
www.LearnEngineering.in
www.LearnEngineering.in
Masking is preventing the interrupt from disturbing the main program.When an interrupt
is masked the processor will not accept the interrupt signal.The interrupts can be
masked by executing SIM instruction. (SIM - Set InterruptMask).The status of maskable
interrupts can be read into accumulator by executing RIM instruction (RIM - Read
Interrupt Mask).All the hardware interrupts, except TRAP are disabled, when the
processor is resetted.They can also be disabled by executing DI instruction. (Dl-Disable
Interrupt).When an interrupt is disabled, it will not be accepted by the processor.To
.in
enable the disabled interrupt, the processor has to execute El instruction (El-Enable
Interrupt).
ng
INTERRUPT PRIORITY:
eri
The order in which the interrupt has to be serviced is called Interrupt Priority.The priority
order of the 8085 interrupt is
e
gin
Interrupt Interrupt Priority
TRAP 1
En
RST 7.5 2
arn
RST 6.5 3
RST 5.5 4
Le
INTR 5
w.
ww
17
www.LearnEngineering.in
www.LearnEngineering.in
.in
2 RST 7.5 003CH Positive Edge Sensitive Maskable 2
ng
3 RST 6.5 0034H Level Sensitive Maskable 3
eri
4 RST 5.5 002CH Level Sensitive Maskable 4
4..Draw the timing diagram for Opcode Fetch machine cycle, Memory Read
machine cycle,MemoryWrite,I/O read machine cycle and I/O write machine Cycle.
(Nov/Dec-2014)
arn
Instruction Cycle:
Le
The time required to access the memory or input/output devices is called machine
cycle.
ww
T-State
A portion of an operation carried out in one system clock period is called as T-state.The
machine cycle and instruction cycle takes multiple clock periods.
18
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
Opcode fetch cycle is part of any instruction execution. In this machine cycle 8085
Le
fetches opcode of instruction. The following are the sequence of actions that are
performed by 8085 to fetch an opcode from memory. This machine cycle consists of 4
w.
T-states.
8085 places 16-bit address from PC on to the address bus and issues ALE pulse in
ww
first T-state (T1). This is used to de-multiplex the address and data bus. It also issues
IO/M‟ signal to „0‟. This indicates that processor is performing memory related
operation. In second T-state (T2) processor issues RD‟ control signal to memory.
This enables memory to put data present at the address location given in previous T-
state on to data bus. RD‟ control signal is active for two clock pulses.
19
www.LearnEngineering.in
www.LearnEngineering.in
In T3 state memory places opcode on Data bus. Processor reads opcode present on
data bus and de-asserts RD‟ signal. Thus data bus goes into high impedance state.
This machine cycle is required when an operand is present in memory. This machine
.in
cycle requires three T-states. The following are the sequence of actions performed by
microprocessor during this machine cycle.
ng
e eri
gin
En
arn
Le
w.
ww
In the first T-state (T1) 8085 places address on address bus and issues ALE signal.
And also IO/M‟ signal is made low, since it is memory related operation.
In the second T-state (T2), processor issues RD‟ control signal to memory. In
response to this memory places data on data bus.
20
www.LearnEngineering.in
www.LearnEngineering.in
In the third T-state (T3), processor reads data from data bus, and de-asserts RD‟
signal.
.in
performed by processor in this machine cycle.
ng
e eri
gin
En
arn
Le
w.
ww
In first T-state (T1), 8085 processor places 16- bit address on address bus and issues
ALE signal. And also it makes IO/M‟ signal to low, indicating it is memory related
operation.
In second T-state (T2), processor places data to be written on data bus and asserts
WR‟ signal to the memory.
21
www.LearnEngineering.in
www.LearnEngineering.in
In the third T-state (T3), memory stores the data and processor de-asserts WR‟
signal.
.in
performed by processor during this machine cycle.
ng
e eri
gin
En
arn
Le
w.
In the first T-state (T1) 8085 places port address(for IO mapped addresses port
address is 8-bit, but for memory mapped addresses IO device address is 16-bit, but
ww
reading from such is performed by memory read machine cycle) on address bus and
issues ALE signal. And also IO/M‟ signal is made high, since it is IO related operation.
In the second T-state (T2), processor issues RD‟ control signal to IO peripheral.
In response to this input device places data on data bus.
22
www.LearnEngineering.in
www.LearnEngineering.in
In the third T-state (T3), processor reads data from data bus, and de-asserts RD‟
signal.
.in
performed by processor during this machine cycle.
ng
e eri
gin
En
arn
Le
In first T-state (T1), 8085 processor places 8-bit port address on address bus (for IO
w.
mapped addresses port address is 8-bit, but for memory mapped addresses, IO device
ww
address is 16-bit, but writing to such is performed by memory write machine cycle) and
issues ALE signal. And also it makes IO/M‟ signal to high, indicating it is IO related
operation.
In second T-state (T2), processor places data to be written on data bus and asserts
WR‟ signal to the peripheral.
23
www.LearnEngineering.in
www.LearnEngineering.in
In the third T-state (T3), peripheral accepts the data and processor de-asserts
WR‟ signal.
5.Explain how the memory organization was done in 8085.
8085 has 16 bit address bus, hence it can access 2 16 no. of memory locations,
which is equal to 64KB memory. Memory is required to store program as well as data.
Since microprocessor doesn‟t have on-chip memory, we need to connect it
.in
externally.So it requires addressing mechanism.
The following are the steps involved in interfacing memory with 8085 processor.
ng
1. First decide the size of memory requires to be interfaced. Depending on
this we can say how many address lines are required for it. For example if you
want to interface 4KB (212) memory it requires 12 address lines. Remaining
eri
address lines can be used in address decoding.
2.
e
Depending on the size of memory required and given address range,
gin
construct address decoding circuitry. This address decoding circuitry can be
implemented with NAND gates and/or decoders or using PAL.
3. Connect data bus of memory to processor data bus.
En
4. Generate the control signals required for memory using IO/M‟, WR‟, RD‟
signals of 8085 processor.
arn
Example:
Interface 4KB memory to 8085 with starting address A000H.
Le
2. Given that starting address for memory is A000H. So for 4KB memory
ending address becomes A000H+0FFFH (4KB) = AFFFH.
24
www.LearnEngineering.in
www.LearnEngineering.in
A0-A11 address lines are directly connected to address bus of memory chip. A12-A15
are used for generating chip select signal for memory chip.
.in
ng
e eri
gin
A15 line is use for enabling 74x138 decoder chip. A12, A13, A14 lines are connected to
En
74X138 chip as inputs. When theses lines are 010 output should be „0‟. This is provided
at O2 pin of 74X138 chip.
arn
25
www.LearnEngineering.in
www.LearnEngineering.in
A15, A14, A13, A12 inputs should be 1010, for enabling the chip. So the circuit for this
is as shown above.
There are two types of address decoding mechanism, based on address lines used for
generating chip select signal.
.in
1. Absolute decoding
2. Partial decoding
ng
Absolute decoding:
All the higher order lines of microprocessor, left after using the required signals for
eri
memory are completely used for generating chip select signal.This type of decoding is
called absolute decoding.
Partial decoding: e
gin
Only some of the address lines of microprocessor left after using the required
signals for memory are used for generating chip select signal. Because of this multiple
En
address ranges will be formed. If total memory space is not required for the system
then, this type of address decoding can be used. The advantage of this technique is
fewer components are required for memory interfacing because of this board size
arn
26
www.LearnEngineering.in
www.LearnEngineering.in
.in
1. Data transfer group – MOV A,B
2. Arithmetic group – ADD B
ng
3. Logical group- ANA B
4. Branch group – JMP LABEL
eri
5. Stack I/O and Machine Control group – PUSH,POP,HLT.
3. Explain the difference between a JMP instruction and CALL instruction.
MAY/JUNE2012 e
gin
A JMP instruction permanently changes the program counter.
A CALL instruction leaves information on the stack so that the original program
En
A lookup table is an array that replaces runtime computation with a simpler array
indexing operation.The savings in terms of processing time can be significant, since
retrieving a value from memory is often faster than undergoing an expensive
Le
This instruction subtracts the contents of the specified register from contents of
the accumulator and sets the condition flags as a result of the subtraction.
ww
27
www.LearnEngineering.in
www.LearnEngineering.in
.in
1. Immediate addressing
2. Register addressing
ng
3. Direct addressing
4. Indirect addressing
eri
5. Implicit addressing
9. Define stack and stack related instructions? MAY/JUNE
2013,NOV/DEC2012 e
gin
The stack is a group of memory locations in the R/W memory that is used for the
temporary storage of binary information during the execution of the program. The stack
En
28
www.LearnEngineering.in
www.LearnEngineering.in
13. How to access subroutine with in the main program procedure? NOV/DEC
2013
i) Accessed by CALL & RET instruction
ii)Machine code of instruction is put only once in the
memory iii)With procedures less memory is required
iv)Parameters can be passed in registers, memory location or stack
.in
14.What are the four instructions which control the interrupt structure of the
8085 microprocessor?
ng
DI(disable interrupts)
EI(enable interrupts)
eri
RIM(read interrupt masks)
SIM(set interrupt masks)
e
15. How the microprocessor is synchronized with peripherals?
gin
The timing and control unit synchronizes all the microprocessor operations with
clock and generates control signals necessary for communication between the
En
PART - B
program has to operate on a data. The method of specifying the data to be operated by
the instruction is called Addressing.
The 8085 has the following 5 different types of addressing.
1. Immediate Addressing
2. Direct Addressing
29
www.LearnEngineering.in
www.LearnEngineering.in
3. Register Addressing
4. Register Indirect Addressing
5. Implied Addressing
1.Immediate Addressing :
In immediate addressing mode, the data is specified in the instruction itself. The data
will be a part of the program instruction.All instructions that have „I‟ in their mnemonics
.in
are of Immediate addressing type.
ng
Example: MVI A, 01H- Move the data 01H given in the instruction to A register.
eri
2.Direct Addressing :
In direct addressing mode, the address of the data is specified in the instruction.The
e
data will be in memory. In this addressing mode, the program instructions and data can
gin
be stored in different memory blocks. This type of addressing can be identified by 16-bit
address present in the instruction.
En
Example:LDA 4500H- Load the data available in memory location 4500H in A register.
arn
3.Register Addressing :
In register addressing mode, the instruction specifies the name of the register in which
Le
the data is available.This type of addressing can be identified by register names in the
instruction.
w.
30
www.LearnEngineering.in
www.LearnEngineering.in
This type of addressing can be identified by letter „M‟ present in the instruction.
5.Implied Addressing :
In implied addressing mode, the instruction itself specifies the type of operation and
.in
location of data to be operated. This type of instruction does not have any address,
register name, immediate data specified along with it.
ng
Example:CMA - Complement the content of accumulator
eri
2.Explain the Different types of instruction in 8085. NOV/DEC 2013,MAY/JUNE
e
2013,NOV/DEC 2012,MAY/JUNE 2012,MAY/JUNE 2011
gin
An instruction is a command given to the microprocessor to perform specified operation
on a given data.The instruction set of a microprocessor is the collection of instructions
En
2. Arithmetic Instructions.
3. Logical Instructions.
4. Branching / Control Transfer Instructions.
Le
and memory. It copies the data from source location to destination location.No flags will
be affected.
MOVE INSTRUCTION:
MOV Rd, Rs
31
www.LearnEngineering.in
www.LearnEngineering.in
MOV M, Rs
MOV Rd, M
This instruction copies the contents of the source register into the destination register.
The contents of the source register are not altered.If one of the operands is a memory
location, its location is specified by the contents of the HL registers.
Example: MOV B, C - This instruction move the content of C register to B register.
MOV B, M -This instruction move the content of memory location pointed by HL
.in
register to B register.
ng
MOVE IMMEDIATE 8-BIT:
eri
MVI Rd, data
MVI M, data
e
The 8-bit data is stored in the destination registeror memory.If the operand is a memory
gin
location, its location is specified by the contents of the HL registers.
En
registers.
LOAD ACCUMULATOR:
Le
The contents of a memory location, specified by a16-bit address in the operand, are
copied to the accumulator. The contents of the source are not altered. This is a 3-byte
ww
instruction, the second byte specifies the low-order address and the third byte specifies
the high-order address.
Example: LDA 4000 –The content of memory location 4000 is loaded into A register.
STORE ACCUMULATOR:
32
www.LearnEngineering.in
www.LearnEngineering.in
EXCHANGE:
.in
XCHG
ng
The contents of register H are exchanged with the contents of register D, and the
contents of register L are exchanged with the contents of register E.
eri
Example: XCHG :This instruction exchange the content of H and L with D and E
2.ARITHMETIC INSTRUCTIONS:
e
The arithmetic instructions includes addition, subtraction ,increment and decrement
gin
operations.
ADDITION:
En
ADD Rs
ADD M
The contents of the operand (register or memory) are added to the contents of the
Le
accumulator and the result is stored in the accumulator. If the operand is a memory
location, its location is specified by the contents of the HL registers. All flags are
w.
33
www.LearnEngineering.in
www.LearnEngineering.in
.in
Example: ADC B -The content of A register is added with the content of B register and
also Carry and the result is stored in A register.
ng
ADC M - The content of A register is added with the content of memory location
pointed by HL register and also carry and the result is stored in A register.
eri
ADD IMMEDIATE TO ACCUMULATOR
e
gin
ADI 8-bit data
The 8-bit data (operand) is added to the contents of the accumulator and the result is
En
stored in the accumulator.All flags are modified to reflect the result of the addition.
Example: ADI 45 – The data 45H is immediately added with the content of A register
and result Is stored in A register.
arn
SUBTRACTION:
Le
SUBRs
SUB M
ww
The contents of the operand (register or memory) are subtracted from the contents of
the accumulator and the result is stored in the accumulator.If the operand is a memory
location, its location is specified by the contents of the HLregisters.All flags are modified
to reflect the result of the subtraction.
Example: SUB B – The content of A register is subtracted with the content of B register
and the result is stored in A register.
34
www.LearnEngineering.in
www.LearnEngineering.in
SBB R
SBB M
.in
The contents of the operand (register or memory ) and the Borrow flag are subtracted
from the contents of the accumulator and the result is placed in the accumulator. If the
ng
operand is a memory location, its location is specified by the contents of the HL
registers.All flags are modified to reflect the result in accumulator.
eri
Example: SBB B -The content of A register is subtracted with the content of B register
and also Borrow flag and the result is stored in A register.
e
SBB M - The content of A register is subtracted with the content of memory
gin
location pointed by HL register and also Borrow and the result is stored in A register.
En
The 8-bit data (operand) is subtracted from the contents of the accumulator and the
result is stored in the accumulator. All flags are modified to reflect the result of the
subtraction.
Le
Example: SUI 45 -The data 45H is immediately subtracted with the content of A register
and Result is stored in A register.
w.
INR R
INR M
The contents of the designated (register or memory) are incremented by 1 and the
result is stored in the same place.If the operand is a memory location, its location is
specified by the contents of the HL registers.
35
www.LearnEngineering.in
www.LearnEngineering.in
INX R
The contents of the designated register pair are incremented by1 and the result is
stored in the same place.
.in
Example: INX H – The HL register pair is incremented by 1 and showing the next
memory location.
ng
DECREMENT REGISTER OR MEMORY
eri
DCR R
DCR M
e
The contents of the designated (register or memory) are decremented by 1 and the
gin
result is stored in the same place.If the operand is a memory location, its location is
specified by the contents of the HL registers.
En
DCX R
The contents of the designated register pair are decremented by1 and the result is
w.
Memory location.
3.LOGICALINSTRUCTIONS:
36
www.LearnEngineering.in
www.LearnEngineering.in
Logical AND :
Logical AND register or memory with accumulator
ANA R
ANA M
The contents of the accumulator are logically ANDed with the contents of the operand
(register or memory), and the result is placed in the accumulator.If the operand is a
.in
memory location, its address is specified by the contents of HL registers.S, Z, P are
modified to reflect the result of the operation. CY is reset. AC is set.
ng
Example: ANA B - The content of A register is ANDed with the content of B register
and the result is stored in A register.
eri
ANA M - The content of A register is ANDed with the content of memory
location pointed by HL register and the result is stored A register.
e
gin
LOGICAL AND IMMEDIATE WITH ACCUMULATOR
En
the result is placed in the accumulator.S, Z, P are modified to reflect the result of the
operation. CY is reset. AC is set.
Example: ANI 45 -The data 45H is immediately ANDed with the content of A register
Le
XRA R
XRA M
The contents of the accumulator are Exclusive ORed with the contents of the operand
(register or memory), and the result is placed in the accumulator.If the operand is a
memory location, its address is specified by the contents of HL registers.
37
www.LearnEngineering.in
www.LearnEngineering.in
S, Z, P are modified to reflect the result of the operation. CY and AC are reset.
Example: XRA B -The content of A register is XORed with the content of B register and
the result is stored in A register.
XRA M -The content of A register is XORed with the content of memory
location pointed by HL register and the result is stored A register.
.in
XRI 8-bit data
ng
The contents of the accumulator are Exclusive ORed with the8-bit data (operand) and
the result is placed in the accumulator.S, Z, P are modified to reflect the result of the
eri
operation. CY and AC are reset.
Example: XRI 45 -The data 45H is immediately XORed with the content of A register
and result is stored in A register. e
gin
LOGICAL OR REGISTER OR MEMORY WITH ACCUMULATOR
En
ORA R
arn
ORA M
The contents of the accumulator are logically ORed with the contents of the operand
(register/memory), and the Result is placed in the accumulator.If the operand is a
Le
Example: ORA B -The content of A register is ORed with the content of B register and
the result is stored in A register.
ww
38
www.LearnEngineering.in
www.LearnEngineering.in
.in
COMPLEMENT ACCUMULATOR:
ng
CMA
The contents of the accumulator are complemented.
eri
No flags are affected.
Example: CMA
e
gin
COMPLEMENT CARRY:
En
CMC
The Carry flag is complemented.No other flags are affected.
arn
Example: CMC
SET CARRY :
Le
STC
w.
The branching instructions are used to change the execution order.They are divided into
conditional jump/call or unconditional jump/call.
39
www.LearnEngineering.in
www.LearnEngineering.in
JUMP UNCONDITIONALLY
.in
JUMP CONDITIONALLY
The program sequence is transferred to the memory location specified by the 16- bit
ng
address given in the operand based on the specified flag of the PSW.
eri
Example:
OPCODE DESCRIPTION e
FLAG STATUS
gin
En
JC Jump on Carry CY = 1
JZ Jump on Zero Z =1
w.
40
www.LearnEngineering.in
www.LearnEngineering.in
.in
CONDITIONAL SUBROUTINE CALL :
ng
The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand based on specified flag of the PSW. Before the transfer,
eri
the address of the next instruction after the call the contents of the program counter is
pushed onto the stack.
e
gin
Example: CZ 4000
En
CC Call on Carry CY = 1
Le
CZ Call on Zero Z =1
41
www.LearnEngineering.in
www.LearnEngineering.in
RET
The program sequence is transferred from the subroutine to the calling program. The
two bytes from the top of the stackare copied into the program counter, and program
.in
execution begins at the new address.
Example: RET
ng
CONDITIONAL RETURN FROM SUBROUTINE:
eri
The program sequence is transferred from the subroutine to the calling program based
on the specified flag of the PSW.The two bytes from the top of the stack are copied into
e
the program counter, and program execution begins at the new address.
gin
Example: RZ
En
RC Return on Carry CY = 1
Le
RZ Return on Zero Z =1
42
www.LearnEngineering.in
www.LearnEngineering.in
These instructions are used to manipulate the stack to perform the input /output and to
.in
alter the internal control flags.Unless specified the flags are not affected.
ng
STACK INSTRUCTION:
eri
PUSH :
POP INSTRUCTION:
arn
I/O INSTRUCTION :
ww
IN port
The data placed on the 8 bit bidirectional data bus by the specified port is moved to
register A.
OUT port
43
www.LearnEngineering.in
www.LearnEngineering.in
The contents of register A are placed on the 8 bit data bus is transferred to the specified
port.
EI
The interrupt system is enabled.
.in
DI
ng
The interrupt system is disabled.
eri
NOP
3.Write an 8085 ALP to add, subtract, multiply and divide two 8 bit numbers
stored at consecutive memory locations. NOV/DEC 2015
Le
8 BIT ADDITION:
w.
ALGORITHM:
ww
44
www.LearnEngineering.in
www.LearnEngineering.in
PROGRAM:
4101
.in
4103 4500
ng
4104
eri
4105 MOV A, M Transfer first data to
accumulator
4106 INX e
H Increment HL reg. to point
gin
next memory Location.
Content.
arn
410A
w.
45
www.LearnEngineering.in
www.LearnEngineering.in
.in
8 BIT SUBTRACTION:
ng
1. Initialize memory pointer to data location.
2. Get the first number from memory in accumulator.
eri
3. Get the second number and subtract from the accumulator.
4. If the result yields a borrow, the content of the acc. is complemented and 01H is
e
added to it (2‟s complement). A register is cleared and the content of that reg. is
gin
incremented in case there is a borrow. If there is no borrow the content of the
acc. is directly taken as the result.
En
PROGRAM:
4102
4103 4500
4104
46
www.LearnEngineering.in
www.LearnEngineering.in
accumulator
.in
4108 JNC L1 Jump to location if result does
not yield borrow.
4109
ng
410A
eri
410B INR C Increment C reg.
410C CMA
e Complement the Acc. Content
gin
410D ADI 01H Add 01H to content of acc.
En
410E
to memory.
8 BIT MULTIPLICATION:
47
www.LearnEngineering.in
www.LearnEngineering.in
.in
programmable. 4. The interrupt can be masked or unmasked individually
ng
2014)
eri
In asynchronous data transfer, one character is transferred at a time. Start and
stop bits are used with each character. The transmitter and receiver use two separate
clock inputs here.
e
gin
3. What are the internal registers available in 8259 PIC? (Apr/May-2015)
Asynchronous synchronous
Data can be sent one character at a time used for transferring large
amount of data
83
www.LearnEngineering.in
www.LearnEngineering.in
.in
using either synchronous or asynchronous serial data.
ng
The scan counter has two modes to scan the key matrix and refresh the display.
eri
In the encoded mode, the counter provides binary count that is to be externally decoded
to provide the scan linesfor keyboard and display. In the decoded scan mode, the
e
counter internally decodes the least significant 2 bit and provides a decoded 1 out of 4
gin
scan on SL3-SL 3. The keyboard and display both are in the same mode at a time.
(handshake mode) iii. Mode 2- Strobe bi-directional mode b) Bit Set/Reset Mode.
84
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
11. What are the different peripheral interfacing used with 8085 microprocessor?
(May/June-2013)
85
www.LearnEngineering.in
www.LearnEngineering.in
TXD (output terminal), TXRDY (output terminal), TXEMPTY (Output terminal), RXRDY
(Output terminal), DTR (Output terminal), RTS (Output terminal)
.in
13. What are the different types of command words used in 8259A? (Nov/Dec-
ng
2013)
The command words of 8259A are classified in two groups
eri
1. Initialization command words (ICWs)
2. Operation command words (OCWs)
e
gin
14. What are the basic modes of operation of 8255? (Nov/Dec-2013)
In this the data is transferred bit by bit that is used for one to one communication.
w.
PART - B
ww
1.Draw the block diagram of 8255A Programmable Peripheral Interface (PPI) and
explain each block . (May/June-2014)
86
www.LearnEngineering.in
www.LearnEngineering.in
Port A and port B can be used as 8-bit input/output ports.Port C can be used as an 8-
bit input/output port or as two 4-bit input/output ports or to produce handshake signals
for ports A and B.
.in
Eight data lines (D0 - D7) are available to read/write data into the ports or control
register.The RD andWR pin , which are active low signals for read and write operations.
ng
The address lines A1 and A0 allow to successively access any one of the ports or the
eri
control register.The control signal chip select CS is used to enable the 8255 chip. when
CS = '0', the 8255 is enabled.The RESET input is connected to the RESET
e
pin8085.When the system is reset, all the ports are initialized as input lines.
gin
The control register or the command word register is an 8-bit register used to select the
modes of operation and input/output designation of the ports.
En
The Bit Set/Reset (BSR) mode is applicable to port C only.Each line of port C (PC 0 -
ww
PC7) can be set/reset by suitably loading the control word register. BSR mode and I/O
mode are independent and selection of BSR mode does not affect the operation of
other ports in I/O mode.
A1 A0 Port Selected
0 0 Port A
87
www.LearnEngineering.in
www.LearnEngineering.in
0 1 Port B
1 0 Port C
.in
ng
e eri
gin
En
arn
Le
w.
ww
D7 D6 D5 D4 D3 D2 D1 D0
0 * * * B2 B1 B0 S/R
88
www.LearnEngineering.in
www.LearnEngineering.in
.in
Selection of port C pin is determined as follows:
B2 B1 B0 Pin of Port C Selected
ng
0 0 0 PC0
0 0 1 PC1
eri
0 1 0 PC2
0 1 1 PC3
1 0 0 PC4 e
gin
1 0 1 PC5
1 1 0 PC6
En
1 1 1 PC7
arn
INPUT/OUTPUT MODE
This mode is selected when D7 bit of the Control Word Register is 1. There are three
Le
I/O modes
w.
D7 D6 D5 D4 D3 D2 D1 D0
89
www.LearnEngineering.in
www.LearnEngineering.in
.in
Mode 0 features:
Output ports are latched.Input ports are buffered, not latched.Ports do not have
ng
handshake or interrupt capability.With 4 ports, 16 different combinations of I/O are
possible.
eri
Mode 1:- Strobed I/O
Port A or Port B for handshake (strobed) input or output operation.
e
Port A + Port C upper function as handshake signals.
gin
Port B + Port C lower function as handshake signals.
Mode 1 features:
En
Two ports i.e. port A and B can be used as 8-bit i/o ports.Each port uses three lines of
port c as handshake signal and remaining two signals can be used as i/o ports.Interrupt
arn
90
www.LearnEngineering.in
www.LearnEngineering.in
.in
2.Discuss the internal architecture of 8253/8254 Programmable Interval timer.
(May/June-2014)
ng
eri
The Intel 8253 and 8254 are Programmable Interval Timers (PITs), which perform
timing and counting functions and has the same pinout.
e
gin
8253 8254
Reads and Writes of the same counter Reads and Writes of the same counter can
Le
91
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
The timer has three counters.or timers which are named as "Counter 0", "Counter 1"
and "Counter 2".Each counter has 2 input pins – "CLK" (clock input) and "GATE" – and
arn
1-pin, "OUT", for data output. The 3 counters are 16-bit down counters independent of
each other, and can be easily read by the CPU. The first counter is used to generate
atimekeeping interrupt.The second counter is used to trigger the refresh of DRAM
Le
memory. The last counter is used to generate tones via the PC speaker.
Data/Bus Buffer:
w.
This block contains the logic to buffer the data bus to / from the microprocessor, and to
ww
the internal registers. It has 8 input pins, usually labelled as D7..D0, where D7 is the
MSB.
Read/Write Logic:
92
www.LearnEngineering.in
www.LearnEngineering.in
.in
block and then by sending the control word to the Data/Bus Buffer block.The control
word register contains 8 bits, labeled D7..D0 (D7 is the MSB).
ng
D7 D6 D5 D4 D3 D2 D1 D0
eri
SC1 SC2 RW1 RW0 M2 M1 M0 BCD
M2 M1 M0 Mode
0 0 0 Mode0
arn
0 0 1 Mode1
X 1 0 Mode2
Le
X 1 1 Mode3
1 0 0 Mode4
w.
1 0 1 Mode5
ww
D5 D4
93
www.LearnEngineering.in
www.LearnEngineering.in
D7 D6
.in
0 0 Select Counter 0
0 1Select Counter 1
ng
1 0Select Counter 2
eri
1 1Illegal
D3 – 1 = Select Counter 2
Le
D2 – 1 = Select Counter 1
w.
D1 – 1 = Select Counter 0
ww
Operation Modes
94
www.LearnEngineering.in
www.LearnEngineering.in
to 0.Counting rate is equal to the input clock frequency.The OUT pin is set low after the
Control Word is written, and counting starts one clock cycle after the COUNT
programmed. OUT remains low until the counter reaches 0, at which point OUT will be
set high until the counter is reloaded or the Control Word is written. The Gate signal
should remain active high for normal counting. If Gate goes low counting gets
terminated and current count is latched till Gate pulse goes high again.
.in
Mode 1 : Programmable One Shot
In this mode 8253 can be used as MonostableMultivibrator.GATE input is used as
ng
trigger input.OUT will be initially high. OUT will go low on the CLK pulse following a
trigger to begin the one-shot pulse, and will remain low until the Counter reaches zero.
eri
OUT will then go high and remain high until the CLK pulse after the next trigger.
e
In this mode, the device acts as a divide-by-n counter, which is commonly used to
gin
generate a real-time clock interrupt.Counting process will start the next clock cycle after
COUNT is sent. OUT will then remain high until the counter reaches 1, and will go low
for one clock pulse.OUT will then go high again, and the whole process repeats itself.
En
output will be different from mode 2.If „N „is the number loaded into the counter , the
output will be
Le
High for N/2 counts and N/2 counts for Low if N is Even.
High for (N+1)/2 counts and (N-1)/2 counts for Low if N is Odd.
w.
After Control Word and COUNT is loaded, the output will remain high until the counter
reaches zero.The counter will then generate a low pulse for 1 clock cycle (a strobe) –
after that the output will become high again.
95
www.LearnEngineering.in
www.LearnEngineering.in
When the GATE input is high , it will start counting. When the counter reaches 0, the
output will go low for one clock cycle – after that it will become high again, to repeat the
cycle.
3.Draw and explain the functional block diagram of 8259 Programmable Interrupt
Controller. (Apr/May-2015)
Functional Description:
.in
The 8259 A has eight interrupt request inputs, IR0- IR7.The 8259 A uses its INT output
to interrupt the 8085A via INTR pin.The 8259Areceives interrupt acknowledge pulses
ng
from the at its input.Vector address used by the 8085 A to transfer control to the service
subroutine of the interrupting device, is provided by the 8259 A on the data bus.
eri
The 8259A is a programmable device that must be initialized by command words sent
by the. After initialization the 8259A mode of operation can be changed by operation
command words.
e
gin
The descriptions of various blocks are,
Data bus buffer:
En
This 3- state, bidirectional 8-bit buffer is used to interface the 8259Ato the system data
bus. Control words and status information are transferred through the data bus buffer.
arn
Le
w.
ww
96
www.LearnEngineering.in
www.LearnEngineering.in
.in
Interrupt request register (IRR):
IRR stores all the interrupt inputs that are requesting service.It keeps track of which
ng
interrupt inputs are asking for service. If an interrupt input is unmasked, and has an
interrupt signal on it, then the corresponding bit in the IRR will be set.
eri
Interrupt mask register (IMR):
The IMR is used to disable (Mask) or enable (Unmask) individual interrupt inputs.Each
e
bit in this register corresponds to the interrupt input with the same number.The IMR
gin
operation on the IRR. Maskingof higher priority input will not affect the interrupt request
lines oflower priority.To unmask any interrupt the corresponding bit is set „0‟.
En
serviced.For each input that is currently being serviced the corresponding bit will be set
in the in service register.Each of these 3-reg can be read as status reg.Priority
Le
Resolver:
This logic block determines the priorities of the set in the IRR. The highest priority is
selected and strobed into the corresponding bit of the ISR during pulse.
w.
Cascade buffer/comparator:
This function blocks stores and compare the address of all 8259A‟s in the register.The
ww
97
www.LearnEngineering.in
www.LearnEngineering.in
.in
highest priority,the priority sequence will begin at that IR.
Automatic Rotation Mode:
ng
In this mode, a device which one is being serviced will be considered as a lowest
priority In the next time.
eri
Specific Rotation Mode:
This mode is similar to the automatic rotation mode except the user can select
any IR for the lowest priority, thus fixing any other priorities.
e
gin
End of Interrupts (EOI):
After the completion of an interrupt service, the corresponding ISR bit needs to
be reset.This is called the End of Interrupt.(EOI).It can be issued in 3 formats.They are
En
When the 8259 receives the third INTA signal, the ISR bit is reset.The major
drawback of this mode is that ISR does not have information on which IR is being
w.
serviced.
There are four Initialization Command Word ICW1,ICW2,ICW3&ICW4 and
ww
98
www.LearnEngineering.in
www.LearnEngineering.in
.in
Vector Address
ng
Initialization Command Word 2 (ICW2)
D7 D6 D5 D4 D3 D2 D1 D0
eri
A15/T7 A14/T6 A13/T5 A12/T4 A11/T3 A10 A9 A8
e
gin
A15-A7 – Interrupt Vector Address (8085 mode)
T7 – T3 - Interrupt Vector Address (8086 mode)
En
D7 D6 D5 D4 D3 D2 D1 D0
M7 M6 M5 M4 M3 M2 M1 M0
Le
w.
4.Draw the neat diagram ,explain the architecture and features of 8279 keyboard /
display controller. (Apr/May-2015)
99
www.LearnEngineering.in
www.LearnEngineering.in
.in
I/OControlandDataBuffer
ng
The I/O control section controls the flow of data to/from the 8279. The data buffer
interface the external bus of the system with internal bus of 8279. The pin Ao, RD and
eri
WR select the command, status or data read/write operations carried out by the CPU
with 8279.
e
gin
En
arn
Le
w.
ww
100
www.LearnEngineering.in
www.LearnEngineering.in
.in
Scan Counter
The Scan Counter has two modes to scan the key matrix and refresh the display.In the
ng
Encoded mode, the counter provides a binary count that is to be externally decoded to
provide the scan lines for keyboard and display.In the decoded scan mode, the counter
eri
internally decodes the least significant 2 bits and provides a decoded 1 out of 4 scan on
SL0-SL3.The Keyboard and Display both are in the same mode at a time.
e
gin
Return Buffers and Keyboard Debounce and Control
This section scans for a Key closure row-wise.If it is detected, the Keyboard debounce
En
unit debounces the key entry.After the debounce period, if the key continues to be
detected. The code of the Key is directly transferred to the sensor RAM along with
arn
In Keyboard or strobed input mode, this block acts as 8-byte first-in-first-out (FIFO)
RAM. Each key code of the pressed key is entered in the order of the entry, and in the
w.
meantime, read by the CPU, till the RAM becomes empty. The status logic generates
an interrupt request after each FIFO read operation till the FIFO is empty.In scanned
ww
sensor matrix mode, this unit acts as sensor RAM.Each row of the sensor RAM is
loaded with the status of the corresponding row of sensors in the matrix.If a sensor
changes its state, the IRQ line goes high to interrupt the CPU.
101
www.LearnEngineering.in
www.LearnEngineering.in
.in
Keyboard Modes
Scanned Keyboard Mode with 2 Key Lockout
ng
In this mode of operation, when a key is pressed, a debounce logic comes into
operation. The Key code of the identified key is entered into the FIFO with SHIFT and
eri
CNTL status, provided the FIFO is not full.
Scanned Keyboard with N-key Rollover
e
In this mode, each key depression is treated independently. When a key is pressed, the
gin
debounce circuit waits for 2 keyboard scans and then checks whether the key is still
depressed. If it is still depressed, the code is entered in FIFO RAM. Any number of keys
En
can be pressed simultaneously and recognized in the order, the Keyboard scan record
them.
arn
ScannedKeyboardSpecialErrorMode
This mode is valid only under the N-Key rollover mode. This mode is programmed using
end interrupt/error mode set command. If during a single debounce period (two
Le
Keyboard scan) two keys are found pressed, this is considered a simultaneous
depression and an error flag is set. This flag, if set, prevents further writing in FIFO
w.
SensorMatrixMode
In the Sensor Matrix mode, the debounce logic is inhibited the 8-byte memory matrix.
The status of the sensor switch matrix is fed directly to sensor RAM matrix Thus the
sensor RAM bits contains the row-wise and column-wise status of the sensors in the
sensor matrix.
102
www.LearnEngineering.in
www.LearnEngineering.in
DisplayModes
There are various options of data display The first one is known as left entry mode or
type writer mode. Since in a type writer the first character typed appears at the left-most
position, while the subsequent characters appears successively to the right of the first
one.The other display format is known as right entry mode, or calculator mode, since
the calculator the first character entered appears at the right-most position and this
character is shifted one position left when the next character is entered.
.in
1.LeftEntryMode
ng
In the Left entry mode, the data is entered from the left side of the display unit.
Address0 of the display RAM contains the leftmost display character and address 15
eri
of the RAM contains the rightmost display character.
2.RightEntryMode
e
gin
In the right entry mode, the first entry to be displayed is entered on the rightmost
display.The next entry is also placed in the right most display but after the previous
En
All the Command words or status words are written or read with Ao = 1 and CS = 0 to or
arn
from 8279.
Le
The format of the command word to select different modes of operation of 8279 is given
w.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 D D K K K
D4 D3 Display Modes
103
www.LearnEngineering.in
www.LearnEngineering.in
.in
D2 D1 D0 Keyboard Modes
0 0 0 Encoded Scan 2 Key lock
ng
out
0 0 1 Decoded Scan 2 Key lock
eri
out
0 1 0 Encoded Scan N Key
rollover
e
gin
0 1 1 Decoded Scan N Key
rollover
En
Matrix
1 1 0 Strobed Input Encoded
Le
Scan
1 1 1 Strobed Input Decoded
w.
Scan
ww
5.Draw the neat diagram ,explain the architecture and features of 8237Direct
Memory Access
Controller.
DMA Controller: A DMA controller is a device, usually peripheral to a CPU that is
programmed to perform a sequence of data transfers on behalf of the CPU.A DMA
104
www.LearnEngineering.in
www.LearnEngineering.in
controller can directly access memory and is used to transfer data from one memory
location to another, or from an I/O device to memory and vice versa.A DMA controller
manages several DMA channels, each of which can be programmed to perform a
sequence of these DMA transfers.A DMA request signal for each channel is routed to
the DMA controller.When the DMA controller sees a DMA request, it responds by
performing one or many data transfers from that I/O device into system memory or vice
versa.Channels must be enabled by the processor for the DMA controller to respond to
.in
DMA requests.A DMA controller typically shares the system memory and I/O bus with
the CPU and has both bus master and slave capability. The diagram of DMA controller
ng
architecture and how the DMA controller interacts with the CPU.In bus master mode,
the DMA controller acquires the system bus (address, data, and control lines)from the
eri
CPU to perform the DMA transfers. Because the CPU releases the system bus for the
duration of the transfer, the process is sometimes referred to as cycle stealing.In bus
e
slave mode, the DMA controller is accessed by the CPU, which programs the
gin
DMAcontroller's internal registers to set up DMA transfers.The internal registers consist
of source and destination address registers and transfer count registers for each DMA
En
channel, as well as control and status registers for initiating, monitoring, and sustaining
the operation of the DMAcontroller.
arn
iii) The three common transfer modes are single, block, and
demand transfer modes.
ww
105
www.LearnEngineering.in
www.LearnEngineering.in
.in
ng
e eri
gin
En
arn
Le
This is an active high input which clears the Command, Status, Request, and
Temporary registers, the First/Last Flip-Flop, and the mode register counter.The Mask
ww
READY:
This signal can be used to extend the memory read and write pulses from the
82C37A to accommodate slow memories or I/O devices.
106
www.LearnEngineering.in
www.LearnEngineering.in
The active high Hold Acknowledge from the CPU indicates that it has
relinquished control of the system busses.
.in
activating the DREQ line of a channel. DACK will acknowledge the recognition of a
DREQ signal.RESET initializes these lines to active high.DREQ must be maintained
ng
until the corresponding DACK goes active.DREQ will not be recognized while the clock
is stopped.Unused DREQ inputs should be pulled High or Low(inactive) and the
eri
corresponding mask bit set.
output the contents of a register to the CPU.The outputs are disabled and the inputs are
read during an I/O Write cycle when the CPU is programming the 82C37A control
arn
registers. During DMA cycles, the most significant 8-bits of the address are output onto
the data bus to be strobed into an external latch by ADSTB. In memory-to-memory
operations, data from the memory enters the 82C37A on the data bus during the read-
Le
from-memory transfer, then during the write-to memory transfer, the data bus outputs
write the data into the new memory location.
w.
IOR: READ:
ww
I/O Read is a bidirectional active low three-state line. In the Idle cycle, it is an
input control signal used by the CPU to read the control registers. In the active cycle, it
is an output control signal used by the 82C37A to access data from the peripheral
during a DMAWrite transfer.
107
www.LearnEngineering.in
www.LearnEngineering.in
IOW: WRITE:
I/O Write is a bidirectional active low three-state line.
In the Idle cycle, it is an input control signal used by the CPU to load information into
the 82C37A. In the active cycle, it is an output control signal used by the 82C37A to
load data to the peripheral during a DMA
Read transfer.
.in
EOP: END OF PROCESS:
End of Process (EOP) is an active low bidirectional signal.The 82C37A allows an
ng
external signal to terminate an active DMA service by pulling the EOP pin low.A pulse is
generated by the 82C37A when terminal count (TC) for any channel is reached, except
eri
for channel 0 in memory-to-memory mode.During memory-to-memory transfers , EOP
will be output when the TC for channel 1 occurs.The EOP pin is driven by an open drain
e
transistor on-chip, and requires an external pull-up resistor to VCC. When an EOP pulse
gin
occurs, whether internally or externally generated, the 82C37A will terminate the
service,and if auto-initialize is enabled, the base registers will be written to the current
En
registers of that channel. The mask bit and TC bit in the status word will be set for the
currently active channel by EOP unless the channel is programmed for auto initialize. In
arn
A0-A3: ADDRESS: The four least significant address lines are bidirectional three-state
Le
signals. In the Idle cycle, they are inputs and are used by the 82C37A to address the
control register to be loaded or read. In the Active cycle, they are outputs and provide
w.
A4-A7: ADDRESS: The four most significant address lines are three-state outputs and
provide 4-bits of address. These lines are enabled only during the DMA service.
108
www.LearnEngineering.in
www.LearnEngineering.in
HRQ: HOLD REQUEST: The Hold Request (HRQ) output is used to request control of
the system bus. When a DREQ occurs and the corresponding mask bit is clear, or a
software DMA request is made, the 82C37A issues HRQ. The HLDA signal then
informs the controller when access to the system busses is permitted. For stand-alone
operation where the 82C37A always controls the busses, HRQ may be tied to HLDA.
This will result in one S0 state before the transfer.
.in
DACK0-DACK3: DMA ACKNOWLEDGE:
DMA acknowledge is used to notify the individual peripherals when one has been
ng
granted a DMA cycle. RESET initializes them to active low.
eri
AEN: ADDRESS ENABLE:
Address Enable enables the 8-bit latch containing the upper 8address bits onto the
e
system address bus. AEN can also be used to disable other system busdrivers during
gin
DMA transfers.AEN is active high.
ADSTB: ADDRESS STROBE:
En
This is an active high signal used to control latching of the upper address byte. During
block operations, ADSTB will only be issued when the upper address byte must be
arn
updated. ADSTB timing is referenced to the falling edge of the 82C37A clock.
The Memory Read signal is an active low three-state output used to access data from
the selected memory location during a DMA Read or a memory-to-memory transfer.
w.
The Memory Write signal is an active low three-state output used to write data to the
selected memory location during a DMA Write or a memory-to-memory transfer.
NC: NO CONNECT: Pin 5 is open and should not be tested for continuity.
109
www.LearnEngineering.in
www.LearnEngineering.in
Functional Description
The 82C37A direct memory access controller is designed to improve the data
transfer rate in systems which must transfer data from an I/O device to memory, or
move a block of memory to an I/O device. It will also perform memory-to-memory block
moves, or fill a block of memory with data from a single location. Operating modes are
provided to handle single byte transfers as well as discontinuous data streams, which
allows the 82C37A to control data movement.Memory-to-memory operations require
.in
temporary internal storage of the data byte between generation of the source and
destination addresses, so memory-to-memory transferstake place at less than half the
ng
rate of I/O operations, but still much faster than with centralprocessor techniques. The
block diagram of the 82C37A consists of timing and control block, priority block, and
eri
internal registers are the main components. The timing and control block derives
internal timing from clock input, and generates external control signals. The Priority
e
Encoder block resolves priority contention between DMA channels requesting service
gin
simultaneously.
En
DMA Operation:
In a system, the 82C37A address and control outputs and data bus pins are basically
arn
connected in parallel with the system busses. An external latch is required for the upper
address byte. While inactive, the controller‟s outputs are in a high impedance state.
When activated by a DMArequest and bus control is relinquished by the host, the
Le
82C37A drives the busses and generates the control signals to perform the data
transfer.The operation performed by activating one of the four DMA request inputs has
w.
previously been programmed into the controller via the Command,Mode, Address, and
Word Count registers.For example, if a block of data is to be transferredfrom RAM to an
ww
I/O device, the starting address of the data is loaded into the 82C37A Current and Base
Address registers for a particular channel, and the length of the block is loaded into the
channel‟s Word Count register. The corresponding Mode register is programmed for a
memory to-I/O operation (read transfer), and various options are selected by the
Command register and the other Mode register bits.The channel‟s mask bit is cleared to
110
www.LearnEngineering.in