0% found this document useful (0 votes)
34 views10 pages

Micro Processor and Micro Controlle1

Uploaded by

kanishkasp2006
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)
34 views10 pages

Micro Processor and Micro Controlle1

Uploaded by

kanishkasp2006
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
You are on page 1/ 10

MICRO PROCESSOR AND MICRO

CONTROLLER
CIE 2 QUESTION BANK WITH ANSWERS
SET 1
2 MARKS

1. Define pipelining? How does 8086 processor implement it?

Pipelining

• While EU executes instructions, BIU fetches instructions from memory and stores them in the
QUEUE.

• BIU and EU operate in parallel independent of each other.

• This type of overlapped operation of the functional units of a MP is called Pipelining

2. Analyze difference between the instructions MOV AX, 2437H and MOV AX, [2437H]
MOV AX, 2437H: Is immediate addressing mode in which the data operand is a part of the
instruction itself. And so, it Moves the 16 bit number 2437H into accumulator.

MOV AX, [2437H]: It is a Direct addressing mode which the effective address of the memory
location is written directly in the instruction. And it moves the 16 hit numbers present in the
memory location whose address is represented by the offset 2437H.

3. Write the control word format of BSR mode in 8255.


4. How is parallel communication different from serial communication?

5. Determine the command word to set keyboard/display mode for encoded scan
Bit Value Description

D7 0 Keyboard/Display mode

D6 0 Right entry D5 0 Right entry

D4 1 Encoded scan keyboard mode

D3 1 Enable display
D2 1 N-key rollover

D1 0 16 characters

D0 1 16 characters

Combining the bits we get:0 0 0 1 1 1 0 1

6. Identify the type of communication adopted in hello FM radio. Justify your answer.
Hello FM radio, like other FM (Frequency Modulation) radio stations, adopts analog
communication for its broadcasting.
Key Characteristics of Analog Communication in FM:
• Frequency Variations: The core principle of FM is that it varies the frequency of the
carrier wave based on the analog input signal, indicative of analog communication.

5 MARK
7. Write a program to move a string 200 bytes long from the offset address 1000H to
the offset address 3000Hin the segment 5000H.

MOV SI,1000H
MOV DI,3000H
MOV AX,200
MOV DS.AX
MOV ES,AX
MOV CL,[SI]
MOV CH,00
INC SI
CLD
REP
MOV SB
HLT
8. What are the functions performed by port-C of 8255.
BSR MODE-
The two basic modes are selected by D7 bit of control register.
When D7=1 it is an I/O mode and when D7=0;
BSR mode.
• The BSR mode is a port C bit set/reset mode.
• The individual bit of port C can be set or reset by writing control word in the
control register.
• The pin of port C is selected using bit select bits [b b b] and set or reset is decided
by bit S/R.̅
• The BSR mode affects only one bit of port C at a time. The bit set using BSR mode
remains set unless and until you change the bit. So to set any bit of port C, bit pattern
is loaded in control register
. • If a BSR mode is selected it will not affect I/O mode.
Port C Functions:
• PC0, PC1, PC2: Handshaking and status signals for Port B.
o PC0: Input/output ready (STB or IBF)
o PC1: Acknowledge (ACK)
o PC2: Input/output ready (INTR)
• PC3, PC4, PC5:
Handshaking and status signals for Port A. o PC3:
Input/output ready (STB or IBF) o PC4:
Acknowledge (ACK) o PC5: Input/output ready (INTR)
• PC6, PC7:
These bits are often left unused or can be used for general-purpose I/O.

7 MARKS
9. Explain the various addressing modes used in 8086 microprocessor with suitable
examples.
1. Immediate Addressing Mode
• Description:
The operand is specified directly in the instruction.
• Example: MOV AX, 1234H o Here, the immediate value 1234H is moved directly
into the AX register.
2. Register Addressing Mode
• Description: The operand is a register and the data is in the register.
• Example: MOV AX, BX o This instruction moves the content of register BX into
register AX.
3. Direct Addressing Mode
• Description: The effective address of the operand is given directly in the
instruction.
• Example: MOV AX, [1234H] o This instruction moves the data from memory
location 1234H into the AX register.
4. Register Indirect Addressing Mode
• Description: The operand's effective address is stored in a register.
• Example: MOV AX, [BX] o This instruction moves the data from the memory
location pointed to by BX into the AX register.
5. Indexed Addressing Mode
• Description: The effective address of the operand is obtained by adding a constant
displacement to an index register.
• Example: MOV AX, [SI + 1234H] o Here, the effective address is the sum of the
content of SI register and 1234H. The data from this computed address is moved into
AX.
6. Base-Indexed Addressing Mode
• Description: The effective address is obtained by adding the contents of a base
register and an index register.
• Example: MOV AX, [BX + SI]
o This instruction adds the contents of BX and SI registers to get the effective address
from which data is moved into AX.
7. Base-Indexed with Displacement Addressing Mode
• Description: The effective address is obtained by adding a base register, an index
register, and a constant displacement.
• Example: MOV AX, [BX + SI + 1234H]
Here, the effective address is calculated by adding the contents of BX, SI, and the
displacement 1234H. The data from this computed address is moved into AX.
8. Relative Addressing Mode
Description:
The effective address is determined relative to the current value of the instruction
pointer.
• Example: JMP SHORT LABEL
o This jumps to the address specified by LABEL, which is calculated relative to the
current value of the instruction pointer IP.

9.Implicit Addressing Mode

• Description: The operand is implied by the instruction itself, rather than being
explicitly stated.
Example: CWD o This converts the word in AX to a double word in DX:AX. The
operands AX and DX are implied.
10. Describe the various modes of operation in 8253 programmable interval timer.

8253/54 can be operated in 6 different modes. In this chapter, we will discuss these operational
modes.

Mode 0 ─ Interrupt on Terminal Count


• It is used to generate an interrupt to the microprocessor after a certain interval.
• Initially the output is low after the mode is set. The output remains LOW after the count value
is loaded into the counter.
• The process of decrementing the counter continues till the terminal count is reached, i.e., the
count become zero and the output goes HIGH and will remain high until it reloads a new count.
• The GATE signal is high for normal counting. When GATE goes low, counting is terminated and
the current count is latched till the GATE goes high again.
Mode 1 – Programmable One Shot
• It can be used as a mono stable multi-vibrator.
• The gate input is used as a trigger input in this mode.
• The output remains high until the count is loaded and a trigger is applied.
Mode 2 – Rate Generator
• The output is normally high after initialization.
• Whenever the count becomes zero, another low pulse is generated at the output and the
counter will be reloaded.
Mode 3 – Square Wave Generator
• This mode is similar to Mode 2 except the output remains low for half of the timer period and
high for the other half of the period.
Mode 4 − Software Triggered Mode
• In this mode, the output will remain high until the timer has counted to zero, at which point
the output will pulse low and then go high again.
• The count is latched when the GATE signal goes LOW.
• On the terminal count, the output goes low for one clock cycle then goes HIGH. This low pulse
can be used as a strobe.
Mode 5 – Hardware Triggered Mode
• This mode generates a strobe in response to an externally generated signal.
• This mode is similar to mode 4 except that the counting is initiated by a signal at the gate
input, which means it is hardware triggered instead of software triggered.
• After it is initialized, the output goes high.
• When the terminal count is reached, the output goes low for one clock cycle.
Print Page

11. Explain the arithmetic instructions of 8086 microprocessor.


Arithmetic Instructions

These instructions are used to perform arithmetic operations like addition, subtraction,
multiplication, division, etc.

Following is the list of instructions under this group −

Instructions to perform addition


• ADD − Used to add the provided byte to byte/word to word.
• ADC − Used to add with carry.
• INC − Used to increment the provided byte/word by 1.
• AAA − Used to adjust ASCII after addition.
• DAA − Used to adjust the decimal after the addition/subtraction operation.
Instructions to perform subtraction
• SUB − Used to subtract the byte from byte/word from word.
• SBB − Used to perform subtraction with borrow.
• DEC − Used to decrement the provided byte/word by 1.
• NPG − Used to negate each bit of the provided byte/word and add 1/2’s complement.
• CMP − Used to compare 2 provided byte/word.
• AAS − Used to adjust ASCII codes after subtraction.
• DAS − Used to adjust decimal after subtraction.
Instruction to perform multiplication
• MUL − Used to multiply unsigned byte by byte/word by word.
• IMUL − Used to multiply signed byte by byte/word by word.
• AAM − Used to adjust ASCII codes after multiplication.
Instructions to perform division
• DIV − Used to divide the unsigned word by byte or unsigned double word by word.
• IDIV − Used to divide the signed word by byte or signed double word by word.
• AAD − Used to adjust ASCII codes after division.
• CBW − Used to fill the upper byte of the word with the copies of sign bit of the lower byte.
• CWD − Used to fill the upper word of the double word with the sign bit of the lower word.
12. Describe with neat diagram about serial communication interface.

Serial Communication Interface:

https://www.rcet.org.in/uploads/academics/rohini_83318880820.pdf

13.Design a programmable timer using 8253 and 8086. Interface 8253 at an address of 0040H for
counter 0 and write the following ALPs. The 8086 and 8253 run at 6 MHz and 1.5 MHz respectively.
(i) (ii) To generate a square wave of period 1ms. To interrupt the microprocessor after 10ms. To
derive a monoshot pulse with quasi-stable state duration of 5ms.

i) MOV AL,37H

OUT 46H,AL

MOV AL,00

OUT 40H,AL

MOV AL,15

OUT 40H,AL

HLT

II) MOV AL,70H

OUT 46H,AL

MOV AL,98H

OUT 42H,AL

MOV AL,3AH

OUT 42H,AL

HLT

III) MOV AL,B2H

OUT 46H,AL

MOV AL,4CH

OUT 44H,AL

MOV AL,1D

OUT 44H,AL

HLT

14. Design a microprocessor system for the 8085 microprocessor such that it should contain 4
Kbyte of EPROM and 2 Kbyte of RAM using two 2 Kbytes of EPROMs and two 1 Kbytes RAM. Draw
the complete interfacing diagram with appropriate chip select logic used.
15. Design an interface between 8086 microprocessor system and two 8K x 8 RAM memory
chips (6264) and two 8K x 8 EPROM memory chip. Select the starting address of EPROM
suitably. Assign the address range 80000H to 87FFFH for RAM and use two 74138 ICs decoder.
(ASSIGNMENT 3RD QUESTION)

16. Write an assembly language program to initialize programmable parallel communication


interface in the configuration given by port A and upper port C considered as input mode and
port B and lower port C considered as output port. Assume address of the control word
register as 83H.

D7 D6 D5 D4 D3 D2 D1 D0

1 0 0 1 1 0 0 0

• D7 = 1 (Indicates control word is being written)


• D6-D5 = 00 (Mode 0)
• D4 = 1 (Port A as Input)
• D3 = 1 (Upper Port C as Input)
• D2 = 0 (Port B as Output)
• D1 = 0 (Lower Port C as Output)
• D0 = 0 (Not used in Mode 0)
So, the control word in binary would be 10011000 or 98H in hexadecimal.

• ORG 100H:
• MOV DX, 83H
• MOV AL, 98H:
• OUT DX, AL:
• INT 20H:

SET 2
2 MARKS
17. Compare the flags available in 8086 with 8085.

• Common Flags: Both processors share some common flags like Sign, Zero, Auxiliary Carry, and
Carry flags.

• Additional Flags in 8086: The 8086 introduces flags like Overflow, Direction, Interrupt, and Trap
flags, which provide additional control and status information compared to the 8085.

• Purpose and Usage: The flags in each processor are used for status reporting (like zero or non-zero
results, carry, overflow) and control (like enabling interrupts, direction of string operations).

18. Classify the addressing modes of 1) MOV AX, 55H (BX) (SI) , 2) MOV AX, [2437H]

• MOV AX, 55H(BX)(SI):

• Addressing Modes: Base Register (BX), Index Register (SI), Immediate (55H).

• Usage: Used for indexed addressing with immediate offset.

• MOV AX, [2437H]:

• Addressing Mode: Direct Memory Addressing.

• Usage: Directly accesses the memory location 2437H to load data into AX

19. Write the control word to set PC0 in 8255.

Bits Description:

• D7-D6: Always set to 1 1 to select mode 1 operation.

• D5-D4: I/O Control for Port C (PC0 to PC7). 00 for PC0-PC7 as output.

• D3-D2: I/O Control for Port B (PB0 to PB7). 00 for PB0-PB7 as output.

• D1-D0: I/O Control for Port A (PA0 to PA7). 00 for PA0-PA7 as output.

• G1-G0: Mode selection bits for all three ports. 00 for mode 0 operation (basic input/output mode).

20. List the steps involved in interfacing a memory to the microprocessors.

• Selecting the appropriate memory chip

• Identifing the corrct register using address lines

• Enabling read/write buffers using control signals

21. Determine the program clock command word if external clock frequency is 2 MHz.

Formula : Input clock frequency/ Desired out[ut frequency

Input clock frequency :2Mhz

Desired outputfrequency:1kHz

2MHz/1kHz=2000000/1000=2000

22. Calculate the number of memory chips needed to design 1K byte memory if the memory chip
size is 1024x4?
• Calculate Total Storage Requirement:

• Total memory size required = 1K byte = 1,024 bytes.

• Since 1 byte = 8 bits, 1K byte = 1,024 bytes × 8 bits/byte = 8,192 bits.

• Calculate Number of Chips:

• Determine how many 1024x4 memory chips are needed to store 8,192 bits.

• Each memory chip stores 1024 words × 4 bits/word = 4,096 bits.

• Number of chips needed = Total bits required / Bits per chip.

• Number of chips needed = 8,192 bits / 4,096 bits per chip

. • Perform the Calculation: 8192/4096=2

5 MARK
23. Write an 8086 ALP to find average of two numbers.

MOV SI,500

MOV DI,600

MOV AX,0000

MOV CL,[SI]

MOV BL,CL

INC SI

ADD AL,[SI]

ADC AH,00

INC SI

DEC CL

JNZ 40E

DIV BL

MOV[DI],AX

HLT

You might also like