0% found this document useful (0 votes)
3 views14 pages

Microprocessor Q&A

The document contains a series of questions and answers related to microprocessors, specifically focusing on the 8085 microprocessor. It covers topics such as memory addressing, instruction functions, assembly language programming, and comparisons between different types of instructions and languages. Additionally, it includes assembly language program examples for various operations and a mock test with answers.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

Microprocessor Q&A

The document contains a series of questions and answers related to microprocessors, specifically focusing on the 8085 microprocessor. It covers topics such as memory addressing, instruction functions, assembly language programming, and comparisons between different types of instructions and languages. Additionally, it includes assembly language program examples for various operations and a mock test with answers.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Questions & Answers (Microprocessor)

1. How many address lines are necessary to address 2 MB of memory?


Answer:
2 MB = 2 × 1024 × 1024 = 2²¹ bytes.
Therefore, 21 address lines are required.
2. What are the functions of Program Counter and Stack Pointer?
Answer:
• Program Counter (PC): Stores the address of the next instruction to be executed.

• Stack Pointer (SP): Stores the address of the top of the stack memory.
3. What are Carry and Auxiliary Carry flags?
Answer:
• Carry Flag (CY): Set when a carry is generated from the most significant bit during
addition or a borrow occurs during subtraction.

• Auxiliary Carry Flag (AC): Set when a carry is generated from bit D3 to D4.
4. Illustrate SIM instruction.
Answer:
SIM (Set Interrupt Mask) is used to:
• Mask/unmask RST 5.5, RST 6.5, and RST 7.5 interrupts.

• Control serial output data (SOD).


5. List the 16-bit registers in 8085.
Answer:
The 16-bit registers are:
• Program Counter (PC)

• Stack Pointer (SP)

• Register pairs BC, DE, and HL


6. What is the function of PUSH and POP instructions?
Answer:
• PUSH: Stores data from a register pair onto the stack.
• POP: Retrieves data from the stack into a register pair.
7. How many address lines are in a 4096 × 8 EPROM chip?
Answer:
4096 = 2¹² memory locations.
Therefore, 12 address lines are required.
8. What are the advantages of Assembly Language compared to High-Level Languages?
Answer:
• Faster execution speed.

• Efficient memory utilization.

• Direct hardware control.

• Easier optimization of programs.


9. Explain the difference between a Microprocessor and a Microcomputer.
Answer:

Microprocessor Microcomputer
CPU on a single chip Complete computer system

Requires external memory and I/O devices Includes CPU, memory, and I/O

Example: 8085 Example: Personal Computer

10. Why are the Program Counter and Stack Pointer 16-bit registers?
Answer:
Because the 8085 can address 64 KB (2¹⁶ bytes) of memory. Hence, 16 bits are needed to store
memory addresses.
11. The last address of a 1 KB memory chip is FBFFH. Specify the starting address.
Answer:
1 KB = 1024 bytes = 400H locations.
Starting Address = FBFFH − 3FFH = F800H
12. If the machine code is fetched from location 205FH, what will be the contents of the Program
Counter?
Answer:
After fetching, the PC points to the next memory location.
PC = 2060H
13. If the clock frequency is 5 MHz, how much time is required for 18 T-states?
Answer:
Clock period = 1 / 5 MHz = 0.2 μs
Execution time = 18 × 0.2 μs = 3.6 μs
̅ signals.
14. Explain the functions of ALE and IO/M
Answer:
• ALE (Address Latch Enable): Separates address and data from multiplexed AD0–AD7
lines.

• ̅ : Distinguishes memory operation (IO/M


IO/M ̅ = 0) from I/O operation (IO/M
̅ = 1).

15. Compare CALL and JMP instructions.


Answer:

CALL JMP
Transfers control to subroutine Transfers control to another program location
Return address is stored on stack No return address stored
Returns using RET instruction No automatic return

16. Distinguish between High-Level and Low-Level Languages.


Answer:

High-Level Language Low-Level Language


Easy to understand Difficult to understand
Machine independent Machine dependent
Requires compiler/interpreter Requires assembler

17. What is a Tri-State Buffer?


Answer:
A tri-state buffer has three output states:
1. Logic 0
2. Logic 1
3. High Impedance (Z)
It allows multiple devices to share a common bus.
18. Write the function of HOLD signal in 8085.
Answer:
The HOLD signal requests the microprocessor to release the system buses for DMA operation.
19. What is the disadvantage of Assembly Language?
Answer:
• Machine dependent.

• Difficult to learn and debug.

• Development time is longer.

• Not portable.
20. How much time is required to execute an instruction of 10 T-states (5 MHz)?
Answer:
Clock period = 0.2 μs
Execution time = 10 × 0.2 μs = 2 μs
21. Explain the function of Parity Flag.
Answer:
The parity flag indicates whether the number of 1's in the result is even or odd.
• Even parity → Flag = 1

• Odd parity → Flag = 0


22. Why is the Data Bus bidirectional in a microprocessor?
Answer:
Because data must be transferred:
• From memory/I/O to microprocessor (read operation)

• From microprocessor to memory/I/O (write operation)


23. What do you mean by General Purpose Registers in 8085?
Answer:
Registers B, C, D, E, H, and L are called general-purpose registers. They are used to store
temporary data during program execution.
24. How many address lines are in a 4096 × 8 EPROM chip?
Answer:
4096 = 2¹² locations.
Therefore, 12 address lines are required.
25. Describe Immediate Addressing Mode.
Answer:
In immediate addressing mode, the operand (data) is specified directly within the instruction
itself.
Example:
MVI A, 25H
26. State the functions of JPO and JNZ.
Answer:
• JPO (Jump if Parity Odd): Transfers control if parity flag = 0.

• JNZ (Jump if Not Zero): Transfers control if zero flag = 0.


27. What is an Instruction Cycle?
Answer:
An instruction cycle is the complete sequence of operations required to fetch and execute one
instruction.
28. What is a Maskable Interrupt?
Answer:
A maskable interrupt is an interrupt that can be enabled or disabled (masked) by software.
Examples: RST 5.5, RST 6.5, RST 7.5.
29. What is a Machine Cycle?
Answer:
A machine cycle is the time required to complete one basic operation such as opcode fetch,
memory read, memory write, I/O read, or I/O write.
30. What is the function of ALU?
Answer:
The Arithmetic Logic Unit (ALU) performs:
• Arithmetic operations (addition, subtraction, etc.)

• Logical operations (AND, OR, XOR, comparison, etc.)


31. Define Branch Instruction.
Answer:
A branch instruction changes the normal sequence of program execution by transferring control
to another memory location.
Examples: JMP, CALL, RET.
32. What is the role of the Instruction Register?
Answer:
The Instruction Register stores the instruction currently being decoded and executed by the
microprocessor.
8085 Assembly Language Programs
1. Sort 10 Numbers Stored from XX70H and Store Result at XX80H
Program
LXI H, XX70H
LXI D, XX80H
MVI C,0AH
COPY: MOV A,M
STAX D
INX H
INX D
DCR C
JNZ COPY
MVI C,09H
LOOP1: LXI H, XX80H
MOV B,C
LOOP2: MOV A,M
INX H
CMP M
JC NEXT
JZ NEXT
MOV D,M
MOV M,A
DCX H
MOV M,D
INX H
NEXT: DCR B
JNZ LOOP2
DCR C
JNZ LOOP1
HLT
2. Write an assembly language program for 8085 to add 10 BCD numbers starting from memory
location C400H and store the result in C500H and C501H.

Program
LXI H,C400H
MVI C,0AH
MVI B,00H
MVI A,00H
BACK: ADD M
DAA
JNC NEXT
INR B
NEXT: INX H
DCR C
JNZ BACK
STA C500H
MOV A,B
STA C501H
HLT

3. Write an assembly language program using ADI instruction to add the two hexadecimal
numbers 3AH and D8H and to display the answer at two memory locations 2050H and 2051H.

Program
MVI A,3AH
ADI D8H
STA 2050H
MVI A,00H
ACI 00H
STA 2051H
HLT
Result
3AH + D8H = 112H
2050H = 12H
2051H = 01H
4. Write a program in 8085 assembly language to find 1's complement of a 8 bit number.

Program
LDA 2000H
CMA
STA 2001H
HLT

5. Write a program in 8085 assembly language to multiply two 8 bit numbers.


Program

LDA 2000H
MOV B,A
LDA 2001H
MOV C,A
MVI A,00H
BACK: ADD B
DCR C
JNZ BACK
STA 2002H
HLT
6. Write a program in 8085 assembly language to sort a set of numbers in assending order.
Program
LXI H,2000H
MVI C,09H
OUTER: MOV B,C
LXI H,2000H
INNER: MOV A,M
INX H
CMP M
JC NOSWAP
MOV D,M
MOV M,A
DCX H
MOV M,D
INX H
NOSWAP: DCR B
JNZ INNER
DCR C
JNZ OUTER
HLT

7. Write a program in 8085 assembly language to counter the number of 1’s in a data byte.
Program
LDA 2000H
MVI B,08H
MVI C,00H
BACK: RAR
JNC NEXT
INR C
NEXT: DCR B
JNZ BACK
MOV A,C
STA 2001H
HLT

8. Write 8085 assembly language program to convert Binary number to BCD.

Program
LDA 2000H
MVI B,00H
BACK: CPI 0AH
JC DONE
SUI 0AH
INR B
JMP BACK
DONE: STA 2001H
MOV A,B
STA 2002H
HLT

9. Write a program in 8085 to transfer a block of 4 bytes starting from 2000H.

Program
LXI H,2000H
LXI D,3000H
MVI C,04H
BACK: MOV A,M
STAX D
INX H
INX D
DCR C
JNZ BACK
HLT

10. Write an assembly language program in 8085 to search an item from a list of ten elements.

Program
LDA 2100H
MOV B,A
LXI H,2000H
MVI C,0AH
BACK: MOV A,M
CMP B
JZ FOUND
INX H
DCR C
JNZ BACK
MVI A,00H
STA 2200H
HLT
FOUND: MVI A,01H
STA 2200H
HLT

Output
• 2200H = 01H → Item Found

• 2200H = 00H → Item Not Found


MOCK TEST
(a) Difference between Microprocessor and Microcomputer.
Answer

Microprocessor Microcomputer
CPU on a single IC chip. Complete computer system.
Requires external memory and I/O devices. Contains CPU, memory, and I/O devices.
Performs processing only. Performs complete computing functions.
Example: Intel 8085, 8086. Example: Personal Computer.

(b) Why are Program Counter and Stack Pointer 16-bit Registers?
Answer
The 8085 microprocessor can address 64 KB (2¹⁶ bytes) of memory. Since memory addresses
range from 0000H to FFFFH, 16 bits are required to store these addresses. Therefore both
Program Counter (PC) and Stack Pointer (SP) are 16-bit registers.
(c) Time Required to Execute an Instruction of 10 T-States (Clock Frequency = 5 MHz).
Answer
Clock Period
1 1
𝑇 = 𝑓 𝑇 = 5×106 = 0.2𝜇𝑠

Execution Time
= 10 × 0.2 = 2μs
Answer: 2 μs
(d) How Many Address Lines are Required for a 4096 × 8 EPROM?
Answer
4096 = 2¹² memory locations.
Therefore,
Address Lines = 12
Answer: 12 address lines
(e) Compare CALL and JMP Instructions
Answer

CALL JMP
Transfers control to a subroutine. Transfers control to another program location.
Return address stored in stack. No return address stored.
Returns using RET instruction. No automatic return.
Requires more execution time. Faster execution.
̅ Signals
(f) Function of READY and IO/M
Answer
READY Signal
• Used to synchronize slow peripherals.

• READY = 1 → Processor continues operation.

• READY = 0 → Processor enters wait state.


IO/M Signal
• Distinguishes Memory and I/O operations.

• ̅ = 0 → Memory operation.
IO/M

• ̅ = 1 → I/O operation.
IO/M
(g) Why Data Bus is Bidirectional but Address Bus is Unidirectional?
Answer
Data Bus
• Transfers data between CPU and memory/I/O.

• Data moves in both directions.

• Hence bidirectional.
Address Bus
• Carries address from CPU to memory/I/O.

• Address information flows only from CPU.

• Hence unidirectional.
(h) Different Flag Registers in 8086
Answer
The 8086 has 9 active flags.
Status Flags
1. Carry Flag (CF)
2. Parity Flag (PF)
3. Auxiliary Carry Flag (AF)
4. Zero Flag (ZF)
5. Sign Flag (SF)
6. Overflow Flag (OF)
Control Flags
7. Trap Flag (TF)
8. Interrupt Flag (IF)
9. Direction Flag (DF)

You might also like