All 21 questions UPSC has asked on PC organisation and CPU in the Electrical Engineering Optional (Paper II, Microprocessors and Microcomputers) from 2000 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Microprocessors and Microcomputers topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
- ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.
Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 2b(i) 2026 · 2b(ii) 2022 · 1c 2022 · 3c 2020 · 2c 2019 · 1e 2017 · 5b(ii) 2016 · 7b(i) 2015 · 2b 2015 · 4a(ii) 2014 · 1b(ii) 2014 · 7b 2013 · 1c(i) 2013 · 4b 2013 · 7b(i) 2009 · 1c 2007 · 2a 2006 · 4a 2003 · 3a 2002 · 3a 2000 · 7a
In the 8085 microprocessor, explain the functionality of the following pins, and describe the role of the instruction decoder, stack pointer and program counter. 1. READY 2. SID 3. SOD 4. INTR 5. CLK (OUT)
Solution
Pins
| Pin | Type | Function |
|---|---|---|
| READY | Input | Tells the 8085 whether a slow memory or I/O device is ready. The processor samples it in T2. If READY = 0, it inserts wait states () until READY = 1, so slow devices can be used. |
| SID | Input | Serial input data. The RIM instruction loads the bit on this pin into bit 7 of the accumulator. |
| SOD | Output | Serial output data. The SIM instruction sends bit 7 of the accumulator to this pin, if bit 6 (SDE) = 1. |
| INTR | Input | General-purpose maskable interrupt (lowest priority). It is sampled in the last T-state of each instruction. When it is accepted, the 8085 issues and reads a RST n or CALL from the interrupting device. It is enabled by EI and disabled by DI. |
| CLK (OUT) | Output | System clock, at half the crystal frequency (3 MHz for a 6 MHz crystal). Peripherals use it to stay in step with the processor. |
Instruction decoder. The opcode fetched in M1 is placed in the instruction register. The decoder interprets it and tells the timing and control unit how many machine cycles are needed and of what types (memory read, I/O write, and so on). The control unit then generates the signals for each T-state.
Stack pointer (SP). A 16-bit register that holds the address of the top of the stack, a LIFO area in R/W memory. PUSH and CALL first decrement SP and then store data; POP and RET read data and then increment SP. It is also used to save the return address during interrupts.
Program counter (PC). A 16-bit register that holds the address of the next byte to be fetched. After each fetch it is incremented. Jump, call, return and restart instructions load a new value into it, which changes the program sequence.
✓ Answer checked step by step Standard result (Intel 8085 data sheet).
For the instruction MVI B, 05H, draw the timing diagram, if the opcode is stored at 220AH and data at 220BH locations. Incorporate all the control and status signals involved in the operation during the execution. Assume the opcode is XXH.
Solution
Machine cycles. MVI B, 05H is a 2-byte instruction:
- M1, opcode fetch (4 T-states). The 8085 reads opcode XXH from 220AH.
- M2, memory read (3 T-states). It reads the data 05H from 220BH.
The total is 7 T-states, which is 2.33 µs at 3 MHz.
Signals in M1 (opcode fetch)
- T1: PC = 220AH goes out. A15–A8 = 22H; AD7–AD0 = 0AH. ALE goes high, and the falling edge latches 0AH into an external latch. IO/ = 0 (memory); S1 S0 = 11 (opcode fetch).
- T2: goes low and AD7–AD0 float. The memory places XXH on the bus. PC is incremented to 220BH.
- T3: the opcode is read into the instruction register, and returns high.
- T4: the opcode is decoded; the bus is idle (AD lines float).
Signals in M2 (memory read)
- T1: A15–A8 = 22H; AD7–AD0 = 0BH; ALE high. IO/ = 0; S1 S0 = 10.
- T2: low; the memory places 05H on AD7–AD0.
- T3: 05H is loaded into register B, and goes high.
stays high throughout, because there is no write operation.
✓ Checked by computer We checked the machine cycles and T-states against the 8085 instruction table.
Show an instruction cycle with possible machine cycles and clock cycles (T-states) in it, for the microprocessor 8085. If the processor is working at 3 MHz, calculate the minimum and maximum possible execution time for an instruction.
Solution
Instruction cycle. An instruction cycle is the time to fetch and execute one instruction. It is made of 1 to 5 machine cycles (M1 … M5), and each machine cycle is made of 3 to 6 T-states (clock periods).
- M1 is always an opcode fetch (4 or 6 T-states).
- The others are memory read/write or I/O read/write (3 T-states each), or bus idle.
The figure shows LDA 2050H as an example: M1 fetches the opcode, M2 and M3 read the address bytes 50H and 20H, and M4 reads the data. That is 4 machine cycles and 4 + 3 + 3 + 3 = 13 T-states.
Execution time at 3 MHz. One T-state is
Minimum: 4 T-states, one opcode fetch only (for example
MOV C,AorADD B):Maximum: 18 T-states.
CALL addrtakes 5 machine cycles, 6 + 3 + 3 + 3 + 3 T-states (opcode fetch, two memory reads, two memory writes of the return address):
These ignore wait states. With READY held low, each wait state adds 0.333 µs.
✓ Checked by computer We computed the times from the T-state counts in Python.
(i) Explain the use of MAR in interfacing the external memory to processor. (ii) Name various 8-bit and 16-bit internal registers in microprocessor 8085 and also, indicate which 8-bit registers can be paired to act as 16-bit register in several instructions.
Solution
(i) MAR in memory interfacing
The memory address register (MAR) holds the address of the memory location being accessed, so that the address stays stable on the address bus for the whole read or write cycle.
In the 8085, this role is played by the address latch and buffers. The lower byte comes out on the multiplexed AD7–AD0 lines only in T1. So an external latch (such as the 74LS373), strobed by ALE, captures A7–A0, while A15–A8 come from the address buffer. Together they act as the MAR for the memory chips.
- The memory decodes the MAR contents (chip select from the high-order bits; the word inside the chip from the low-order bits).
- Data then moves through the data buffer (the memory buffer register, MBR).
- Without this latch, the memory would lose the low-order address when AD7–AD0 switch over to carrying data in T2.
(ii) Registers of the 8085
- 8-bit registers:
- accumulator A;
- general-purpose registers B, C, D, E, H, L;
- flag register F (S, Z, AC, P, CY);
- instruction register and temporary register (not accessible to the programmer).
- 16-bit registers: program counter (PC), stack pointer (SP), and the incrementer/decrementer address latch.
- Register pairs that act as 16-bit registers in instructions such as
LXI,INX,DCX,DAD,PUSHandPOP:- BC (B high, C low);
- DE (D high, E low);
- HL (H high, L low). HL is also the memory pointer M.
- PSW = A + flags, used with
PUSH PSWandPOP PSW.
✓ Answer checked step by step Standard result.
(i) Name various registers in 8085 microprocessor. Which of these registers are of 16-bit length? (ii) Explain indirect addressing modes in 8085 microprocessor with suitable example.
Solution
(i) Registers of the 8085
- Accumulator (A), 8-bit. It is one operand of every arithmetic and logic operation and receives the result.
- General-purpose registers B, C, D, E, H, L, 8-bit. They pair as BC, DE and HL for 16-bit operations. HL is the memory pointer.
- Flag register, 8-bit. It holds five flags: S, Z, AC, P, CY.
- Program counter (PC), 16-bit.
- Stack pointer (SP), 16-bit.
- Internal registers: instruction register (8-bit), temporary register (8-bit), and the incrementer/decrementer address latch (16-bit).
The 16-bit registers are PC and SP (and the address latch), plus the register pairs BC, DE and HL when used as pairs.
(ii) Indirect addressing in the 8085. The instruction does not hold the operand or its address. It names a register pair that holds the address of the operand in memory.
Example 1: MOV A, M with HL = 2050H copies the byte at memory 2050H into A.
Example 2: LDAX B with BC = 3000H loads A from 3000H. STAX D stores A at the address held in DE.
Other register-indirect instructions include MVI M, data, ADD M, INR M and MOV M, r.
The advantage is that the same instruction can work through a table or array. A loop increments HL with INX H and repeats the same instruction for each element.
✓ Answer checked step by step Standard result.
Explain the function of the following signals in 8085 microprocessor: (i) ALE (ii) (iii) (iv)
Solution
- (i) ALE (Address Latch Enable). An output that goes high during T1 of every machine cycle. While it is high, AD7–AD0 carry the low-order address A7–A0. Its falling edge is used to latch this byte into an external latch, so that AD7–AD0 are then free to carry data.
- (ii) (Read). An active-low output. When low, it tells the selected memory or I/O device to place data on the data bus. The device must put valid data on the bus before goes high, because the 8085 reads it on the rising edge.
- (iii) (Write). An active-low output. When low, it shows that the data on the data bus is valid and should be written into the selected memory location or output device. The device latches the data on the rising edge.
- (iv) IO/. A status output. IO/ = 1 means the address is for an I/O port; IO/ = 0 means a memory operation. It is combined with and to make the four control signals:
- (IO/ = 0, = 0)
- (IO/ = 0, = 0)
- (IO/ = 1, = 0)
- (IO/ = 1, = 0)
✓ Answer checked step by step Standard result.
What is a jump-on-reset circuit in a processor?
Solution
At reset, a processor starts at a fixed address: the 8085 at 0000H. If that region of memory is RAM, or if the monitor program sits in ROM at a high address, the processor must still find a jump there.
A jump-on-reset circuit forces a jump to the start of the monitor or boot program, whatever is in memory at 0000H.
How it works:
- After RESET, a small counter counts the first three memory-read () cycles.
- While the count is below 3, it disables the memory chip select and enables a tri-state buffer.
- The buffer places the 3-byte instruction
JMP addron the data bus: C3H, then the low and high bytes of the target address. - The processor executes this jump, so the PC is loaded with the boot address.
- After the third read, the counter stops, the buffer is disabled, and normal memory decoding takes over.
The same idea lets RAM occupy the low addresses (where the interrupt vectors are) while the system still boots from ROM placed elsewhere.
✓ Answer checked step by step Standard result.
Assume that the accumulator contains data byte 82H and the instruction MOV C, A (4FH) is fetched. List the steps in decoding and executing the instruction.
Solution
MOV C, A (opcode 4FH) is a 1-byte, 1-machine-cycle instruction of 4 T-states. The steps are:
- T1: the PC (say 2000H) is placed on the address bus: A15–A8 = 20H and AD7–AD0 = 00H. ALE goes high, so the low byte is latched. IO/ = 0 and S1 S0 = 11 (opcode fetch).
- T2: goes low. The memory places 4FH on the data bus, and PC is incremented to 2001H.
- T3: 4FH enters the instruction register, and goes high.
- T4: the instruction decoder recognises 4FH as “copy A into C”. The contents of A (82H) are moved to the temporary register and then into register C.
Result: C = 82H; A is still 82H. No flags are affected. The next fetch is from 2001H.
At 3 MHz the instruction takes s.
✓ Answer checked step by step Standard result.
What is pipelining? Explain how it improves the performance of a processor. Discuss how BRANCH like instructions can be handled in a pipelined system. A machine language program has instructions, each having parts. Suppose each part can be executed in one cycle and there is no BRANCH like instruction in the program. How much time does a processor (i) with pipelining and (ii) without pipelining take to execute the program?
Solution
Pipelining. The execution of an instruction is split into stages, for example fetch, decode, execute and write back. Each stage has its own hardware and works on a different instruction in the same clock cycle, like an assembly line. Each instruction still takes cycles, but once the pipeline is full, one instruction finishes every cycle.
How it improves performance
- The throughput rises by a factor of up to .
- The hardware of every stage is kept busy.
- The clock period can be short, because each stage does only a small part of the work.
Branch instructions. A branch is resolved only in a late stage, so the instructions already fetched after it may be the wrong ones (a control hazard). They are handled by:
- Stalling (flushing) the pipeline until the target is known. This is simple, but costs cycles per branch.
- Branch prediction. Static prediction (for example, “backward taken, forward not taken”) or dynamic prediction (a branch history table). Wrongly fetched instructions are flushed only on a misprediction.
- Delayed branch. The compiler fills the slots after the branch with useful instructions that execute whatever the outcome.
- Branch target buffer and prefetching both paths. These fetch the target early.
Timing for instructions of parts, one cycle per part, no branch
(i) With pipelining. The first instruction needs cycles to fill the pipeline, and each of the remaining finishes one cycle later:
(ii) Without pipelining. Each instruction takes cycles one after another:
Speed-up For example, and give 103 cycles against 400, a speed-up of 3.88.
✓ Checked by computer We simulated the pipeline in Python and checked the cycle counts.
Discuss the role and purpose of the three buses—address, data and control. Explain how they connect microprocessor CPU to ROM, RAM and I/O for data transfer.
Solution
The CPU talks to memory and I/O over three groups of lines.
Address bus (16 lines, A15–A0, in the 8085)
- It is unidirectional, from the CPU outwards.
- It carries the address of the memory location or I/O port to be accessed. 16 lines address (64 K) memory locations; I/O ports use 8 bits (256 ports).
- The high-order bits go to a decoder, which produces the chip-select of the ROM, RAM or I/O chip. The low-order bits select the location inside that chip.
Data bus (8 lines, D7–D0)
- It is bidirectional.
- It carries instructions and data:
- from memory or an input port to the CPU, in a read;
- from the CPU to RAM or an output port, in a write.
- Tri-state buffers let only the selected device drive the bus.
Control bus
- It carries timing and control signals that say what kind of transfer is happening and when: , , IO/, ALE, READY, HOLD/HLDA, INTR/, RESET.
- It is decoded into , , and .
Transfers
- ROM: read only. The CPU sends the address and asserts , and the ROM drives the data bus.
- RAM:
- read with ;
- write with : the CPU drives the data bus and the RAM stores it.
- I/O ports: reached with
IN/OUTand / (I/O-mapped). Alternatively, they are treated as memory locations with / (memory-mapped I/O).
In each transfer, the address selects which device, the control signal decides when and in which direction, and the data bus carries the byte.
✓ Answer checked step by step Standard result.
Specify multiplexed and non-multiplexed bus lines in 8085 microprocessor.
Solution
- Multiplexed: AD7–AD0. They carry the low-order address A7–A0 in T1 of each machine cycle, while ALE is high, and data D7–D0 for the rest of the cycle. They are demultiplexed with a latch strobed by ALE.
- Non-multiplexed: A15–A8. These carry only the high-order address, for the whole machine cycle.
The control and status lines are also non-multiplexed:
- ALE, , , IO/, S1, S0;
- READY, HOLD, HLDA;
- the interrupt lines, SID and SOD.
Multiplexing saves 8 pins on the 40-pin package.
✓ Answer checked step by step Standard result.
Explain hardware single stepping used in 8085 microprocessor.
Solution
Purpose. Hardware single stepping lets a user run a program one machine cycle (or one instruction) at a time, and watch the address, data and status lines (for example, on LEDs) after each step. It is a debugging aid for new hardware and software, used in trainer kits.
Principle: the READY line. The 8085 samples READY in T2 of every machine cycle. If READY = 0, it enters wait states () and holds the address, data and control lines steady. So, by keeping READY low and releasing it for a short time on each key press, the processor is made to advance one machine cycle per press.
Circuit and operation
- ALE clears the flip-flop. ALE goes high at the start of every machine cycle and clears a D (or S-R) flip-flop, so its output READY = 0.
- The processor waits. In T2 the 8085 sees READY = 0 and stays in wait states. The bus shows the address (and, in a write, the data) of the current cycle.
- A key press sets the flip-flop. The STEP key, through a debounce latch and an edge pulse, sets the flip-flop. READY = 1 and the machine cycle completes.
- The cycle repeats. The next ALE clears the flip-flop again, and the processor stops in the next machine cycle.
- RUN mode. A RUN/STEP switch, ORed into READY, holds READY = 1 permanently for normal running.
If the flip-flop is cleared only at the opcode fetch (decode S1 = S0 = 1 with ALE), each press executes one whole instruction instead of one machine cycle.
Software single stepping (by RST 7.5 or TRAP after each instruction) is the alternative used in monitors; the hardware method needs no program support.
✓ Answer checked step by step Standard result.
Draw the block diagram indicating the typical architecture of a microcomputer. Briefly discuss the salient features.
Solution
Units
- Microprocessor (CPU). It contains the ALU, the registers and the timing and control unit. It fetches instructions from memory, decodes and executes them, and controls all the other units.
- Memory:
- ROM/EPROM holds the permanent program (the monitor or boot code);
- R/W memory (RAM) holds user programs, data and the stack.
- Input/output: ports or interface chips (8255, 8251, 8279) connect keyboards, switches, displays, printers and A/D or D/A converters to the system.
- System bus: the address, data and control buses join all the units.
Salient features
- A single chip CPU makes a small, low-cost, low-power computer.
- It is a stored-program machine: changing the program changes its function.
- It has a bus-oriented structure. Every unit shares the same buses, and tri-state outputs let only the addressed unit drive the data bus. New memory or I/O is added simply by decoding new addresses.
- Memory-mapped or I/O-mapped peripherals can be used.
- It supports interrupts and DMA (HOLD/HLDA) for fast I/O.
✓ Answer checked step by step Standard result.
Draw the timing diagram for memory read cycle and memory write cycle and explain the significance of the time periods therein.
Solution
Memory read cycle (3 T-states)
- T1: the address is sent out: A15–A8 on the high-order bus, and A7–A0 on AD7–AD0. ALE latches the low byte, and IO/ = 0.
- T2: goes low and AD7–AD0 float. The memory now drives the bus.
- T3: the data is read on the rising edge of .
Memory write cycle
- T1: the same as in the read cycle.
- T2: the CPU places the data on AD7–AD0 and takes low.
- T3: the memory stores the data when rises. The data is held a little after this.
Significance of the time periods. The values below are 8085A data-sheet figures at = 320 ns.
| Symbol | Meaning | Value | Why it matters |
|---|---|---|---|
| Clock period (one T-state) | ≥ 320 ns | Sets the speed of every cycle | |
| Address valid to ALE low | ≥ 110 ns | The latch must see a stable address before it closes | |
| ALE pulse width | ≥ 140 ns | The latch needs a minimum strobe width | |
| Address hold after ALE low | ≥ 100 ns | Lets the latch capture A7–A0 reliably | |
| Address valid to valid input data | ≤ 575 ns | Memory access time must be less than this (allowing for decoding delays), otherwise wait states are needed | |
| low to valid input data | ≤ 300 ns | The output-enable time of the memory must be within this | |
| Data hold after high | ≥ 0 | The memory may release the bus as soon as rises | |
| Data valid to trailing edge of | ≥ 420 ns | Set-up time for writing into the memory | |
| Data hold after high | ≥ 100 ns | Hold time for the write |
If a memory is too slow to meet and , it pulls READY low and the 8085 adds wait states (one each) between T2 and T3.
✓ Answer checked step by step Standard result (8085A data sheet values).
List the features of 8086’s segmented memory.
Solution
The 8086 has a 20-bit address bus, which addresses 1 MB, but 16-bit registers. Its memory is therefore divided into segments.
Segment size and alignment. Each segment is a block of up to 64 KB of contiguous memory. It starts at an address that is a multiple of 16 (a paragraph boundary).
Four active segments. These are code (CS), data (DS), stack (SS) and extra (ES), each named by a 16-bit segment register. At any time, 4 × 64 KB = 256 KB can be reached directly.
Physical address. It is formed as For example, DS = 2000H and offset 0350H give PA = 20350H. The offset comes from IP, SP, BP, SI, DI, BX or the instruction (the effective address).
Default pairings:
- CS:IP for instructions;
- SS:SP and SS:BP for the stack;
- DS with BX, SI, DI and displacements for data;
- ES:DI for the string destination.
A segment-override prefix can change the segment for data.
Segments can overlap or be separate. A small program may put all four in the same 64 KB.
Relocatable code. Programs use offsets only, so a program can be moved anywhere in memory by changing just the segment registers.
Separation and protection. Code, data and stack are kept apart, which makes programs easier to organise and debug, and allows multitasking by switching segment registers.
16-bit pointers. Offsets fit in 16-bit registers, which keeps instructions short.
✓ Answer checked step by step Standard result.
The instruction OUT FFH of 8085 is stored from memory location 4048 H. The opcode for OUT instruction is D3H. Draw and explain the timing diagram for the execution of this instruction giving timings for signals like ALE, Address lines, data lines and memory.
Solution
OUT FFH is a 2-byte instruction: opcode D3H at 4048H and port address FFH at 4049H. It takes 3 machine cycles and 10 T-states:
- M1, opcode fetch (4 T)
- M2, memory read of the port address (3 T)
- M3, I/O write (3 T)
At 3 MHz ( = 333 ns) this is 3.33 µs.
M1, opcode fetch (0 – 1.33 µs)
- T1: A15–A8 = 40H and AD7–AD0 = 48H. ALE is high for about half a T-state, to latch 48H. IO/ = 0; S1 S0 = 11.
- T2–T3: is low. The memory returns D3H on AD7–AD0, and PC becomes 4049H.
- T4: the opcode is decoded; the bus floats.
M2, memory read (1.33 – 2.33 µs)
- T1: address 4049H: A15–A8 = 40H and AD7–AD0 = 49H. ALE is high; S1 S0 = 10.
- T2–T3: is low and the memory returns FFH (the port address). It is placed in the temporary register (W and Z both get FFH).
M3, I/O write (2.33 – 3.33 µs)
- T1: IO/ goes high, and S1 S0 = 01. The 8-bit port address FFH appears on both A15–A8 and AD7–AD0. ALE latches it.
- T2: the contents of the accumulator are put on AD7–AD0, and goes low.
- T3: goes high. The output port (decoded as with address FFH) latches the data on this edge.
stays high in M3, and is high in M1 and M2.
✓ Checked by computer We checked the machine cycles and T-states against the 8085 instruction table; times are for a 3 MHz clock.
What is the difference between a microcomputer and a micro-process? What type of data is stored in the memory of a microcomputer? How much memories can a typical 8-bit micro-process access? What are the condition flags and why are they important? Write the advantage of the indexed address mode compared to the direct addressing mode. Draw the time diagram of out instruction for 8085 micro-process.
Solution
Microcomputer and microprocessor. A microprocessor is only the CPU on a single chip: ALU, registers, and timing and control. It cannot work alone. A microcomputer is a complete computer built around a microprocessor: CPU + memory (ROM, RAM) + I/O ports, joined by the system buses. (A microcontroller puts all of these on one chip.)
Data in memory. The memory stores:
- binary words that are either instructions (opcodes and operands of the program);
- data: numbers, characters (ASCII), addresses, and the stack.
The memory itself does not distinguish them. A byte is treated as an instruction when it is fetched in an opcode-fetch cycle.
Memory of an 8-bit microprocessor. A typical 8-bit microprocessor such as the 8085 has a 16-bit address bus, so it can access = 65,536 bytes (64 KB) of memory.
Condition flags. These are flip-flops set or reset by the result of arithmetic or logic operations. In the 8085 they are:
- S (sign);
- Z (zero);
- AC (auxiliary carry);
- P (parity);
- CY (carry).
They matter because conditional jumps, calls and returns (JZ, JC, JNZ, CP …) test them. That is how the program makes decisions, runs loops and does multi-byte arithmetic.
Indexed addressing compared with direct addressing. In direct addressing, the full address is a fixed part of the instruction (LDA 2050H), so reaching another element needs a different instruction. In indexed addressing, the effective address is a base plus the contents of an index register. So:
- the same instruction, inside a loop, can step through a whole table or array just by incrementing the index register;
- programs are shorter and can be relocated;
- the instruction can be shorter, since only a small displacement is stored.
Timing diagram of the OUT instruction. OUT port takes opcode fetch (4T), memory read of the port address (3T), then I/O write (3T). The figure is drawn for OUT FFH stored at 4048H.
In the I/O write cycle, IO/ = 1. The 8-bit port address appears on both A15–A8 and AD7–AD0. The accumulator contents go out on the data bus while is low.
✓ Answer checked step by step Standard result.
Differentiate between Instruction Cycle (IC) and Machine Cycle (MC), Explain all the basic Machine Cycles of 8085 microprocessor. Explain difference between a FETCH cycle and an INTA signal.
Solution
Instruction cycle and machine cycle
| Instruction cycle (IC) | Machine cycle (MC) |
|---|---|
| Time to fetch and execute one complete instruction | Time to complete one operation of accessing memory or I/O (or one internal operation) |
| Consists of 1 to 5 machine cycles | Consists of 3 to 6 T-states |
Example: LDA 2050H = 4 MCs = 13 T |
Example: memory read = 3 T |
Basic machine cycles of the 8085
| Machine cycle | IO/ | S1 S0 | Control | T-states |
|---|---|---|---|---|
| Opcode fetch | 0 | 1 1 | = 0 | 4 or 6 |
| Memory read | 0 | 1 0 | = 0 | 3 |
| Memory write | 0 | 0 1 | = 0 | 3 |
| I/O read | 1 | 1 0 | = 0 | 3 |
| I/O write | 1 | 0 1 | = 0 | 3 |
| Interrupt acknowledge | 1 | 1 1 | = 0 | 6 or 3 |
| Bus idle | – | – | none | 3 (for example in DAD) |
| Halt | Z | 0 0 | – | – |
| Hold | Z | X X | – | – |
- Opcode fetch: the opcode is read from the address in PC and decoded in T4 (T5–T6 for some instructions).
- Memory read / I/O read: a byte (data or address) is read from memory or an input port.
- Memory write / I/O write: a byte is written to memory or an output port.
- Interrupt acknowledge: a response to INTR. The processor reads a
RSTorCALLopcode from the interrupting device. - Bus idle: an internal operation with no bus transfer.
FETCH cycle and
- Same: both read an opcode, and in both S1 S0 = 11. The interrupt-acknowledge cycle is in fact an opcode fetch that the 8085 performs in response to INTR.
- Different:
- In a normal FETCH, IO/ = 0 and is used. The opcode comes from memory, at the address in PC, and PC is incremented.
- In the cycle, IO/ = 1 and is asserted instead of . The opcode (usually
RST n) is supplied by the interrupting device / interrupt controller, not memory, and PC is not incremented. The address on the bus is ignored.
✓ Answer checked step by step Standard result.
Discuss briefly the architecture of 8086 microprocessor with special reference to the following (i) Memory organization (ii) Register structure (iii) Addressing modes.
Solution
The 8086 is a 16-bit processor with a 20-bit address bus (1 MB) and a 16-bit data bus. It is divided into a bus interface unit (BIU) and an execution unit (EU), which work in parallel: the BIU prefetches up to 6 instruction bytes into a queue while the EU executes. This is a simple form of pipelining.
(i) Memory organisation
1 MB, byte-addressable, 00000H–FFFFFH.
Two banks for the 16-bit data bus:
- the even bank on D7–D0, selected by A0 = 0;
- the odd bank on D15–D8, selected by = 0.
A word at an even address is transferred in one bus cycle; at an odd address it needs two.
Segmentation: four 64 KB segments (code, data, stack, extra) are addressed through CS, DS, SS and ES. The physical address is
Reserved areas: 00000H–003FFH holds the interrupt vector table (256 × 4 bytes). FFFF0H is the reset address (CS = FFFFH, IP = 0000H).
(ii) Register structure (all 16-bit)
- General purpose: AX (accumulator), BX (base), CX (count), DX (data). Each splits into 8-bit halves: AH/AL, BH/BL, CH/CL, DH/DL.
- Pointer and index: SP (stack pointer), BP (base pointer), SI (source index), DI (destination index).
- Segment: CS, DS, SS, ES.
- Instruction pointer: IP.
- Flag register: 9 flags.
- 6 status flags: CF, PF, AF, ZF, SF, OF.
- 3 control flags: TF (trap/single step), IF (interrupt enable), DF (string direction).
(iii) Addressing modes
| Mode | Example | Operand |
|---|---|---|
| Immediate | MOV AX, 1234H |
data in the instruction |
| Register | MOV AX, BX |
in a register |
| Direct | MOV AX, [5000H] |
at DS:5000H |
| Register indirect | MOV AX, [BX] |
at DS:BX (also SI, DI) |
| Based | MOV AX, [BX+08H] |
DS:(BX + disp); with BP, SS is the segment |
| Indexed | MOV AX, [SI+10H] |
DS:(SI + disp) |
| Based indexed | MOV AX, [BX+SI] |
DS:(BX + SI) |
| Based indexed with displacement | MOV AX, [BX+DI+20H] |
DS:(BX + DI + disp) |
| String | MOVSB |
DS:SI → ES:DI, with auto increment/decrement by DF |
| I/O port | IN AL, 80H / IN AL, DX |
direct or DX-indirect port |
| Relative (branch) | JNZ label |
IP + 8/16-bit displacement |
✓ Answer checked step by step Standard result.
Discuss briefly the microprocessor architecture with special reference to the following components- (i) Data bus, (ii) Address bus and (iii) Control bus.
Solution
A microprocessor system is bus-organised: the CPU and every memory and I/O chip hang on three common groups of lines.
(i) Data bus
- Width: 8 lines in the 8085 (D7–D0, multiplexed with A7–A0); 16 in the 8086.
- Bidirectional. It carries instructions, data and port data:
- into the CPU (memory or I/O read);
- out of the CPU (write).
- Word length. Its width fixes the word length of the processor: 8-bit data handled at a time.
- Tri-state outputs on all devices, so that only the one selected device drives it.
(ii) Address bus
- Width: 16 lines in the 8085 (A15–A0), so it can address = 64 K locations. The 8086 has 20 lines (1 MB).
- Unidirectional, from the CPU. It identifies the memory location or I/O port (8-bit port address, 256 ports) for each transfer.
- Decoding:
- the high-order lines are decoded to produce chip-select signals;
- the low-order lines select a location within a chip.
(iii) Control bus
- Not a bus of identical lines but a group of individual timing and status signals:
- , , IO/, ALE, S0, S1;
- READY, HOLD/HLDA, INTR/;
- RESET IN/OUT, CLK OUT.
- Purpose: these signals identify the type of operation and synchronise the transfer. They also allow slow devices (READY), DMA (HOLD) and interrupts.
- Derived signals: , , and are produced from these and go to the memory and I/O chips.
✓ Answer checked step by step Standard result.
Discuss the functions of various Registers and ALU of 8085.
Solution
Registers
Accumulator (A), 8-bit.
- It holds one operand of every arithmetic and logic operation, and the result.
- It is used by
IN/OUT,LDA/STA, rotate instructions, andRIM/SIM.
Temporary register, 8-bit, not programmable. It holds the second operand for the ALU.
General-purpose registers B, C, D, E, H, L, 8-bit.
- They store data and intermediate results.
- They pair as BC, DE and HL for 16-bit data and addresses.
- HL is the memory pointer (M), used for indirect addressing.
Flag register. Five flip-flops set by the ALU result:
- S: sign, bit 7 of the result.
- Z: zero.
- AC: auxiliary carry from bit 3, used by
DAA. - P: even parity.
- CY: carry or borrow.
Conditional jumps, calls and returns test them. Together with A, they form the PSW.
Program counter (PC), 16-bit. It holds the address of the next instruction byte and increments after each fetch. Jumps and calls load it.
Stack pointer (SP), 16-bit. It points to the top of the stack in RAM. It is used by
PUSH/POP,CALL/RETand interrupts.Instruction register and decoder. These hold and decode the current opcode for the timing and control unit.
Incrementer/decrementer address latch. It increments or decrements PC, SP and the register pairs, and drives the address buffer.
ALU (arithmetic and logic unit)
- It performs 8-bit:
- addition and subtraction (with or without carry);
- increment and decrement;
- AND, OR, XOR;
- compare, complement and rotate;
- decimal adjust.
- Its inputs come from the accumulator and the temporary register. The result goes back to the accumulator (or a register), and the flags are updated.
- 16-bit addition (
DAD) is done in two 8-bit steps.
✓ Answer checked step by step Standard result.
More on Microprocessors and Microcomputers
- All Electrical Engineering PYQ solutions, topic by topic
- Microprocessors and Microcomputers topic-wise PYQs (questions only, for practice)
- Electrical Engineering PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Electrical Engineering booklist
Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper II, 2000–2026. Solutions: Optional Province. Found an error? Tell us.

