0% found this document useful (0 votes)
42 views18 pages

EEE Lab Questions Key

The document outlines the laboratory exercises for EE3413, focusing on microprocessor and microcontroller operations, specifically using the 8085 microprocessor. It includes pre-lab and post-lab questions covering topics such as arithmetic operations, addressing modes, instruction sets, and interfacing concepts. Additionally, it discusses the role of various registers, flags, and the importance of ADC and DAC in microprocessor systems.

Uploaded by

helen jenefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views18 pages

EEE Lab Questions Key

The document outlines the laboratory exercises for EE3413, focusing on microprocessor and microcontroller operations, specifically using the 8085 microprocessor. It includes pre-lab and post-lab questions covering topics such as arithmetic operations, addressing modes, instruction sets, and interfacing concepts. Additionally, it discusses the role of various registers, flags, and the importance of ADC and DAC in microprocessor systems.

Uploaded by

helen jenefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

EE3413 - MICROPROCESSOR AND MICROCONTROLLER

LABORATORY

1) 8 BIT ARITHMETIC OPERATIONS USING 8085

Pre Lab Questions:


1.What is Accumulator.

Accumulator is a 8 bit register. Any data input/output to/from the microprocessor takes place via the
accumulator (register). It is generally used for temporary storage of data and for the placement of final
result of arithmetic/logical operations.
Accumulator (ACC or A) register is extensively used for arithmetic, logical, store and rotate
operations.
2. What is Microprocessor.
Ans It is a program controlled semi conductor device (IC), which fetches, decodes and execute
instructions.
3.What are the Addressing modes of 8085.
Register:- Data is provided through the registers. Or operand is only register(s). Example: MOV Rd,
Rs.
Register indirect:- Operand M or register pair. Example: MOV A,M; LDAX B; STAX D; MVI M,32H
(exception for immediate addressing mode).
Direct:- Operand 8-bit port address or 16-bit memory address. Example: IN 84H, OUT 84H, all
CALLs.
Immediate:- Instruction having the letter I. Or immediate data to the destination provided. Also all
jump instructions as the meaning is jump immediately. Example MVI M, 2H; ADI 47H; LXIH 2050
(exception for direct addressing mode).
Implicit:- No operand. Example: XCHG.
4.How does the microprocessor communicate with the memory and input/output devices?
Ans. The microprocessor communicates with the memory and the Input/Output devices via the three
buses, viz., data bus, address bus and control bus.
5.Write opcode for following instructions.
 MVI A, data 1  ADD B
 MVI B, data 2  INR C
6. What is a mnemonic?
Ans. It is very difficult to understand a program if it is written in either binary or hex code.
Thus the manufacturers have devised a symbolic code for each instruction, called a mnemonic.

7.Explain the following Arithmetic Instructions.


 ADD  SUB  INC
 ADI  SUI  DCR
 ADC  SUBB  DCX
 ACI  SBI  DAD
8.What are all the Register Pair available in 8085.
The 8085 microprocessor has three register pairs: BC, DE, and HL
9.What is the purpose of registers?
Registers are small, high-speed storage locations within a CPU that temporarily hold data and
instructions needed for immediate processing, allowing the processor to quickly access frequently
used values without having to retrieve them from main memory, thus speeding up
computations; essentially acting as a temporary workspace for the CPU during instruction execution
10. Define opcode and operand?
Opcode(operation code) is the part of an instruction that identifies a specific operation.
Operand is a part of instruction that represents a value on which the instruction acts.
1.Post Lab Questions:

1. What is LHLD 5500H instruction?(Load data to HL register)


2. Explain the instruction XCHG (Move the data from one register to other)
3. Compare B with accumulator and update carry flag-( CMP B)
4. Jump on carry to specified address- (JC L1)
5. Store the content of accumulator in the address 4152 – (STA 4152 )
6. Move the content of C register to accumulator – (MOV A,M)
7. How do you clear the previous data in the Register C? (MVI C,00)
8. Analyse the following example and write the assembly code.

(2501 H) = 99H
(2502 H) = 39H
Result (2503 H) = 99H + 39H = D2H
Since,
1 0 0 1 1 0 0 1 (99H)
+ 0 0 1 1 1 0 0 1 (39H)
1 1 0 1 0 0 1 0 (D2H)
Ans:
LXI H, 2501H : "Get address of first number in H-L pair. Now H-L points to 2501H"
MOV A, M : "Get first operand in accumulator"
INX H : "Increment content of H-L pair. Now, H-L points 2502H"
ADD M : "Add first and second operand"
INX H : "H-L points 4002H"
MOV M, A : "Store result at 2503H"
HLT : "Stop"

9.Write a code for Subtracting two 16-bit numbers with the following data.

(2500H) = 19H
(2501H) = 6AH
(2504H) = 15H (2503H) = 5CH
Result = 6A19H - 5C15H = OE04H
(2504H) = 04H
(2505H) = OEH

Program
LHLD 2500H : "Get first 16-bit number in HL"
XCHG : "Save first 16-bit number in DE"
LHLD 2502H : "Get second 16-bit number in HL"
MOV A, E : "Get lower byte of the first number"
SUB L : "Subtract lower byte of the second number"
MOV L, A : "Store the result in L register"
MOV A, D : "Get higher byte of the first number"
SBB H : "Subtract higher byte of second number with borrow"
MOV H, A : "Store l6-bit result in memory locations 2504H and 2505H"
SHLD 2504H : "Store l6-bit result in memory locations 2504H and 2505H"
HLT : "Terminate program execution"

10.What is Clock Speed ?


Clock speed is measured in the MHz and it determines that how many instructions
a processor can processed. The speed of the microprocessor is measured in the
MHz or GHz.
2) Programming with control instructions:
a) Increment / Decrement,
b) Ascending / Descending order,
c) Maximum / Minimum of numbers,
d) Rotate instructions,
e) Hex / ASCII / BCD code conversions.

Pre Lab Questions:


1.Write the MNEMONICS to move immediate data to accumulator. MVI A, 04
2.Explain STA 5001 command

Before After

(A) ABH ABH

(5001H) CDH ABH

3. What an instruction consists of?


Ans. An instruction consists of an operation code (called ‘opcode’) and the address of the data
(called ‘operand’), on which the opcode operates.
Operation code (opcode) Address of data (operand)
Field 1 Field 2
4. What is meant by instruction?
Ans. An instruction is a command which asks the microprocessor to perform a specific task
or job.
5.How many different instructions mP 8085 has? What is an instruction set?
Ans. 8085 microprocessor has a total of 74 different instructions for performing different
operations or tasks.
The entire different instructions that a particular microprocessor can handle is
called its instruction set.
6.What is meant by assembly language programming?
Ans. Programming a microcomputer by writing mnemonics is known as assembly language
programming.
7.What is machine language programming?
Ans. Programming a computer by utilising hex or binary code is known as machine language
Programming
8. Give one example each of the different types of instructions.
Ans. Instructions can be of (i) direct (ii) immediate (iii) implicit type. Examples of each
type follows:
(i) direct type : LDA 4000
(ii) immediate type : MVI A, 1F
(iii) implicit type : ADD C
9. In what other way HL pair can be used?
Ans. HL register pair can be used as a data pointer or memory pointer.
10. What language a microprocessor understands?
Ans. Microprocessor understands only binary language.
2. Post lab questions:

1.Describe the (status) flag register of 8085.


It is an 8-bit register in which five bit positions contain the status of five condition flags
which are Zero (Z), Sign (S), Carry (CY), Parity (P) and Auxiliary carry (AC). Each of these
five flags is a 1 bit F/F. The flag register format is shown in Fig. 2.6:
D7 D6 D5 D4 D3 D2 D1
D0
S Z X AC X P X
CY
Fig. The flag register format
Sign (S) flag: – If the MSB of the result of an operation is 1, this flag is set, otherwise
it is reset.
Zero (Z) flag:– If the result of an instruction is zero, this flag is set, otherwise reset.
Auxiliary Carry (AC ) flag:– If there is a carry out of bit 3 and into bit 4 resulting from
the execution of an arithmetic operation, it is set otherwise reset.
This flag is used for BCD operation and is not available to the programmer to change
the sequence of an instruction.
Carry (CY) flag:– If an instruction results in a carry (for addition operation) or borrow
(for subtraction or comparison) out of bit D7, then this flag is set, otherwise reset.
Parity (P) flag:– This flag is set when the result of an operation contains an even
number of 1’s and is reset otherwise.

2.What happens when HLT is executed in software?


All the buses go into the tri-state on execution of HLT instruction.

3.Which are the sixteen bit registers of 8085.


Ans. 8085 has three (3) sixteen bit registers—Program Counter (PC), Stack Pointer (SP) and
Incrementer/Decrementer address latch register.

4.What are the temporary registers of 8085?


Ans. The temporary registers of 8085 are temporary data register and W and Z registers. These
registers are not available to the programmer, but 8085 uses them internally to hold
temporary data during execution of some instructions.

5.What is the role of Rotate instruction?


ROTATE is a logical operation of the 8085 microprocessor. It is a 1-byte instruction. This instruction
does not require any operand after the opcode. It operates the content of the accumulator and the result
is also stored in the accumulator. The Rotate instruction is used to rotate the bits of accumulator.

6. What are the types of ROTATE Instruction?


There are 4 categories of the ROTATE instruction: Rotate accumulator left (RLC), Rotate
accumulator left through carrying (RAL), Rotate accumulator right (RRC), Rotate accumulator right
through carry (RAR). Among these four instructions; two are for rotating left and two are for rotating
right.
7.Explain RLC.
Rotate accumulator left In this instruction, each bit is shifted to the adjacent left position. Bit D7
becomes D0. Carry flag CY is modified according to the bit D7. For example:-
A = D7 D6 D5 D4 D3 D2 D1 D0
A = 10101010; CY=0 //before the instruction
A = 01010101; CY=1 //after 1st RLC
A = 10101010; CY=0 //after 2nd RLC

8. Write the concept to find the smallest element in an array.

1) Load the content from memory location


2) Move content of Accumulator into Register B
3) Load the content from Memory location
4) Compare the content of Register B
5) If carry flag is equal to 1 go to step 7
6) Move content of Register B into Accumulator
7) Store the content into Memory
8) End of program

9. Write down the instructions that load H-L register pair by the contents of
memory location 3500 H. Then move the contents to register C.
Ans. The corresponding instructions are
LXI H, 3500 H fi execution of this instruction loads H-L register pair with
the contents of memory location 3500 H.
and MOV C, M fi execution of this instruction moves the contents of
memory location 3500 H to register C.
10. What is a bus?
Ans. A bus is a bunch of wires through which data or address or control signals flow.
3. Interface Experiments:
a) A/D Interfacing.
b) D/A Interfacing.
c) Traffic light controller.
Pre lab questions:
1) What is ADC?
 Analog-to-digital converter (ADC)
 An electronic circuit that converts analog signals into digital numbers
 ADCs are used to measure signals like temperature, pressure, acceleration, and speed.
 ADCs are essential because digital signals are easier to store, manipulate, and transmit than
analog signals.

2) Why ADC is used in the microprocessor bused system ?


Most of the information carrying signals such as voltage, current, charge, temperature, pressure and
time are available in the analog form. However, for processing, transmission and storage purposes,
it is often more convenient to express such signals in the digital form. When expressed in the digital
form, they provide better accuracy and reduce noise.
Moreover, the development in the microprocessor technology has made it compulsory to process
data in the digital form and hence ADC is used in the microprocessor based systems.
3) Why ADC is used in the microprocessor bused system ?
Digital to analog (D/A) converter is used when a binary output from a digital system must be
converted to some equivalent analog voltage or current. For example, if in a particular system a
computer is used as a controller, the controlling signal produced by the computer is always digital.
The system to be controlled requires the analog signal. Hence in between the computer and the
system to be controlled the digital to analog converter is must.
4) What is DAC?
A DAC (Digital-to-Analog Converter) is a device that changes digital audio signals into analog
audio signals.
5) What is the purpose of SOC signal?
The SOC input to tell the ADC when to start the conversion.
6) What is the purpose of EOC signal?
The EOC output to announce when the conversion is complete.
7) What is the basic idea behind the generation of square waveforms?
The basic idea behind the generation of waveforms is the continuous generation of Analog output of
DAC. With 00(HEX) as input to DAC2, the analog output is -5V. Similarly, with FF (Hex) as input,
the output is +5V. Outputting digital data 00 and FF at regular intervals, to DAC2, results in a
square wave of amplitude I5 Volts,

8) What is programmable peripheral device?


If the function performed by the peripheral device can be altered or changed by a program
instruction then the peripheral device is called programmable device. It have control register. The
device can be programmed by sending control word in the prescribed format to the control register.
9) What is LHLD addr?
load H - L pair direct.
10) What is MOV M,r ?
move the content of register to memory.
3. Post Lab Questions:

1) Explain ALU (Arithmetic and logic unit):-


The ALU performs the arithmetic and logical operation, addition, subtraction, logical AND, OR,
EXOR, Complement, Increment, Decrement, shift, clear.
2) Purpose of PC in 8085?
PC contains the address of next instruction.
3) Explain the addressing mode of MVI r,data? Ans: immediate
4) Explain LXI rp,data ? Ans: load register pair immediate.
5) Explain ADI data? Ans: Add immediate data to accumulator
6) What is INX rp? Ans: Increment register pair.
7) Why data bus is bi-directional?
The microprocessor is to fetch (read) the data from memory or input device for processing and after
processing it has to store (write) the data to memory or output devices. Hence the data bus is bi-
directional.
8) How the mnemonics written in assembly language are translated into binary?
The translation from assembly language (i.e., mnemonics) into binary is done either
manually (known as hand (or manual) assembly) or by a program called an assembler.
9) What the instruction DAD H stands for?
On executing the DAD H, the content of HL register pair is multiplied by 2. As an
example if
H 04 | 20 L
Then DAD H makes the content of HL as follows:
H 08 | 40 L
10)What is the purpose of CLK signal of 8085?
The CLK (out) signal obtained from pin 37 of 8085 is used for synchronizing external devices.
4. Stepper motor controller interface.
Pre lab questions:
1) What is stepper motor? And how it works?
A stepper motor is a type of electric motor that rotates in a series of small, precise steps. It's used in
applications that require precise positioning and speed control.
 A stepper motor has a stationary part called the stator and a moving part called the rotor.
 The stator has coils of wire that produce magnetic fields.
 The rotor has permanent magnets or teeth that interact with the stator to produce motion.
 An external control circuit sends electrical pulses to the stator's coils.
 The order and timing of the pulses determine the direction and distance of each step.
2) What is step angle?
The step angle of the stepper motor can be defined as the angle at which the motor’s rotor turns
once single pulse is given to the stator’s input.
3) What is resolution of a motor?
The resolution of the motor can be defined as the number of steps of the motor and the number of
revolutions of the rotor.
Resolution = Number of Steps/Number of Revolution of the Rotor
4) What are the applications of stepper motor with 8085?
Robotics: Precise movement of robot arms,
CNC machines: Controlled movement of cutting tools, and
Printers: Precise paper feed mechanism.
5) What is motor driver ?
A motor driver, also known as a control motor, is an electronic device or module that controls and
manages the operation of an electric motor. It serves as an interface between a microprocessor or
other control system and the motor itself, enabling precise control of the motor's speed, direction,
and other parameters.
6) Name one motor driver circuit IC. (ULN2003)
7) Explain IN and OUT instructions in the 8085 microprocessor.
The IN and OUT instructions in the 8085 microprocessor move data between the microprocessor
and input/output (I/O) devices. The IN instruction reads data from an I/O port and loads it into the
accumulator, while the OUT instruction copies data from the accumulator to an I/O port.
 IN: Reads data from an I/O port and loads it into the accumulator
 OUT: Copies data from the accumulator to an I/O port
8) What is a bus?
A bus is a bunch of wires through which data or address or control signals flow.
9) What is the operating frequency of 8085?
8085 operates at a frequency of 3 MHz, and the minimum frequency of operation is 500 kHz.
10) What are the widths of data bus (DB) and address bus (AB) of 8085?
The width of DB and AB of 8085 are 8-bits (1 byte) and 16-bits (2 bytes) respectively.

4. Post lab questions:

1. Define bit, byte and word.


Bit is either 0 or 1.
Byte is group of 8 bits.
Word is group of 16 bits.
2. What is a port?
The port is a buffered I/O, which is used to hold the data transmitted from the processor to I/O device or
vice-versa.
3. What is 8255?
It is PPI- Programmable Peripheral Interface. It is used to connect I/O devices to microprocessor and
supports parallel communication.
4. What is meant by Polling?
Polling or device Polling is a process which identifies the device that has interrupted the
microprocessor.
5. What is meant by Interrupt?
Interrupt is an external signal that causes a microprocessor to jump to a specific subroutine.
6. Why interfacing is needed for 1/0 devices?
Generally I/O devices are slow devices. Therefore the speed of I/O devices does not match with the
speed of microprocessor. And so an interface is provided between system bus and I/O devices.
7. Why EPROM is mapped at the beginning of memory space in 8085 system?
In 8085 microprocessor, after a reset, the program counter will have OOOOH address. If the monitor
program is stored from this address then after a reset, it will be executed automatically. The monitor
program is a permanent program and stored in EPROM memory. If EPROM memory is mapped at the
beginning of memory space, i.e., at OOOOH, then the monitor program will be executed automatically
after a reset.
8. What is processor cycle (Machine cycle)? The processor cycle or machine cycle is the basic
operation performed by the processor. To execute an instruction, the processor will run one or more
machine cycles in a particular order.
9. What is Instruction cycle? The sequence of operations that a processor has to carry out while
executing the instruction is called Instruction cycle. Each instruction cycle of a processor indium
consists of a number of machine cycles.
10.What is the function of ADC R?
This instruction add the contents of register R carry flag and accumulator and stored the result in
accumulator. EX. – ADC B
5. Displaying a moving/ rolling message in the student trainer kit’s output
device.
Pre lab questions:

1) Which type of architecture 8085 has?


8085 has Von Neumann architecture.
2) How are high level languages converted into binary?
The high level languages are converted into their corresponding binary by means of
another program, called either a compiler or an interpreter.
3) What is seven segment display?
A seven-segment display is an electronic device that displays numbers and letters using seven
segments. It's a popular way to display numbers on digital clocks, calculators, and other electronic
devices.
4) How seven segment display works?
 A seven-segment display is made up of seven segments, each with two states: on and off.
 Each segment is labelled with a letter, A–G.
 By turning on and off different combinations of segments, you can display numbers and letters.
 For example, to display the number 4, you turn on segments b, c, f, and g.
5) Write the Truth table of seven segment display.
6) Write about 8279?
The Intel 8279 is a programmable keyboard and display controller chip that connects a keyboard and
display to a microprocessor. It was developed to interface with the Intel 8085, 8086, and 8088
microprocessors.
7) What are the two most important functions performed by 8279?
The two most important functions performed by 8279 are as follows:
o It scans the keyboard, then detects the key press and transmits to the CPU information which
corresponds to the particular key pressed.
o It puts out data received from the CPU, for use by the display devices.

8) What is the 2 key lockout mode?

In the 2-key lockout mode, if two keys are pressed simultaneously, only the first key is recognized.
In the N-key rollover mode, simultaneous keys are recognized and their codes are stored in FIFO.
The keyboard section also has an 8 x 8 FIFO (First In First Out) RAM.

9) What are the various input modes in which 8279 operate?


There are three input modes in which 8279 operates:
 Scanned Keyboard Mode
 Scanned Sensor Matrix Mode
 Strobed Input Mode.
10) How many character definitions are possible using 8279?
A maximum of 256 character definitions are possible using 8279.

5.Post lab Questions:


1) State the options available in the display mode.
The available options are:
 Display format—either left entry (also known as typewriter mode), or right entry (also
known as calculator mode).
 Number of display characters: eight or sixteen.
 Organisation of characters—Single 8-bit or dual 4-bit type.
2) Discuss the Left Entry (Typewriter) Mode of Display format.
In the left entry (or typewriter) mode, the first entry goes to address 0, the second entry
to address 1 and so on. The first entry goes to the left most display position. The second
entry to the just right of the earlier one. Thus the 16th entry goes to 15th address
position. It is to be remembered that the 17th entry goes to the RAM address 0 again,
18th entry goes to RAM address 1 etc,
3) When the CPU is actually involved for the scan and display functions to be
realised?
For the above two functions to be realised, CPU involvement is required only when data
is actually transmitted to or received from the CPU.
4) What is the condition called N-Key Rollover?
In this case, the debounce circuit waits for two scans after the first key press. It then checks whether
key is still in the pressed condition or not. If the answer is yes, then the data corresponding to the key
press is taken into RAM of 8279. No limit is there to the number of key presses. For simultaneous
key presses, data are entered according to the order of key press. If within a single debounce cycle,
two keys are found pressed, the error flag is set and data entry into the RAM is prohibited. The error
flag can be read from the FIFO STATUS word and can be cleared by a CLEAR command (CF = 1).
5) Name the special purpose registers of 8085.
The special purpose registers used in 8085 microprocessor are:
Accumulator register (A)
Program counter register (PC)
Status (or Flag) register
Stack pointer register (SP)
6) Mention and clarify the functions needed for peripheral interfacing.
The important functions are: buffering, address decoding, command decoding and timing
and control. Buffering is necessary to increase drive and also to synchronise data exchange
between the microprocessor and peripheral. A particular I/O is selected with the help of address
decoding. Command decoding is needed for some special I/Os that perform jobs other than data
transfers—e.g. rewinding a tape drive.For coordinating the above three, timing and control is needed.
7) In how many categories the interfacing peripherals are classified.
The interfacing peripherals are classified into two categories:
General purpose peripherals.
Special purpose peripherals.

8)Give some examples of general purpose and special purpose


peripherals.
Examples of some general purpose peripherals are:
Input/output ports
Programmable Interrupt Controller (PIC)
Programmable interval timer
Programmable communication interface
Programmable DMA interface
Multipurpose programmable device.
While some of the special purpose peripherals are:
Programmable CRT controller
Programmable floppy disk controller
Programmable keyboard and display interface.
9)Why it is relatively easy to interface memories than I/O devices?
Elaborate.
It is relatively easy to interface a memory with a processor because memories
are usually
manufactured with the same technology as those of the CPUs and they are
compatible
to the CPUs with regard to speed and electrical compatibility.
But when an I/O device is interfaced with a processor, the following
incompatibilities
may arrive. These are:
Speed incompatibility.
Format incompatibility.
Electrical characteristic incompatibility.
The first incompatibility arises because in many cases the I/O devices are slower
than
the processor so that a situation may arise when the processor is in a position to
accept data but the peripheral, because of its slow nature, is unable to provide
valid data.
10) Why crystal is a preferred clock source?
Because of high stability, large Q (Quality Factor) & the frequency that doesn’t
drift with aging.
Crystal is used as a clock source most of the times.

You might also like