Professional Documents
Culture Documents
Mpa Question Bank1
Mpa Question Bank1
Mpa Question Bank1
Third module
1. Differentiate memory mapped IO and IO mapped IO schemes
Program:
MVI A, 80H ; Initialization -control word for 8255 to Configure all ports as output
ports
OUT 03
MVI A, DATA ; Load 8-bit data to be sent at the input of 0808 DAC
OUT 00 ; Send data on port A
5. Write an assembly a language program to generate the following waveforms using a control switch
a) Sawtooth Waveform b) Triangular waveform c)square waveform
(a) Saw tooth Wave Generation
MVI A,80
OUT 00
START: MVI A,00
L1: OUT 02
INR A
JNZ L1
JMP START
(b) Triangular Wave Generation
START: MVI L,00
L1: MOV A,L
OUT 02
INR L
JNZ L1
MVI L,FF
L2: MOV A,L
OUT 02
DCR L
JNZ L2
JMP START
(c) Square Wave Generation
MVI A,80
OUT 00
START: MVI A,00
OUT 02
CALL DELAY
MVI A,FF
OUT 02
CALL DELAY
JMP START
DELAY: MVI B,05
L1: MVI C,FF
L2: DCR C
JNZ L2
DCR B
JNZ L1
RET
Fourth module
6. Explain the control word format of 8255 for IO mode.
D0, D1, D3, D4 are assigned for lower port C, port B, upper port C and port A respectively. When these
bits are 1, the corresponding port acts as an input port. For e.g., if D 0 = D4 = 1, then lower port C and port
A act as input ports. If these bits are 0, then the corresponding port acts as an output port. For e.g., if D 1 =
D3 = 0, then port B and upper port C act as output ports.
D2 is used for mode selection of Group B (port B and lower port C). When D 2 = 0, mode 0 is selected
and when D2 = 1, mode 1 is selected.
D5 & D6 are used for mode selection of Group A ( port A and upper port C). The selection is done as
follows:
D6
D5
Mode
As it is I/O mode, D7 = 1.
For example, if port B and upper port C have to be initialized as input ports and lower port C and port A as
output ports (all in mode 0):
1.
2.
3.
4.
Hence, for the desired operation, the control word register will have to be loaded with 8A (hex).
Mode 0 - Simple I/O
In this mode, the ports can be used for simple I/O operations without handshaking signals. Port A, port B
provide simple I/O operation. The two halves of port C can be either used together as an additional 8-bit port,
or they can be used as individual 4-bit ports. Since the two halves of port C are independent, they may be
used such that one-half is initialized as an input port while the other half is initialized as an output port.Mode 0
- Output mode
Mode 1 (Input/output with Hand shake)
1 byte transmission every 200 ns. To make such data transfer via the CPU is
both undesirable and unnecessary.
The basic idea of DMA is to transfer blocks of data directly between memory and
peripherals. The data dont go through the microprocessor but the data bus is
occupied.
Normal transfer of one data byte takes up to 29 clock cycles. The DMA transfer
requires only 5 clock cycles.
Nowadays, DMA can transfer data as fast as 60 M byte per second. The transfer
rate is limited by the speed of memory and peripheral devices.
8. With neat diagram explain the architecture of programmable interrupt controller.
Cascade Buffer/Comparator
10.
Group A and B get the Control signal from CPU and send the command to the individual control
blocks.
Group A send the control signal to port A and Port C (Upper) PC7-PC4.
Group B send the control signal to port B and Port C (Lower) PC3-PC0.
PORT A
This is a 8-bit buffered I/O latch.
It can be programmed by mode 0 , mode 1, mode 2 .
PORT B:
This is a 8-bit buffer I/O latch.
It can be programmed by mode 0 and mode 1.
PORT C
This is a 8-bit Unlatched buffer Input and an Output latch.
It is splitted into two parts.
It can be programmed by bit set/reset operation.
11. Explain the different operating modes of 8254 timer.
Mode 0: Events counter.
o Mode 0 is typically used for event counting.
o After the Control Word is written, OUT is initially low
o Will remain low until the Counter reaches zero.
o OUT then goes high and remains high until a new count or a new Mode 0 Control word is
written into the Counter.
o GATE e 1 enables counting; GATE e 0 disables counting.
Mode 1: One shot pulse
OUT will be initially high.
OUT will go low on the CLK pulse following a trigger to begin the one-shot pulse,will
remain low until the Counter reaches zero.
OUT will then go high and remain high until the CLK pulse after the next trigger.
Mode 2: Continuous pulses, one clock pulse wide
This Mode functions like a divide-by-N counter.
It is typically used to generate a Real Time Clock interrupt.
OUT will initially be high.
When the initial count has decremented to 1, OUT goes low for one CLK pulse.
OUT then goes high again, the Counter reloads the initial count and the process is
repeated.
Mode 2 is periodic; the same sequence is repeated indefinitely.
Mode 3: Continuous square-wave as long as Gate is 1
Mode 3 is typically used for Baud rate generation.
Mode 3 is similar to Mode 2 except for the duty cycle of OUT.
OUT will initially be high.
When half the initial count has expired, OUT goes low for the remainder of the
count.
Mode 3 is periodic; the sequence above is repeated indefinitely.
Mode 4: Software triggered one-shot pulse
OUT will be initially high.
When the initial count expires, OUT will go low for one CLK pulse then go high
again.
The counting sequence is ``triggered' by writing the initial count.
GATE e 1 enables counting; GATE e 0 disables counting.
Mode 5: Hardware triggered one-shot pulse
OUT will initially be high.
Counting is triggered by a rising edge of GATE.
When the initial count has expired, OUT will go low for one CLK pulse then go
high again.
12. Explain and interface a seven segment display and keyboard to 8085
Intels 8279 is a general purpose keyboard display controller that simultaneously drives the display of
a system and interfaces a keyboard with the CPU, leaving it free for its routine task.
The important features of 8279 are,
Fifth module
13. List the features of Intel 8086.
8086 is a 16bit processor. Its ALU, internal registers works with 16bit binary
word
- 8086 has a 16bit data bus. It can read or write data to a memory/port either 16bits
or 8 bit at a time
- 8086 has a 20bit address bus which means, it can address upto 220 = 1MB memory
location
- Frequency range of 8086 is 6-10 MHz
14. Explain the common mode signals of 8086.
RD* - Pin no. 34, Type O
Read: Read strobe indicates that the processor is performing a memory of I/O read cycle,
depending on the state of the S2 pin. This signal is used to read devices which reside on the 8086 local bus.
RD* is active LOW during T2, T3 and TW of any read cycle, and is guaranteed to remain HIGH in T2 until the
8086 local bus has floated.
This signal floats to 3-state OFF in hold acknowledge.
READY Pin no. 22, Type I
READY: is the acknowledgement from the addressed memory or I/O device that it will
complete the data transfer. The READY signal from memory / IO is synchronized by the 8284A Clock
Generator to form READY. This signal is active HIGH. The 8086 READY input is not synchronized. Correct
operation is not guaranteed if the setup and hold times are not met.
TEST* - Pin No 23 Type I
TEST* : input is examined by the Wait instruction. If the TEST* input is LOW execution
continues, otherwise the processor waits in an idle state. This input is synchronized internally during each
clock cycle on the leading edge of CLK.
RESET Pin no. 21 Type I
Reset: causes the processor to immediately terminate its present activity. The signal must be
active HIGH for at least four clock cycles. It restarts execution, as described in the instruction set description,
when RESET returns LOW. RESET is internally synchronized.
BHE*/S7- Pin No. 34 Type O
Bus High Enable / Status: During T1 the Bus High Enable signal (BHE*) should be used to
enable data onto the most significant half of the data bus, pins D15-D8. Eight bit oriented devices tied to the
upper half of the bus would normally use BHE* to condition chip select functions. BHE* is LOW during T1
for read, write, and interrupt acknowledge cycles when a byte is to be transferred on the high portion of the
bus. The S,7 status information is available during T2, T3 and T4. The signal is active LOW and floats to 3state OFF in hold. It is LOW during T1 for the first interrupt acknowledge cycle.
15. Explain the signals used in maximum mode operation of 8086.
RQ*/GT0*, RQ*/GT1* - Pin no. 30, 31 Type I/O
Request /Grant: pins are used by other local bus masters to force the processor to release the
local bus at the end of the processors current bus cycle. Each pin is bidirectional with RQ*/GT0* having
higher priority than RQ*/GT1*. RQ*/GT* has an internal pull up resistor so may be left unconnected.
LOCK* - Pin no. 29 Type O
LOCK* : output indicates that other system bus masters are not to gain control of the system
bus while LOCK* is active LOW. The LOCK* signal is activated by the LOCK prefix instruction and
remains active until the completion of the next instruction. This signal is active LOW, and floats to 3-state
OFF in hold acknowledge.
QS1, QS0 Pin no. 24, 25 Type O
Queue Status: the queue status is valid during the CLK cycle after which the queue operation
is performed.
QS1 and QS0 provide status to allow external tracking of the internal 8086 instruction queue.
16. Explain the function of the following pins
a. NMI
Non Maskable Interrupt: an edge triggered input which causes a type 2 interrupt. A subroutine is vectored to
via an interrupt vector lookup table located in system memory. NMI is not maskable internally by software. A
transition from a LOW to HIGH initiates the interrupt at the end of the current instruction. This input is
internally synchronized.
b. DT/R
Data Transmit / Receive: needed in minimum system that desires to use an 8286/8287 data bus transceiver. It
is used to control the direction of data flow through the transceiver. Logically DT/R* is equivalent to S 1* in
the maximum mode, and its timing is the same as for M/IO*. (T=HIGH, R=LOW). This signal floats to 3state OFF in local bus hold acknowledge.
c. DEN
Data Enable: provided as an output enable for the 8286/8287 in a minimum system which uses the transceiver.
DEN* is active LOW during each memory and I/O access and for INTA cycles. For a read or INTA* cycle it
is active from the middle of T2 until the middle of T4, while for a write cycle it is active from the beginning of
T2 until the middle of T4. DEN* floats to 3-state OFF in local bus hold acknowledge.
d. BHE.
Bus High Enable / Status: During T1 the Bus High Enable signal (BHE*) should be used to enable data onto
the most significant half of the data bus, pins D15-D8. Eight bit oriented devices tied to the upper half of the
bus would normally use BHE* to condition chip select functions. BHE* is LOW during T1 for read, write,
and interrupt acknowledge cycles when a byte is to be transferred on the high portion of the bus. The S,7
status information is available during T2, T3 and T4. The signal is active LOW and floats to 3-state OFF in
hold. It is LOW during T1 for the first interrupt acknowledge cycle
17. Explain the interrupts of 8086.
NMI Pin no. 17 Type I
Non Maskable Interrupt: an edge triggered input which causes a type 2 interrupt. A
subroutine is vectored to via an interrupt vector lookup table located in system memory. NMI is not maskable
internally by software. A transition from a LOW to HIGH initiates the interrupt at the end of the current
instruction. This input is internally synchronized.
INTR Pin No. 18 Type I
Interrupt Request: is a level triggered input which is sampled during the last clock cycle of
each instruction to determine if the processor should enter into an interrupt acknowledge operation. A
subroutine is vectored to via an interrupt vector lookup table located in system memory. It can be internally
masked by software resetting the interrupt enable bit. INTR is internally synchronized. This signal is active
HIGH.
18. Draw and explain the register organization of 8086 processor.
All the registers of 8086 are 16-bit registers. The general purpose registers can be used as either 8-bit
registers or 16-bit registers.
The register set of 8086 can be categorized into 4 different groups. The register organization of 8086 is shown
in the figure.
AX
AH
AL
BX
BH
BL
SS
CX
CH
CL
DS
DX
DH
DL
ES
BP
Segment
registers
FLAGS/
PSW
SI
DI
IP
The register DI is used to store the offset of destination in data or extra segment.
The index registers are particularly useful for string manipulation.
Flag Register
The 8086 flag register contents indicate the results of computation in the ALU. It also contains some flag bits
to control the CPU operations.
19. Explain the signals used in minimum mode operation of 8086.
HOLD, HLDA Pin no. 31, 30 Type I/O
HOLD: indicates that another master is requesting a local bus hold. To be acknowledged,
HOLD must be active HIGH. The processor receiving the hold request will issue HLDA (HIGH) as an
acknowledgement in the middle of a T1 clock cycle. Simultaneous with the issuance of HLDA the processor
will float the local bus and control lines. After HOLD is detected as being LOW, the processor will LOWer the
HLDA, and when the processor needs to run another cycle, it will again drive the local bus and control lines.
The same rules as apply regarding when the local bus will be released.
HOLD is not an asynchronous input. External synchronization should be provided if the system can not
otherwise guarantee the setup time.
WR* - Pin no. 29 Type O
Write: indicates that the processor is performing a write memory or write I/O cycle,
depending on the state of the M/IO* signal. WR* is active for T2, T3 and TW of any write cycle. It is active
LOW, and floats to 3-state OFF in local bus hold acknowledge.
M/IO* - Pin no. 28 type O
Status line: logically equivalent to S2 in the maximum mode. It is used to distinguish a
memory access from an I/O access. M/IO* becomes valid in the T4 preceding a bus cycle and remains valid
until the final T4 of the cycle (M=HIGH), IO=LOW). M/IO* floats to 3-state OFF in local bus hold
acknowledge.
DT/R* - Pin no. 27 Type O
Data Transmit / Receive: needed in minimum system that desires to use an 8286/8287 data
bus transceiver. It is used to control the direction of data flow through the transceiver. Logically DT/R* is
equivalent to S1* in the maximum mode, and its timing is the same as for M/IO*. (T=HIGH, R=LOW). This
signal floats to 3-state OFF in local bus hold acknowledge.
DEN* - Pin no. 26 Type O
Data Enable: provided as an output enable for the 8286/8287 in a minimum system which
uses the transceiver. DEN* is active LOW during each memory and I/O access and for INTA cycles. For a
read or INTA* cycle it is active from the middle of T2 until the middle of T4, while for a write cycle it is active
from the beginning of T2 until the middle of T4. DEN* floats to 3-state OFF in local bus hold acknowledge.
ALE Pin no. 25 Type O
Address Latch Enable: provided by the processor to latch the address into the 8282/8283
address latch. It is a HIGH pulse active during T1 of any bus cycle. Note that ALE is never floated.
INTA* - Pin no. 24 Type O
INTA* is used as a read strobe for interrupt acknowledge cycles. It is active LOW during T2,
T3 and TW of each interrupt acknowledge cycle.
20. What are the advantages and disadvantages of physical memory of 8086?
21. Draw the memory read cycle in maximum mode of 8086.
BHE
A0
Function
0
0
1
1
0
1
0
1
Whole word
Upper byte/ odd address
Lower byte/even address
none
AD15 AD0
FFFFOH
BHE 0 , then it reads the 16 bits data from memory location FFFFOH and FFFF1H .
If BHE 1 , it reads the 8 bits data from memory location FFFFOH
If