Sie sind auf Seite 1von 6

Homework #1

Microcontroller’s and
Microprocessor’s
Intel 8085

by José Sebastián Pérez Chapa.

Página | 63
Q1: (i) Explain with the help of timing diagram:
(a) Instruction Fetch (FC) and
(b) Execute (EC)

The most common way at a microprocessor works to execut an instruction is


known as Instruction Cycle. An instruction cycle is consists of a Fetch Cycle
and Execute Cycle. The execution of any 8085 program consists of a sequence
of READ and WRITE operations. Of which each transfer a byte of data
between the 8085 A and a particular I/O device address or memory address.

(ii) Explain how a program is executed in 8085 microprocessor.


The microprocessor 8085 start with the program counter, it´s loads the 16-bit
memory address of the instruction on the address bus. Then the control unit
sends the MEMR signal to tell the memory that the microprocessor wants to
read the memory. after of this process the opcode is fetch to the instruction
decoder and machine cycle encode from instruction register, and finally
decoded opcode information is sent to the control unit. With this the control
unit can generate the appropriate control signal to execute the instruction.

Q2: Explain Opcode fetch operation with help of timing diagram.


Opcode is an operation perform by the microprocessor. Each instruction of
the processor has one-byte Opcode. The Opcode are stored in memory. So,
the processor executes the Opcode fetch machine cycle to fetch (Read) the
Opcode from memory. Hence, every instruction starts with Opcode fetch
machine cycle. The time taken by the processor to execute the Opcode fetch
cycle is 4T or 6T.

Página | 1
Q3: Explain Memory Read and Write operation with the help of timing diagram.
The memory read machine cycle is executed by the processor to read a data
byte form memory. The processor takes 3T states to execute this cycle.

T1 State: In the T1 state, the microprocessor sends the low byte address on
AD0-AD7 lines and high byte address on A8 to A15 lines. ALE is asserted
high to enable the address latch; the other control signals are asserted as
follows. IO/M=0, S0=0. S1=1.
T2 State: In the T2 state, the microprocessor sends the RD to the memory.
When RD is asserted to low the memory is enabled for placing the data on
the data bus. The time allowed for memory to output the data is the time
during which read remains low.

Página | 2
T3 State: In third T3 state, the read signal is asserted high. On the rising edge
of read signal the data is latched into microprocessor other control signals
remains in the same state until the next machine cycle.
Q4: Explain I/O Read and Write operation with the help of timing diagram.
I\O read machine cycle is executed by the processor to read a data byte form
input device. The processor takes 3T states to execute this cycle.

T1 State: In the T1 state, the microprocessor sends the low byte address on
AD0-AD7 lines and high byte address on A8 to A15 lines. ALE is asserted
high to enable the address latch. The other control signals are asserted as
follows. IO/M=1, S0=0, S1=1.
T2 State: In the T2 state, the microprocessor sends the RD to the memory.
When RD is asserted to low the memory is enabled for placing the data on
the data bus. The time allowed for memory to output the data is the time
during which read remains low.
T3 State: In third T3 state, the read signal is asserted high. On the rising edge
of read signal the data is latched into microprocessor other control signals
remains in the same state until the next machine cycle.
Q5: How many address lines are required to access:
(i) 4 K memory and
(ii) 100 locations
4 K memory needs 12 address lines.
8 bit per locations, equal to 10 address lines.

Página | 3
Q6: Explain Program Counter (PC) function with the help of an example.
PC is a 16-bit register. It contains a memory address. PC contains that very
memory address from where the next instruction is to be fetched for
execution. Suppose the PC contents are 8000H, then it means that the 8085
Desires to fetch the instruction Byte at 8000H. After fetching the Byte at
8000H, the PC is automatically incremented by 1. This way 8085 becomes
ready to fetch the next Byte of the instruction (in case instruction fetch is
incomplete), or fetch the next opcode (in case instruction fetch is over).
Q7: Write the sequence of execution of instruction PUSH, POP, and PSW.
2000 LXI SP, 2099H Load SP with an arbitrary address, say 2099 to initialize stack.
2003 LXI H, 42F2H Load any 16-bit value in the HL register pair, say 42F2.
2006 PUSH H The content of the HL register pair are pushed (written) into stack.
2010 POP D Contents of two locations form stack are loaded into DE pair.

Q8: Write and explain a program in assembly language of 8085 microprocessor also
provide flow diagram of each:
(a) Addition of two 8-bit numbers (15H and 58H) and answer has to be in 8
bit.
(b) Find 1's complement of 8-bit number.
(c) To find larger of two number.
(d) To count from '0' to 'g' with one-second delay between each count. At the
count 'g' the count should reset to '0' and repeat the sequence continuously.
Assume clock frequency of system is 1 MHz’s
$MOD51

OR G 0000H

MOV DPTR, #010H

MOVX A, @DPTR

ADD A, B

INC DPTR

INC DPTR

MOVX @DPTR, A

CLR A

AD DC A, #00H

INC DPTR

MOVX @DPTR, A

Página | 4
Q10: Write a program in 8085 assembly language sequence of 8085 microprocessor:
Assume that three switched controls 8 LEDs system;

• 4 LEDs called Low Bank and other 4 LEDs are called High Bank.
• Switches are connected to Port 1 and LEDs are connected to Port 2.
• SW0 controls system ON/OFF.
• if the system is ON:
• SW1 controls (all lights ON or OFF) Low LED Bank (4 LED).
• SW2 controls (all lights ON or OFF) High Led Bank (4 LED).

MVI A, 80H
OUT CNTRL
START:
MVI A, 00H
OUT PORTB
CALL DELAY
MVI A, FFH
OUT PORTB
CALL DELAY
JMP START
DELAY:
MVI B, 05
L1: MVI C, FFH
L2: DCR C
JNZ L2
DCR B
JNZ L1
RET

Página | 5

Das könnte Ihnen auch gefallen