Loading...

Loading, please wait...

Back to Topics

Digital Electronics
Microprocessor

Practice questions from Microprocessor.

30
Total
0
Attempted
0%
0
Correct
0%
0
Incorrect
0%
Q#1 Microprocessor GATE EE 2023 (Set 1) NAT +2 marks -0 marks

In a given 8-bit general purpose micro-controller there are following flags. C-Carry, A-Auxiliary Carry, O-Overflow flag, P-Parity (0 for even, 1 for odd)  and  are the two general purpose registers of the micro-controller. After execution of the following instructions, the decimal equivalent of the binary sequence of the flag pattern [CAOP] will be

MOV RO,

MOV R1, +0x46

ADD R0, R1

Explanation:

MOV R0, 0 × 60 ← (60)H is stored in R0

MOV R1, 0 × 46 ← (46)H is stored in R1

ADD R0, R1

Both values get added

A picture containing table

Description automatically generated

Number of 1’s in result = 4 = even ∴ P =0

Overflow bit is 1 because both numbers have MSB = 0 i.e. positive numbers but result has MSB = 1 i.e. negative number.

CAOP = 0010; decimal value = 2

Q#2 Microprocessor GATE EE 2020 (Set 1) NAT +2 marks -0 marks

An 8085 microprocessor accesses two memory locations (2001H) and (2002H), that contain 8-bit numbers 98H and B1H, respectively. The following program is executed:

LXI H,2001H

MVI A, 21H

INXH

ADD M

INXH

MOV M, A

HLT

At the end of this program, the memory location 2003H contains the number in decimal (base 10) form.         

Explanation:

LX1 H, 2001 H                HL = (2001)H

MVI A, 21 H                 A = (21)H

INXH                                HL = (2002)H

ADD M                        A = A + M = 21 + B1 = (D2)H

INXH                                HL = (2003)H

MOV M, A                (2003)H ← (D2)H = (210)10 

HLT

Q#3 Microprocessor GATE EE 2011 (Set 1) MCQ +2 marks -0.66 marks

A portion of the main program to call a subroutine SUB in an 8085 environment is given below.

                :

                :

              LXI        D, DISP
        LP. CALL        SUB
                :

                :

It is desired that control be returned to LP + DISP + 3 when the RET instruction is executed in thee subroutine. The set of instructions that precede the RET instruction in the subroutine are

Explanation:

When CALL instruction is executed the address of LP is pushed to the top of stack and then the PC is fed with new address. To return the execution to LP + DISP + 3.

The address of LP must be extracted in HL register pair by means of POP instruction and then DISP is added to it by the use of DAD instruction so that HL = LP +DISP

Then HL register pair is incremented thrice to obtain HL = LP +DISP + 3

Then this is pushed back to the top of stack to be fed to Program Counter upon execution of RET instruction.

Q#4 Microprocessor GATE EE 2010 (Set 1) MCQ +2 marks -0.66 marks

When a “CALL” Addr” instruction is executed. The CPU carries out the following sequential operations internally:

Note:

(R) means content of register R

((R)) means content of memory location pointed to by R

PC means program counter

SP means stack pointer

Explanation:

Whenever a CALL instruction is executed then the address of next instruction i.e. the contents of Program Counter are pushed to the Stack.

Then the Stack Pointer is incremented to point to the next memory location but in actual Stack Pointer is decremented.

Then the new address is stored in Program Counter to shift the program execution to  anew location.

Q#5 Microprocessor GATE EE 2009 (Set 1) MCQ +2 marks -0.66 marks

In an 8085 microprocessor, the contents of the Accumulator, after the following instructions are executed will become

XRA A

MVI B F0H

SUB B

01 H

0F H

F0 H

10 H

Explanation:

XRA A: clear the contents of Accumulator. A = 00H

MVI B F0H;    B = F0H

SUB B; A =A – B

A =      0000 0000

B =      1111 0000

A –B = 0001 0000 = (10)H and CY will be 1 as carry acts as borrow in case of subtraction.

Q#6 Microprocessor GATE EE 2008 (Set 1) MCQ +1 mark -0.33 marks

An input device is interfaced with Intel 8085A microprocessor as memory mapped I/O.   The address of the device is 2500H. In order to input data from the device to accumulator, the sequence of instructions will be

LXI        H, 2500H

MOV        A, M

LXI        H, 2500H

MOV        M, A

LHLD        2500H

MOV        A, M

LHLD        2500H

MOV        M, A

Explanation:

Memory Mapped I/O are accessed as memory location and to access a memory location, its address must be stored in HL register pair so, the first instruction should be

LXI H, 2500H

Now, the data from this address can be directly moved to accumulator by using the instruction,

MOV A, M

Q#7 Microprocessor GATE EE 2008 (Set 1) MCQ +2 marks -0.66 marks

The contents (in Hexadecimal) or some of the memory locations in an 8085A based system are given below:

The contents of stack pointer (SP), program counter (PC) and (HL) are 2700H, 2100H and 0000H respectively. When the following sequence of instructions are executed,

The contents of (SP) and (PC) at the end of execution will be

(PC) = 2102H, (SP) = 2700H

(PC) = 2700H, (SP) = 2700H

(PC) = 2800H, (SP) = 26FEH

(PC) = 2A02H, (SP) = 2702H

Explanation:

DAD SP : Add the contents of SP register to the HL register pair and store the result in HL register pair.

HL = HL + SP = 2700H

PCHL: Load the Program Counter with the contents of HL register pair.

PC = HL = 2700H

Hence, after execution of these instructions the contents of both SP and PC is 2700H.

Q#8 Microprocessor GATE EE 2007 (Set 1) MCQ +2 marks -0.66 marks

Which one of the following statements regarding the INT (interrupt) and the BRQ (bus request) pins in a CPU is true?

The BRQ pin is sampled after every instruction cycle, but the INT is sampled after every machine cycle.

Both INT and BRQ are sampled after every machine cycle

The INT pin is sampled after every instruction cycle, but the BRQ is sample dafter every machine cycle

Both INT and BRQ are sampled after every instruction cycle

Explanation:

The INT pin is sampled after every machine cycle that is its value is sampled even in between execution of an instruction.

The BRQ or Bus Request Pin is sampled after every instruction cycle i.e. on completion of execution of an instruction.

Q#9 Microprocessor GATE EE 2007 (Set 1) MCQ +2 marks -0.66 marks

The associated figure shows the two types of rotate right instructions R1, R2 available in a microprocessor where Reg is a 8-bit register and C is the carry bit. The rotate left instructions L1 and L2 are similar except that C now links the most significant bit of Reg instead of the least significant one.

Suppose Reg contains the 2's complement number 11010110. If this number is divided by 2 the answer should be

01101011

10010101

11101001

11101011

Explanation:

The given number is (11010110)2 = (214)10

Since, it is in 2’s complement form, the actual number is 28 -  214 = (42)10

When this number is divided by 2 the result is (21)10

This number can be expressed in 2’s complement form as, 28 -  21 = (235)10

(235)10 = (11101011)2

Q#10 Microprocessor GATE EE 2007 (Set 1) MCQ +2 marks -0.66 marks

The associated figure shows the two types of rotate right instructions R1, R2 available in a microprocessor where Reg is a 8-bit register and C is the carry bit. The rotate left instructions L1 and L2 are similar except that C now links the most significant bit of Reg instead of the least significant one.

Such a division can be correctly performed by the following set of operations

L2, R2, R1

L2, R1, R2

R2, L1, R1

R1, L2, R2

Explanation:

The objective of instruction sequence is to convert (11010110)2 to (11101011)2 by the use of Shift Instructions.

L2 : 11010110 -> 10101101,         CY = 1

R2: 10101101 -> 11010110,        CY = 1

R1: 11010110 -> 11101011,        CY = 0

Note:  Here, we must verify the options in order to know the correct sequence.

Q#11 Microprocessor GATE EE 2006 (Set 1) MCQ +2 marks -0.66 marks

A software delay subroutine is written as given below:        

How many times DCR L instruction will be executed?

255

510

65025

65279

Explanation:

In the first iteration, the value of register L is decremented from 25510 to 010. So, DCR L is executed 255 times.

In rest of 254 iterations the value of register L is decremented from 00H to 00H i.e. the value is decremented 256 times.

Hence, DCR L instruction is executed = 255 + 254 x 256 = 65,279 times

Q#12 Microprocessor GATE EE 2006 (Set 1) MCQ +2 marks -0.66 marks

In an 8085 microprocessor based system, it is desired to increment the contents of memory location whose address is available in (D, E) register pair and store the result in same location.  The sequence of instructions is

XCHG

INR M

XCHG

INX H

INX D

XCHG

INR M

XCHG

Explanation:

First XCHG instruction must be executed to transfer the memory address from DE register pair to HL register pair.

Then we can use INR M instruction to increase the content of memory location pointed to by HL register pair.

Q#13 Microprocessor GATE EE 2005 (Set 1) MCQ +1 mark -0.33 marks

The 8085 assembly language instruction that stores the contents of H and L registers into the memory locations 2050H and 2051H, respectively, is:

SPHL 2050H

SPHL 2051H

SHLD 2050H

STAX 2050H

Explanation:

SPHL Instruction copies the content of HL register pair into the Stack Pointer register.

STAX copies the content of accumulator into the memory location whose address is specified by the operand register pair.

SHLD is used to copy the contents of HL register pair in the memory location specified.

SHLD 2050H copies contents of H in the memory location 2050H and L into 2051H.

Q#14 Microprocessor GATE EE 2004 (Set 1) MCQ +2 marks -0.66 marks

If the following program is executed in a microprocessor, the number of instruction cycles it will take from START TO HALT is

START        MVI A, 14 H        :  Move 14 H to register A

SHIFT        RLC                        : Rotate left without carry

                JNZ SHIFT                : Jump on non-zero to

                SHIFT

                HALT

4

8

13

16

Explanation:

Both MVI and RLC instruction do not affect the zero flag so it will remain as it is. Hence, we can safely assume that all instructions will be executed once.

Since, there are a total of 4 instruction so it requires 4 instruction cycles to operate.

Q#15 Microprocessor GATE EE 2003 (Set 1) MCQ +1 mark -0.33 marks

When a program is being executed in an 8085 microprocessor, its Program Counter contains

The number of instructions in the current program that have already been executed

The total number of instructions in the program being executed

The memory address of the instruction that is being currently executed

The memory address of the instruction that is to be executed next

Explanation:

Program Counter contains the address of next instruction to be executed.

Q#16 Microprocessor GATE EE 2003 (Set 1) MCQ +2 marks -0.66 marks

A memory system has a total of 8 memory chips, each with 12 address lines and 4 data lines. The total size of the memory system is

16 kbytes

32 kbytes

48 kbytes

64 kbytes

Explanation:

Since, there are 4 data lines in each memory chip, it means that each memory register is 4 bits wide.

Number of Address Lines = 12

Total number of memory location in each chip =  

Number of bits that can be stored =

Total bits in 8 memory chips =

8 bits = 1 byte

Total Size =

Q#17 Microprocessor GATE EE 2003 (Set 1) MCQ +2 marks -0.66 marks

The following program is written for an 8085 microprocessor to add two bytes located at memory addresses 1FFE and 1FFF

LXI        H, 1FFE

MOV        B, M

INR        L

MOV        A, M

ADD        B

INR        L

MOV        M, A

XOR        A

On completion of the execution of the program, the result of addition is

In the register A

at the memory address 1000

at the memory address 1F00

at the memory address 2000

Explanation:

So, the result is stored at 1F00H.

Q#18 Microprocessor GATE EE 2002 (Set 1) MCQ +1 mark -0.33 marks

The logic circuit used to generate the active low chip selects (CS) by an 8085 microprocessor to address a peripheral is shown in Figure. The peripheral will respond to addresses in the range.

E000-EFFF

000E-FFFE

1000-FFFF

0001-FFF1

Explanation:

Since, the CS signals is an active low signal so the output of NAND Gate must be 0 to assert the Chip Select signal. Hence, all inputs must be asserted to make the output zero.

Since, A12 is associated with an inverter, it must be LOW to be asserted.

A15 = 1, A14 = 1, A13 = 1, A12 = 0.

Minimum Address = 1110 0000 0000 0000  (E000 H)

Maximum Address = 1110 1111 1111 1111  (EFFF H)

Q#19 Microprocessor GATE EE 2001 (Set 1) MCQ +2 marks -0.66 marks

An intel 8085 processor is executing the program given below.

                          MVI A, 10H

                          MVI B, 10H

BACK:            NOP

                          ADD B

                          RLC

                          JNC BACK

                          HLT

The number of times that the operation NOP will be executed is equal to

1

2

3

4

Explanation:

The instruction NOP will be executed as many number of times as the loop is executed. Upon execution once,

A = A + B = 20H (0010 0000)

RLC;  A = 40H     (0100 0000), CY = 0

Second execution,

A = A + B = 50H  (0101 0000)

RLC; A = A0H       (1010 0000), CY = 0

Third execution,

A = A + B = B0H  (1011 0000)

RLC; A = 61H        (0110 0001), CY = 1

Since, the CY flag is now set the loop terminates and hence NOP instruction is executed thrice.

Q#20 Microprocessor GATE EE 2000 (Set 1) MCQ +1 mark -0.33 marks

Which one of the following is not a vectored interrupt?

TRAP

INTR

RST 7.5

RST3

Explanation:

TRAP, RST 7.5, RST 6.5 and RST 5.5 are vectored interrupts whereas INTR is a non-vectored interrupt.

Q#21 Microprocessor GATE EE 1997 (Set 1) MCQ +1 mark -0.33 marks

In a microprocessor, the address of the next instruction to be executed, is stored in

Stack pointer

Address latch

Program counter

General purpose register

Explanation:

Program Counter stores the address of next instruction to be executed.

Q#22 Microprocessor GATE EE 1997 (Set 1) MCQ +1 mark -0.33 marks

The computer program which converts statements written in high level language to object code is known as

Assembler

Operating system

Object-oriented software        

None of these

Explanation:

Assembler converts program written in High Level Language to Machine code with one line at a time.

Q#23 Microprocessor GATE EE 1997 (Set 1) MCQ +2 marks -0.66 marks

The range of address for which the memory chip shown in figure, will be selected is_________ to_________

(F8000) to  (FFFFH)

(F80FH) to  (FFFFH)

(F800H) to  (FFFFF)

(F800H) to  (FFFFH)

Explanation:

For CS to be selected all the address lines connected to AND Gate should be asserted so

(A11 – 1, A12 – 1, A13 – 1, A14 – 1, A15 – 1).

The other address lines can vary from all 0’s and all 1’s. Hence the address range can vary between

Minimum Address: 1111 1000 0000 0000 = (F800 H)

Maximum Address: 1111 1111 1111 1111 = (FFFF H)

Q#24 Microprocessor GATE EE 1996 (Set 1) MCQ +2 marks -0.66 marks

In a 8085 microprocessor, the following instructions may result in change of accumulator contents and change in status flags. Choose the correct match for each instruction.

(a)=> (T)

(b)=> (S)

(c) => (P)

(a)=> (T)

(b)=> (P)

(c) => (S)

(a)=> (P)

(b)=> (S)

(c) => (T)

None

Explanation:

ANA r: ANDs the content of register with accumulator which modifies the content of accumulator and resets the carry flag and sets the AC flag.

XRA r: Ex-ORs the contents of a register with the accumulator. So, the contents of accumulator are modified. It resets both CY and AC flag.

CMP r: Compares the contents of register r with accumulator but contents of both registers are preserved. Contents of CY flag will change depending on the result. AC = unchanged.

Q#25 Microprocessor GATE EE 1995 (Set 1) MCQ +1 mark -0.33 marks

In an 8085 microprocessor, after the execution of XRA A instruction  

The carry flag is set

The accumulator contains 

The zero flag is set

The accumulator contents are shifted left by one bit

Explanation:

Ex-OR of two identical values results in zero output. So, when contents of Accumulator are EX-ORed with itself then Accumulator is reset and Zero Flag is set to reflect the result.

Q#26 Microprocessor GATE EE 1995 (Set 1) MCQ +2 marks -0 marks

A subroutine PROG1 written in the 8085 assembly language is given below. At entry to this program, the values of different registers in HEX are. A=05; BC=0000; DE=5472; HL=4528, All the flags are set to 1. Determine the register contents and condition of the zero and carry flags after the execution of the program. (i.e., after executing RET statement). What does the program accomplish?

PROG1        MOV A, E

        ADD L

        DAA

        MOV L, A

        MOV A, D

        ADC H

        DAA

        MOV H, A

        MVI A, 00H

        RAL

        RET

Contents of Registers,

HL = 0000H

BC = 0000H

DE = 5472H

A = 01H

CY = 0 and Z =1

Contents of Registers,

HL = 000H

BC = 0000H

DE = 5472H

A = 01H

CY = 1 and Z =0

Contents of Registers,

HL = 0000H

BC = 0000H

DE = 5472H

A = 10H

CY = 0 and Z =1

Contents of Registers,

HL = 0000H

BC = 0000H

DE = 5472H

A = 01H

CY = 1 and Z =1

Explanation:

PROG1                  MOV A, E;      A = 72H, flags unchanged

ADD L;   A = A + L = 9AH (1001 1010);  Z = 0, CY = 0

DAA;

Since, the lower nibble of accumulator is greater than 09H then 06H is added to lower nibble which makes the result A0H. Now the higher order nibble becomes greater than 09H so 06H is added to higher order nibble. Hence, A = 00H. So Carry Flag is set and zero flag is also set.

Contents of Registers,

HL = 0000H

BC = 0000H

DE = 5472H

A = 01H

CY = 0 and Z =1

Q#27 Microprocessor GATE EE 1994 (Set 1) MCQ +1 mark -0.33 marks

The contents of the accumulator in an 8085 microprocessor is altered after the execution of the instruction.

CMP C

CPI 3A

ANI 5C

ORA A

Explanation:

CMP C: Compares the content of register C with accumulator and only flags are modified but contents of accumulator are unchanged.

CPI 3A: Compares the content of Accumulator with the data byte “3A”. The contents of accumulator remains unchanged.

ANI 5C: It is bit by bit AND operation of the data byte “5C” with the accumulator and is used for masking certain bits so it changes the contents of accumulator.

ORA A: It is a bit by bit OR operation of Accumulator with itself so the contents of accumulator are unchanged.

Q#28 Microprocessor GATE EE 1994 (Set 1) MCQ +1 mark -0.33 marks

The stack pointer of a microprocessor is at A001 At the end of execution of following instructions, the value of stack pointer is _____________

PUSH        PSW

X        THL        

PUSH        D

JMP         FC70 H

9FFF

9FFD

9FDD

9DFD

Explanation:

PUSH Instruction decrements the content of Stack Pointer by 2.

So, value of Stack Pointer after execution of each instruction is given below,

PUSH       PSW                      SP = 9FFF

XTHL                                     SP = 9FFF

PUSH       D                           SP = 9FFD

JMP          FC70                     SP = 9FFD

XTHL: exchanges top of stack with HL register pair but Stack Pointer remains same.

JMP shifts the program execution to a new address but Stack Pointer remains same.

Q#29 Microprocessor GATE EE 1993 (Set 1) MCQ +1 mark -0.33 marks

Three devices A, B and C have to be connected to a 8085 microprocessor. Device A has highest priority and device C has the lowest priority. In this context which of the following is correct assignment of interrupt inputs?

A uses TRAP, B uses RST 5.5 and C uses RST 6.5

A uses RST 7.5, B uses RST 6.5 and C uses RST 5.5

A uses RST 5.5, B uses RST 6.5 and C uses RST 7.5

A uses RST 5.5, B uses RST 6.5 and C uses TRAP

Explanation:

The TRAP interrupt has highest priority followed by RST 7.5, 6.5, 5.5. Since, device A has highest priority so it must be connected to RST 7.5, B must be connected to RST 6.5 and C must be connected to RST 5.5.

Q#30 Microprocessor GATE EE 1992 (Set 1) MCQ +1 mark -0.33 marks

If the HLT instruction of a 8085 microprocessor is executed,

The microprocessor is disconnected from the system bus till the Reset is pressed

The microprocessor enters into a Halt state and the buses are tri-stated

The microprocessor halts execution of the program and returns to monitor

The microprocessor reloads the program from the locations 0024 and 0025 H

Explanation:

The microprocessor will enter the HALT state and HALT the execution of program and releases the buses i.e. they enter tri-state logic.