You are on page 1of 11

1. List any three primary functions of CPU of microcomputer.

Ans.: Primary function of the CPU of a microcomputer:


1. To fetch, decode, and execute program instructions in the proper order.
2. Transfer data to and from memory and to and from I/O section.
3. Responds to external interrupts.
4. Provide overall timing and control signals for the entire system.

2. Define the following: 1. T-State 2. Machine Cycle 3. Instruction Cycle


Ans.:
1. T-state: The subdivision of an operation, which is performed in one clock period is called as T-state.
2. Machine Cycle: Machine cycle is the time required to complete any operation of accessing either memory or
I/O which is subpart of instruction. The machine cycle may consist of three to six T-states.
3. Instruction Cycle: Instruction cycle is defined as the time required to complete the execution of an
instruction. The 8085 instruction cycle consists of one to five machine cycle.

3. Explain the organization of ALU with the help of simple block diagram.
Ans.:
1. The arithmetic and logical unit is 8 bit unit.
2. It performs arithmetic, logic and rotate operations such as add, shift/rotate, compare, increment, decrement,
AND, OR, XOR, etc.
3. The ALU contains: 1) Adder 2) Shifter 3) Status register
4. Adder performs arithmetic operations like addition, subtraction by using 2’s complement method, increment,
decrement etc. with the results being feedback into the accumulator via internal data bus.
5. Results are typically stored in accumulator.
6. Shifter performs logical operations like rotate left, rotate right etc. Result is again placed into the register.
7. Status Register or condition code register contains group of individual flip-flops that can be set or reset based on
the conditions created by the last ALU operation.
8. Accumulator, temporary register and flag register are closely associated with ALU and many times considered to
be part of ALU.
9. Temporary register is used to hold data during as arithmetic/logic operations.
10. The flags are set or reset according to the result of operations in status register.

4.Define bit pattern of flag register and explain the significance of each flag bit.
Ans.:
1. A flag is a single bit status register.
2. Flags are set or reset by ALU according to the result by ALU.
3. Flags are important because they are the conditions for conditional branching instructions.
4. 8085 has five flags. Sign flag, Zero flag, Auxiliary carry flag, Carry flag and Parity flag. A 8- bit register is used to
represent these flags as shown in figure.

1. Sign flag (S) : After the execution of arithmetic and logic operation, if the most significant bit of the result is 1,
then the sign flag is set to 1 otherwise 0. This flag is used with signed number. If MSB is 1, the number will be
negative and if it is 0, the number will be positive.
2. Zero flag (Z) : After performing an arithmetic or logic operation, if the result is zero, then zero flag is set to 1, else
it is reset. This flag is modified by the results in accumulator as well as in other registers.
3. Auxiliary carry flag (Ac) : In an arithmetic operation, when carry is generated from bit D3 to D4, the auxiliary carry
flag is set to 1. This flag is only available internally and used for B.C.D. operations and not available for programmer.
4. Parity flag (P) : Parity flag is set to 1, if the result stored in accumulator contains even parity i.e. even number of
1's. If accumulator contains odd number of 1's, the flag is 0.
5. Carry flag (Cy) : This flag sets if carry produced by most significant bit during the execution of an arithmetic
operation. In subtraction carry flag serve as borrow flag.

5. Explain the functions of the following pins of 8085: 1.ALE 2. RD 3. WR


Ans.:

1. ALE:
1. Address Latch Enable, one special output signal generated by microprocessor to indicate beginning of the
operation.
2. ALE is never tristated.
2. RD:
1. This is read control signal. This is active low signal.
2. It is tristated during HOLD and HALT.
3. WR:
1. This is write control signal. This is also active low signal.
2. It is tristated during HOLD and HALT

6. What are different addressing modes used in 8085 microprocessor? Explain any two of them with a suitable
example.
Ans: The microprocessor 8085 has five addressing modes, which are given below:
1. Direct addressing

2. Register addressing

3. Immediate addressing

4. Register indirect addressing

5. Implied addressing

1) Direct Addressing Mode:


1. In direct addressing mode, the address appears opcode of instruction in program memory.
2. The address of opcode is specified within the instruction.
3. The instruction using direct addressing mode are three byte instructions. Byte 1 is opcode of instruction,
byte 2 is lower order address and byte 3 is high order address.
4. For e.g. LDA (Load Accumulator Direct) 9FFF H(Hexadecimal)
5. This instruction loads accumulator with content of memory location 9FFF H.
2) Register Addressing Mode:
1. In register addressing mode, the source operands are general purpose registers, whose name is specified
within the instruction.
2. These instructions are single byte instructions.
3. All Actions occur within CPU.
4. For e.g. MOV A, B (Move content of register)
5. This instruction transfers the content of register B to accumulator without modifying the content of register
B.

7. Draw the functional block diagram of microprocessor 8085.


Ans.:

8. Write down the name of the instruction:


1. Subtract immediate from accumulator. => SUI DATA
2. Rotate accumulator left through carry => RAL
3. Store accumulator indirect => STAX RP
4. Move from memory => MOV R, M
9. The flag register of 8085 microprocessor contains the data 45H. Interpret it’s meaning.
Ans.:
Given that the flag register of 8085 contains data 45H = 0100 0101.
We know that the 8085 has five flags and they are as follows:

1. Here, sign flag is reset, this means that result is positive.


2. Zero flag is set, this means that result is equal to zero after the execution.
3. Auxiliary carry flag is reset, this means that there is no auxiliary.
4. Parity flag is set means the result stored in accumulator contains even.
5. Carry flag is set, this means there is a carry or borrow from most significant bit during the execution.

10. Give all the hardware interrupts provided by 8085.List them according to their priority.
Ans.:
1. 8085 provides 5 hardware interrupts:
1) TRAP
2) RST 7.5
3) RST 6.5
4) RST 5.5
5) INTR

2. These interrupts are vectored interrupts. When these interrupts are given, it is directed to transfer the
control to specific memory location as shown below:
TRAP 4.5 X 8 = 0024H
RST 7.5 = 7.5 X 8 = 003CH
RST6.5 = 6.5 X 8 = 0034 H
RST 5.5 = 5.5 X 8 = 002C H

3. TRAP is non-maskable interrupts which cannot be disabled while other four interrupts are maskable
interrupts which can be disabled.
4. TRAP has highest priority and the INTR has lowest priority among the hardware interrupts.
These hardware interrupts in descending order of priority are:
1) TRAP- highest priority
2) RST 7.5
3) RST 6.5
4) RST 5.5
5) INTR – lowest priority

11. The accumulator contains the dada A4H.What will be its contents after execution of following instructions
independently.
1. XRI 08H 2. CMA 3. SUB A

Ans.:
1. XRI 08H
[A] = A4H = 1010 0100
A4 = 1010 0100
08 = 0000 1000
---------------
1010 1100 = ACH
[A] = [ACH]

2. CMA
[A] = A4H = 1010 0100
CMA
[A] = 0101 1011 = [5BH]
3. SUB A
[A] = A4H = 1010 0100
SUB A = [A]-[A] = [A]
[A] = [A4] =1010 0100
2’S COMPLEMENT OF A4H = 01011100
1010 0100
+ 0101 1100
--------------
1 0000 0000

COMPLEMENT CARRY [1] = [0]


RESULT = [A] = 0000 0000

12. Explain the function of following registers in 8085.


1. Accumulator 2. ALU 3. Stack register 4. Program counter
Ans.:
1) Accumulator:
1. Accumulator is 8-bit main register in 8085, it used to perform the arithmetical and logical operations. In such
operations, one of the operand is always stored in accumulator.
2. All data transfer between the CPU and I/0 devices are performed through accumulator.

2) ALU:
1. Arithmetical and logical unit is 8-bit unit, where arithmetical and logical operations are carried out.
2. Data is supplied by accumulator, I/O device, memory etc.

3) Stack register:
1. Stack pointer is a 16-bit register, which contains the memory address of last byte entered in stack.
2. With the help of incrementer/decrementer, the stack pointer is decremented each time data is pushed onto
stack and incremented each time data is popped off the stack.

4) Program counter:
1.The program counter is 16-bit register acting as a pointer to next executable instruction.
2. The microprocessor uses this register to sequence the execution of instruction.

13. Draw a neat block diagram of microcomputer system.


Ans.:
14. What are the groups in which instructions in 8085 are classified?
Ans.:
The instructions in 8085 can be classified into following five groups, depending upon their function:
✓ Data transfer group

✓ Arithmetic group

✓ Logical group

✓ Machine control group

✓ Branching group

1. Data Transfer Group:

This group of instruction copies data from a source location destination location without modifying the
content of source.

2. Arithmetic Group:

The instruction of this group performs arithmetic operations such as addition subtraction, increment or
decrement etc. on data in registers or memory. For eg. ADD, SUB, INR, DCR etc.

3. Logical Group:

The logical group instructions perform logical operations such as AND, OR, XOR etc. generally with the
accumulator.

4. Machine Control Group:

These instructions control machine operations such as Halt, interrupt. For e.g. NOP, HLT.

5. Branching Group:

The branching group instructions allow programmer to change the sequence of execution of program
conditionally or unconditionally.

15. Write down any three instructions from data transfer group.
Ans.:
1) Mov RD, RS
2) MOV R, M
3) MOV M, R

16. What are I/O mapped I/O and memory mapped I/O schemes.
Ans.:
1. In I/O mapped I/O, same address may be used for I/O device and for memory location.
2. Microprocessor 8085 uses I/O mapped I/O scheme to address I/O devices.
3. Differentiation between I/O operations and memory operations is done using status signals.
4. When the signal is IO/ M high, the address on the address bus is for an I/O device and when it is low, the address
on the address bus is for a memory location.
5. The instruction IN and OUT is used to address I/O devices.
6. The operations which are carried out are identified using status signal S0 and S1:
17. Explain following instructions.
1. SUB R 2. MOV RD, RS 3. ANA A 4. XCHG

Ans.:
1. SUB R

2. MOV RD,RS
3.ANA A( ANA R)

4. XCHG
18. Draw a pin diagram of microprocessor 8085.
Ans.:
1.Write ALP to find larger of the content of memory locations C000H and C001H. Place the result in C002H.

2.Write ALP to add two hexadecimal numbers 32H and 48H.Store sum to memory location C000H.
3.Write ALP to complement the contents of memory location C000H.Place the result in D000H.

You might also like