Professional Documents
Culture Documents
(Autonomous)
Department of Computer Science and Engineering
III Semester
20EC306-DIGITAL LOGICs AND MICROPROCESSOR
Regulation 2020
UNIT II COMBINATIONAL LOGIC CIRCUITS
----------------------------(2)
DECODERS
A decoder is a combinational circuit that converts binary information
from ‗n‘ input lines to a maximum of ‗2n‘ unique output lines. The general
structure of decodercircuit is –
-------(2)
Inputs Outputs -------- -- (2)
Enable A B Y3 Y2 Y1 Y0
0 x x 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
3 Explain the Magnitude Comparator and Implement the 2-Bit/4 Bit Magnitude
Comparator (or) show the magnitude comparator of two binary numbers using 16 CO2 U
combinational logic circuit.
4 Discuss the 2 Bit by 2 Bit Binary Multiplier (or) Implement the 2 bit Binary
multiplier using Combinational Logic Circuit. 16 CO2 U
………---(8)
4X4 Binary Multiplier
5 Explain in detail about Multiplexer and Demultiplexer. (or) Enumerate the
details of MUX and DEMUX with combinational logic circuit.
A multiplexer (MUX) is a digital switch which connects data from one of n sources
to the output. A number of select inputs determine which data source is connected
to the output. 16 CO2 U
The block diagram of MUX with n data sources of b bits wide and s bits wide
select line is shown in below figure.
MUX acts like a digitally controlled multi-position switch where the binary code
applied to the select inputs controls the input source that will be switched on to the
output as shown in the figure below.
At any given point of time only one input gets selected and is connected to output,
based on the select input signal.
The operation of a multiplexer can be better explained using a mechanical switch
as shown in the figure below. This rotary switch can touch any of the inputs, which
is connected to the output.
2x1 MUX
DEMULTIPLEXER
Usually implemented by using n-to-2n binary decoders where the decoder enable
line is used for data input of the de-multiplexer.
Block diagram which has got s-bits-wide select input, one b-bits-wide data input
and n b-bits- wide outputs.
The operation of a de-multiplexer can be better explained using a mechanical
switch as shown in the figure below.
This rotary switch can touch any of the outputs, which is connected to the input.
As you can see at any given point of time only one output gets connected to input.
1-to-4 De-multiplexer
000 0
001 1
010 1
011 0
100 1
101 0
110 0
111 1
From the above Truth table, the Boolean function for even parity bit as
P=W′X′Y+W′XY′+WX′Y′+WXY
P=W′(X′Y+XY′)+W(X′Y′+XY)
P=W′(X⊕Y)+W(X⊕Y)′=W⊕X⊕Y
The following figure shows the circuit diagram of even parity generator.
Parity Checker
There are two types of parity checkers based on the type of parity has to be checked.
Even parity checker
To implement an even parity checker circuit. Assume a 3-bit binary input, WXY is
transmitted along with an even parity bit, P.
So, the resultant word data contains 4 bits, which will be received as the input of
even parity checker.
It generates an even parity check bit, E. This bit will be zero, if the received data
contains an even number of ones.
That means, there is no error in the received data. This even parity check bit will be
one, if the received data contains an odd number of ones. That means, there is an
error in the received data.
4-bit Received Data Even Parity Check bit E
WXYP
0000 0
0001 1
0010 1
0011 0
0100 1
0101 0
0110 0
0111 1
1000 1
1001 0
1010 0
1011 1
1100 0
1101 1
1110 1
1111 0
The Boolean function of even parity check bit is an odd function. Exclusive-OR
function satisfies this condition. Hence, we can directly write the Boolean
function of even parity check bit as
E=W⊕X⊕Y⊕P
The following figure shows the circuit diagram of even parity checker.
PART A
Q.No Questions Marks CO BL
1 List the four different types of shift registers. 2 CO3 R
As this type of shift register converts parallel data, such as an 8-bit data word into
serial format
Iit can be used to multiplex many different input lines into a single serial DATA stream
which can be sent directly to a computer or transmitted over a communications line.
Parallel-in to Parallel-out (PIPO)
The final mode of operation is the Parallel-in to Parallel-out Shift Register. This type of
shift register also acts as a temporary storage device or as a time delay device similar
to the SISO configuration above.
The data is presented in a parallel format to the parallel input pins P A to PD and then
transferred together directly to their respective output pins QA to QD by the same clock
pulse.
Then one clock pulse loads and unloads the register. This arrangement for parallel
loading and unloading is shown below.
4-bit Parallel-in to Parallel-out
The PIPO shift register is the simplest of the four configurations as it has only three
connections , similar to the Serial-in to Serial-out shift register,
Also, in this type of register there are no interconnections between the individual flip-
flops since no serial shifting of the data is required.
3 Explain Serial in Parallel out and Serial in Serial Out Shift Register (or) Explain the
16 CO3 U
Shift register in synchronous sequential circuit
The Shift Register is another type of sequential logic circuit that can be
used for the storage or the transfer of binary data
Serial-in to Parallel-out (SIPO) Shift Register
If a logic “1” is connected to the DATA input pin of FFA then on the first clock pulse the
output of FFA and therefore the resulting QA will be set HIGH to logic “1” with all the
other outputs still remaining LOW at logic “0”.
That the DATA input pin of FFA has returned LOW again to logic “0” giving us one data
pulse or 0-1-0.
The second clock pulse will change the output of FFA to logic “0” and the output
of FFB and QB HIGH to logic “1” as its input D has the logic “1” level on it from QA.
Then the data has been converted from a serial data input signal to a parallel data
output. The truth table and following waveforms show the propagation of the logic “1”
through the register from left to right as follows.
0 0 0 0 0
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
5 0 0 0 0
Construct any one Synchronous counter and Explain the operation (or)
4 16 CO3 AP
Construct Synchronous up / down counter.
An up/down counter is a bidirectional counter, capable of progressing in either
direction through a certain sequence.
A 3-bit binary counter that advances upward through its sequence (0, 1, 2, 3, 4, 5, 6,
7) and then can be reversed so that it goes through the sequence in the opposite
direction (7, 6, 5, 4, 3, 2, 1,0) is an illustration of up/down sequential operation.
Explain the operation and excitation tables of JK Flip Flops.(or) Explain the operation
5 16 CO3 U
and excitation tables of Any one Flip Flops
JK means Jack Kilby, Texas Instrument (TI) Engineer, who invented
IC in 1958.JK Flip-Flop has two inputs J(set) and K(reset).
A JK Flip-Flop can be obtained from the clocked SR Flip-Flop by
augmenting two AND gates.
Inputs Output
CLK State
J K Qn+1
1 0 0 Qn No Change
1 0 1 0 Reset
1 1 0 1 Set
1 1 1 Q n’ Toggle
Qn J K Qn+1
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
A sequential circuit has two JK Flip-Flops A and B, one input (x) and
one output(y). the Flip-Flop input functions are,
JA= B+ x JB= A’+ x’
KA= 1 KB= 1
6 and the circuit output function, Y= xA’B. 16 CO3 U
a) Draw the logic diagram of the Mealy circuit,
b) Tabulate the state table,
c) Draw the state diagram.
Soln:
State table:
Present
Input Flip-Flop Inputs Next state Output
state
JA= B+ JB= A’+
KA= 1 KB= 1 A(t+1) B(t+1) Y=
A B x x x’ xA’B
0 0 0 0 1 1 1 0 1 0
0 0 1 1 1 1 1 1 1 0
0 1 0 1 1 1 1 1 0 0
0 1 1 1 1 1 1 1 0 1
1 0 0 0 1 1 1 0 1 0
1 0 1 1 1 0 1 0 0 0
1 1 0 1 1 1 1 0 0 0
1 1 1 1 1 0 1 0 0 0
Next state Output
Present state
x= 0 x= 1 x= 0 x= 1
A B A B A B y y
0 0 0 1 1 1 0 0
0 1 1 0 1 0 0 1
1 0 0 1 0 0 0 0
1 1 0 0 0 0 0 0
State Diagram:
- - - - O D I T S Z - AC - P - CY
PART- B
Q.No Questions Marks CO BL
Explain the architecture of 8086 processor with neat diagram.(or) Enumerate the
1 16 CO4 U
details of 8086 microprocessor with neat diagram of Harvard Architecture.
Flags Register determines the current state of the processor. They are modified
automatically by CPU after mathematical operations, this allows to determine the type of the
result, and to determine conditions to transfer control to other parts of the program. 8086 has
9 flags and they are divided into two categories:
Conditional Flags
Conditional flags represent result of last arithmetic or logical instruction executed. Conditional
flags are as follows:
Carry Flag (CF)
Auxiliary Flag (AF)
Parity Flag (PF)
Zero Flag (ZF)
Sign Flag (SF)
Overflow Flag (OF)
Control Flags:
Control flags are set or reset deliberately to control the operations of the execution unit.
Control flags are as follows:
Trap Flag (TP)
Interrupt Flag (IF)
Direction Flag (DF)
Summarize the minimum mode configuration of 8086 microprocessor with neat
2 16 CO4 U
sketch. (or) Explain the block description of 8086 microprocessor when MN/MX’ = 1.
The 8086 microprocessor operates in minimum mode when MN/MX’ = 1.
In minimum mode, 8086 is the only processor in the system which provides all the
control signals which are needed for memory operations and I/O interfacing.
Here the circuit is simple but it does not support multiprocessing.
8282 (8 bits) latch :
The latches are buffered D FF. They are used to separate the valid address from the
multiplexed Address/data bus by using the control signal ALE, which is connected to
strobe (STB) of 8282.
bits) transceivers :
8286 (8
They are bidirectional buffers and also known as data amplifiers.
They are used to separate the valid data from multiplexed add/data bus.
Two such transceivers are needed because the data bus is 16 bits long.
8286 is connected to DT/R’ and DEN’ signals. They are enabled through the DEN
signal.
The direction of data on the data bus is controlled by the DT/R’ signal. DT/R’ is
connected to T and DEN’ is connected to OE’.
Direction of data flow
8284 clock generator is used to provide the clock.
M/IO’= 1,then I/O transfer is performed over the bus. and when M/IO’ = 0, then I/O
operation is performed.
The signals RD’ and write WR’ are used to identify whether a read bus cycle or a write
bus cycle is performing. When WR’ = 0 ,then it indicates that valid output data on the
data bus.
Control signals for all operations are generated by decoding S’2, S’1 and
S’0 using 8288 bus controller.
Bus request is done using RQ’ / GT’ lines interfaced with 8086. RQ0 /GT0 has more
priority than RQ1/GT1.
INTA’ is given by 8288, in response to an interrupt on INTR line of 8086.
Show the timing diagram of minimum mode in 8086 microprocessor with detail
4 explanation. (or) Explain the 8086 microprocessor in minimum mode configuration 16 CO4 U
with neat timing diagram.
The working of min mode can be easily understood by timing diagrams.
All processors bus cycle is of at least 4 T-states(T1,T2,T3,T4) .The address is given by
processor in the T1 state. It is available on the bus for one T-state.
In T2, the bus is tristated for changing the direction of the bus ( in the case of a data
read cycle.)
The data transfer takes place between T3 and T4 .
If the addressed device is slower, then the wait state is inserted between T3 and T4.
S2 S1 S0 Characteristics
0 0 0 Interrupt acknowledge
0 1 1 Halt
1 0 0 Code access
1 0 1 Read memory
1 1 0 Write memory
1 1 1 Passive state
A16/S3, A17/S4, A18/S5, and A19/S6: The specified address lines are multiplexed
with corresponding status signals.
BHE’/S7 : Bus High Enable/Status. During T1 it is low. It is used to enable data onto
the most significant half of data bus, D8-D15.
RD’: This is used for read operation. It is an output signal. It is active when low.
READY : This is the acknowledgement from the memory or slow device that they have
completed the data transfer.
INTR : Interrupt Request. This is triggered input. This is sampled during the last clock
cycles of each instruction for determining the availability of the request.
NMI : Non maskable interrupt. This is an edge triggered input which results in a type II
interrupt.
INTA : Interrupt acknowledge. It is active low (0) during T2, T3 and Tw of each
interrupt acknowledge cycle.
MN/MX’ : Minimum/Maximum. This pin signal indicates what mode the processor will
operate in.
RQ’/GT1′, RQ’/GT0′ : Request/Grant. These pins are used by local bus masters used
to force the microprocessor to release the local bus at the end of the microprocessor’s
current bus cycle.
LOCK’ : Its an active low pin. It indicates that other system bus masters have not
been allowed to gain control of the system bus while LOCK’ is active low(0).
TEST’ : This examined by a ‘WAIT’ instruction. If the TEST pin goes low(0), execution
will continue, else the processor remains in an idle state.
CLK : Clock Input. The clock input provides the basic timing for processing operation
and bus control activity. Its an asymmetric square wave with a 33% duty cycle.
RESET : This pin requires the microprocessor to terminate its present activity
immediately. The signal must be active high(1) for at least four clock cycles.
Vcc : Power Supply( +5V D.C.)
GND : Ground
QS1, QS0: Queue Status. These signals indicate the status of the internal 8086
instruction queue according to the table shown below
0 0 No operation
DT/R : Data Transmit/Receive. The direction of data flow is controlled through the
transceiver.
DEN : Data enable. DEN is active low(0) during each memory and input-output access
and for INTA cycles.
HOLD/HOLDA : HOLD indicates that another master has been requesting a local bus
.This is an active high(1). The microprocessor receiving the HOLD request will issue
HLDA (high) as an acknowledgement in the middle of a T4 or T1 clock cycle.
ALE : Address Latch Enable. ALE is provided by the microprocessor to latch the
address into the 8282 or 8283 address latch.
6. Show the timing diagram of maximum mode in 8086 microprocessor with detail
explanation. (or) Explain the 8086 microprocessor in maximum mode configuration
with neat timing diagram.
In the maximum mode, the 8086 is operated by strapping the MN/MX pin to ground.
In this mode, the processor derives the status signal S2, S1, S0.
Another chip called bus controller derives the control signal using this status information.
In the maximum mode, there may be more than one microprocessor in the system
configuration. The components in the system are same as in the minimum mode system.
The basic function of the bus controller chip IC8288 is to derive control signals like RD
and WR (for memory and I/O devices), DEN, DT/R, ALE etc. using the information by the
processor on the status lines.
The bus controller chip has input lines S2, S1, S0 and CLK.
These inputs to 8288 are driven by CPU. It derives the outputs ALE, DEN, DT/R, MRDC,
MWTC, AMWC, IORC, IOWC and AIOWC. The AEN, IOB and CEN pins are especially
useful for multiprocessor systems.
AEN and IOB are generally grounded. CEN pin is usually tied to +5V. The significance of
the MCE/PDEN output depends upon the status of the IOB pin. INTA pin used to issue
two interrupt acknowledge pulses to the interrupt controller or to an interrupting device.
IORC, IOWC are I/O read command and I/O write command signals respectively. These
signals enable an IO interface to read or write the data from or to the address port.
The MRDC, MWTC are memory read command and memory write command signals
respectively and may be used as memory read or write signals.
All these command signals instructs the memory to accept or send data from or to the
bus. Here the only difference between in timing diagram between minimum mode and
maximum mode is the status signals used and the available control and advanced
command signals.
R0, S1, S2 are set at the beginning of bus cycle.8288 bus controller will output a pulse
as on the ALE and apply a required signal to its DT / R pin during T1.
In T2, 8288 will set DEN=1 thus enabling transceivers, and for an input it will activate
MRDC or IORC. These signals are activated until T4.
For an output, the AMWC or AIOWC is activated from T2 to T4 and MWTC or IOWC is
activated from T3 to T4. The status bit S0 to S2 remains active until T3 and become
passive during T3 and T4. If reader input is not activated before T3, wait state will be
inserted between T3 and T4.
UNIT V ASSEMBLY LANGUAGE PROGRAMMING AND INTERFACING APPLICATIONS
PART- A
Q.No Questions Marks CO BL
1 Observe the need for a Port. 2 CO5 R
The I/O devices are generally slow devices and their timing characteristics do not
match withprocessor timings.
Hence the I/O devices are connected to system bus through the ports.
2 Define the operation of handshake input port. 2 CO5 R
In handshake input operation, the input device will check whether the port is empty or
not. If the port is empty, then the data is loaded into the port.
When the port receives the data, it will inform the processor for read operation.
Once the data have been read by the processor, the port will signal the input device
that it is empty.
Now the input device can load another data to portand the above process is repeated.
3 List the three operating modes of port -A 8255 2 CO5 R
The port-A of 8255 can be programmed to work in anyone of the following operating
modes asinput or output port.
Mode-0 : Simple 1/0 port. Mode-l: Handshake 1/0 port Mode-2: Bidirectional 1/0 port
4 Classify the different scan modes of 8279 2 CO5 R
The different scan modes of 8279 are Decoded scan and Encoded scan.
In decoded scan mode, the output of scan lines will be similar to a 2-to-4 decoder.
In encoded scan mode, the output of scan lines will be binary count, and so an
external decodershould be used to convert the binary count to decoded output.
5 Show I/O mode format for 8255 2 CO5 R
14 Show the addressing mode of MOV AX, 55H (BX) (SI) ? 2 CO5 R
MOV AX, 55H (BX) (SI) – Base Indexed memory addressing mode
15 Write an assembly language program to load the accumulator with a constant value. 2 CO5 U
MACRO invert value
if (value==0)
MOV A, #1
Else clr A
end if
END MAC.
16 How are constants declared? 2 CO5 R
Constants are declared in the same way as variables, using the format: Const–Label EQU
012h
When the constants label is encountered, the constant numeric value is exchanged for the
string
Write a program to add a data byte located at offset 0500H in 2000H segment to
17 another data byte available at 0600H in the same segment and store the result at 2 CO5 U
0700H in the same segment.
MOV AX, 2000H; initialize DS with value
MOVDS, AX; 2000H
MOV AX, [500H]; Get first data byte from 0500H offset
ADD AX, [600H]; Add this to the second byte from 0600H
MOV [700H], AX; store AX in 0700H
HLT; Stop.
18 List the eight types of addressing modes of 8086 instruction set? 2 CO5 R
The different addressing modes are:
Immediate
Direct
Register
Register indirect
Indexed
Register relative
Based indexed
Relative based indexed
19 List the eight types of instructions in 8086 microprocessor? 2 CO5 R
The different types of instructions in 8086 microprocessor are:
Data copy / transfer instructions
Arithmetic and logical instructions
Branch instructions
Loop instruction
Machine control instruction
Flag manipulation instruction
Shift and rotate instruction
String instruction
20 What is assembly level programming? 2 CO5 R
A program called assembler is used to convert the mnemonics of instruction and data
into their equivalent object code modules.
The object code modules are further converted into executable code using linker and
loader programs.
This type of programming is called assembly level programming.
PART- B
Q.No Questions Marks CO BL
Explain the addressing modes of 8086 microprocessor in detail (or) Enumerate the
1 16 CO5 U
different types of 8086 addressing modes with examples.
The way of specifying data to be operated by an instruction is known as addressing
modes. This specifies that the given data is an immediate data or an address. It also
specifies whether the given operand is register or register pair.
Types of addressing modes:
Register mode – In this type of addressing mode both the operands are registers.
Example:
MOV AX, BX
XOR AX, DX
Immediate mode – In this type of addressing mode the source operand is a 8 bit or 16
bit data. Destination operand can never be immediate data.
Example:
MOV AX, 2000
MOV CL, 0A
Note that to initialize the value of segment register an register is required.
MOV AX, 2000
MOV CS, AX
Displacement or direct mode – In this type of addressing mode the effective address
is directly given in the instruction as displacement.
Example:
MOV AX, [DISP]
MOV AX, [0500]
Register indirect mode – In this addressing mode the effective address is in SI, DI or
BX.
Example: Physical Address = Segment Address + Effective Address
MOV AX, [DI]
ADD AL, [BX]
Based indexed mode – In this the effective address is sum of base register and index
register.
Base register: BX, BP
Index register: SI, DI
The physical memory address is calculated according to the base register.
Example:
MOV AL, [BP+SI]
MOV AX, [BX+DI]
Indexed mode – In this type of addressing mode the effective address is sum of index
register and displacement.
Example:
MOV AX, [SI+2000]
MOV AL, [DI+3000]
Based mode – In this the effective address is the sum of base register and
displacement.
Example:
MOV AL, [BP+ 0100]
Based indexed displacement mode – In this type of addressing mode the effective
address is the sum of index register, base register and displacement.
Example:
MOV AL, [SI+BP+2000]
String mode – This addressing mode is related to string instructions. In this the value
of SI and DI are auto incremented and decremented depending upon the value of
directional flag.
Example:
MOVS B
MOVS W
Input/Output mode – This addressing mode is related with input output operations.
Example:
IN A, 45
OUT A, 50
Relative mode –
In this the effective address is calculated with reference to instruction pointer.
Example:
JNZ 8 bit address
IP=IP+8 bit address
Explain the instruction set of 8086 microprocessor in detail (or) Enumerate the
2 16 CO5 U
different types of 8086 instruction set with examples.
The 8086 microprocessor supports 8 types of instructions −
Data Transfer Instructions
Arithmetic Instructions
Bit Manipulation Instructions
String Instructions
Program Execution Transfer Instructions (Branch & Loop Instructions)
Processor Control Instructions
Iteration Control Instructions
Interrupt Instructions
Data Transfer Instructions
These instructions are used to transfer the data from the source operand to the destination
operand. Following are the list of instructions under this group −
Instruction to transfer a word
MOV − Used to copy the byte or word from the provided source to the provided
destination.
PPUSH − Used to put a word at the top of the stack.
Instructions for input and output port transfer
IN − Used to read a byte or word from the provided port to the accumulator.
OUT − Used to send out a byte or word from the accumulator to the provided port.
Instructions to transfer the address
LEA − Used to load the address of operand into the provided register.
LDS − Used to load DS register and other provided register from the memory
Arithmetic Instructions
These instructions are used to perform arithmetic operations like addition, subtraction,
multiplication, division, etc.
Following is the list of instructions under this group −
Instructions to perform addition
ADD − Used to add the provided byte to byte/word to word.
ADC − Used to add with carry.
Instructions to perform subtraction
SUB − Used to subtract the byte from byte/word from word.
SBB − Used to perform subtraction with borrow.
Instruction to perform multiplication
MUL − Used to multiply unsigned byte by byte/word by word.
IMUL − Used to multiply signed byte by byte/word by word.
Instructions to perform division
DIV − Used to divide the unsigned word by byte or unsigned double word by word.
IDIV − Used to divide the signed word by byte or signed double word by word.
Bit Manipulation Instructions
These instructions are used to perform operations where data bits are involved, i.e.
operations like logical, shift, etc.
Following is the list of instructions under this group −
Instructions to perform logical operation
NOT − Used to invert each bit of a byte or word.
AND − Used for adding each bit in a byte/word with the corresponding bit in another
byte/word.
Instructions to perform shift operations
SHL/SAL − Used to shift bits of a byte/word towards left and put zero(S) in LSBs.
SHR − Used to shift bits of a byte/word towards the right and put zero(S) in MSBs.
String Instructions
String is a group of bytes/words and their memory is always allocated in a sequential order.
Following is the list of instructions under this group −
REP − Used to repeat the given instruction till CX ≠ 0.
REPE/REPZ − Used to repeat the given instruction until CX = 0 or zero flag ZF = 1.
Program Execution Transfer Instructions (Branch and Loop Instructions)
These instructions are used to transfer/branch the instructions during an execution. It
includes the following instructions −
Instructions to transfer the instruction during an execution without any condition −
CALL − Used to call a procedure and save their return address to the stack.
RET − Used to return from the procedure to the main program.
Processor Control Instructions
These instructions are used to control the processor action by setting/resetting the flag
values.
Following are the instructions under this group −
STC − Used to set carry flag CF to 1
CLC − Used to clear/reset carry flag CF to 0
Iteration Control Instructions
These instructions are used to execute the given instructions for number of times. Following
is the list of instructions under this group −
LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0
LOOPE/LOOPZ − Used to loop a group of instructions till it satisfies ZF = 1 & CX =
0.
Interrupt Instructions
These instructions are used to call the interrupt during program execution.
INT − Used to interrupt the program during execution and calling service specified.
INTO − Used to interrupt the program during execution if OF = 1.
Explain the Keyboard and Display interface of 8086 microprocessor in detail (or)
3 16 CO5 U
Summarize the interfacing of 8279 and microprocessor 8086 with neat diagram
8279 programmable keyboard/display controller is designed by Intel that interfaces a
keyboard with the CPU. The keyboard first scans the keyboard and identifies if any key has
been pressed.
The Keyboard can be interfaced either in the interrupt or the polled mode. In the Interrupt
mode, the processor is requested service only if any key is pressed, otherwise the CPU will
continue with its main task.
In the Polled mode, the CPU periodically reads an internal flag of 8279 to check whether
any key is pressed or not with key pressure.
The keyboard consists of maximum 64 keys, which are interfaced with the CPU by using
the key-codes. These key-codes are de-bounced and stored in an 8-byte FIFORAM,
which can be accessed by the CPU.
If a FIFO contains a valid key entry, then the CPU is interrupted in an interrupt mode
else the CPU checks the status in polling to read the entry.
I/O Control and Data Buffer
This unit controls the flow of data through the microprocessor.
It is enabled only when D is low. Its data buffer interfaces the external bus of the system
with the internal bus of the microprocessor.
The pins A0, RD, and WR are used for command, status or data read/write operations.
Control and Timing Register and Timing Control
This unit contains registers to store the keyboard, display modes, and other operations
as programmed by the CPU. The timing and control unit handles the timings for the
operation of the circuit.
Scan Counter
It has two modes i.e. Encoded mode and Decoded mode.
In the encoded mode, the counter provides the binary count that is to be externally
decoded to provide the scan lines for the keyboard and display.
In the decoded scan mode, the counter internally decodes the least significant 2 bits and
provides a decoded 1 out of 4 scan on SL0-SL3.
Return Buffers, Keyboard Debounce, and Control
This unit first scans the key closure row-wise, if found then the keyboard debounce unit
debounces the key entry. In case, the same key is detected, then the code of that key is
directly transferred to the sensor RAM along with SHIFT & CONTROL key status.
FIFO/Sensor RAM and Status Logic
This unit acts as 8-byte first-in-first-out (FIFO) RAM where the key code of every pressed
key is entered into the RAM as per their sequence. The status logic generates an
interrupt request after each FIFO read operation till the FIFO gets empty.
In the scanned sensor matrix mode, this unit acts as sensor RAM where its each row is
loaded with the status of their corresponding row of sensors into the matrix. When the
sensor changes its state, the IRQ line changes to high and interrupts the CPU.
Display Address Registers and Display RAM
This unit consists of display address registers which holds the addresses of the word
currently read/written by the CPU to/from the display RAM.
4 Explain the Programmable Peripheral interface of 8086 microprocessor in detail (or)
Summarize the interfacing of 8255 PPI and microprocessor 8086 with neat diagram 16 CO5 U
PPI 8255 is a general purpose programmable I/O device designed to interface the CPU
with its outside world such as ADC, DAC, keyboard etc.
It consists of three 8-bit bidirectional I/O ports i.e. PORT A, PORT B and PORT C.
Block diagram –
It consists of 40 pins and operates in +5V regulated power supply.
Port C is further divided into two 4-bit ports i.e. port C lower and port C upper and port
C can work in either BSR (bit set rest) mode or in mode 0 of input-output mode of
8255.
Port B can work in either mode 0 or in mode 1 of input-output mode. Port A can work
either in mode 0, mode 1 or mode 2 of input-output mode.
It has two control groups, control group A and control group B. Control group A consist
of port A and port C upper. Control group B consists of port C lower and port B.
CS’ A1 A0 Selection Address
0 0 0 PORT A 80 H
0 0 1 PORT B 81 H
0 1 0 PORT C 82 H
0 1 1 Control Register 83 H
1 X X No Seletion X
Pin diagram –
2. Input-Output mode –
If MSB of control word (D7) is 1, PPI works in input-output mode. This is further divided
into three modes:
Mode 0 –In this mode all the three ports (port A, B, C) can work as simple input
function or simple output function. In this mode there is no interrupt handling
capacity.
Mode 1 – Handshake I/O mode or strobed I/O mode. In this mode either port A
or port B can work as simple input port or simple output port, and port C bits are
used for handshake signals before actual data transmission.
Mode 2 – Bi-directional data bus mode. In this mode only port A works, and port B
can work either in mode 0 or mode 1. 6 bits port C are used as handshake signals.
It also has interrupt handling capacity.
5 Write a program in ALP to interface stepper motor to 8086 and rotate it in Clockwise
and anti-clockwise direction. 16 CO5 AP
Program: