- 2075 Baisakh · 5 marks
Address decoding for 8 LEDs output port
Short answer
For an 8085 output port at ABH, decode A7-A0 with inverters and an 8-input NAND so SEL is active only for ABH. Use a 74LS374 latch enabled by SEL and IOW to drive eight LEDs through resistors. Program: MVI A,0FFH; OUT 0ABH.
Design the address decoding interface of an output port consisting of 8 LEDs with port address ABH.
Assumptions: 8085 system with I/O-mapped I/O (an 8086 system is the same, with M/IO' = 0). Port address ABH = 1010 1011 B, decoded uniquely using all 8 address lines A7–A0. An 8-bit latch 74LS374 (octal D flip-flop; a 74LS373 transparent latch can also be used) holds the data, and 8 LEDs with current-limiting resistors are connected to its outputs.
Decoding logic
- A7 A6 A5 A4 A3 A2 A1 A0 = 1 0 1 0 1 0 1 1.
- Lines that must be 0 (A6, A4, A2) pass through inverters; an 8-input NAND gives SEL' = 0 only for address ABH.
- The write pulse IOW' = WR' OR (NOT IO/M') is formed. IO/M' is 1 for I/O, so it is inverted first; IOW' is then low only for an I/O write.
- The latch is enabled when both are active. With a positive-edge latch (74LS374) the clock is CLK = SEL' OR IOW'; the data is latched when IOW' returns high. With a transparent latch (74LS373), G = SEL AND IOW (active high).
A7 ---------------------------+
A6 --o>o---------------------+|
A5 ---------------------------+|
A4 --o>o---------------------+ |--[8-input NAND]--SEL'--+
A3 ---------------------------+| |
A2 --o>o---------------------+ | [OR]-> CLK
A1 ---------------------------+| |
A0 ---------------------------+ IOW' --+
(WR' + NOT IO/M')
D0-D7 ---------> [74LS374 latch] -> Q0-Q7 -> 330 ohm -> LED -> GND
(OE' = 0)
An LED turns ON for logic 1 (use a driver such as 74LS244/ULN2803 if the latch cannot supply the LED current directly).
Address check
| Line | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 |
|---|---|---|---|---|---|---|---|---|
| Required level | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
| Applied to NAND | A7 | A6' | A5 | A4' | A3 | A2' | A1 | A0 |
Only the address ABH makes all NAND inputs 1, so SEL' = 0 for ABH alone (unique decoding).
Program to turn on all LEDs / alternate LEDs
MVI A,0FFH ; all LEDs ON
OUT 0ABH ; send to port ABH
MVI A,55H ; alternate LEDs ON
OUT 0ABH
HLT
8086 version: MOV AL,0FFH then OUT 0ABH,AL.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Address decoding for input and output ports · Microprocessor, chapter 4
- Address decoding for input port at 8050H · Microprocessor, chapter 4
- Address decoding for two 8 KB RAM at C000H · Microprocessor, chapter 4
- Address decoding with PROM decoder · Microprocessor, chapter 4
- Interface two 8K x 8 ROM at 4000H · Microprocessor, chapter 4
- Unique/non-unique decoding, memory mapped I/O · Microprocessor, chapter 4
- Blink 8 LEDs at port 2 · Embedded System, chapter 9 · asked 2×
- ADC at 80H with 8255A: display on port B LEDs · Instrumentation II, chapter 2
- Input/output interface unit design factors · Instrumentation II, chapter 7
- Unique vs non-unique address decoding · Instrumentation II, chapter 2