Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
8284A CLK 8
Clock READY 0
generator 8
RES
RESET 6
RDY
Wait state
generator Fig:-Insertion of wait state generator to add
wait states
Write Machine Cycle
Steps involve in write machine cycle are:
• Place on the address bus ,the address of the
location to which data is to be written
• On the data bus, place the data to be written.
• Assert the write control signal which is part of
the control bus.
• Wait until the data is stored in the addressed
location.
• De-activate the memory write signal .This ends
the memory write operation
Simplified Write Machine Cycle
T1 T2 T3 T4
Clock
Address/Status
Address/Data
WR
Instruction Cycle
• Time taken by processor to execute an instruction- specified in terms of
no. clock cycles needed to do it.
• Once instruction is fetched and ready to be executed, then it can be
decoded and execution can be set.
• Fetch-execute cycle can be divided into 6 stages
– Fetch instruction
– Decode instruction
– Calculate operand address
– Fetch operand
– Execute instruction
– Write/store result in memory
•The time for all these activities should constitute the instruction cycle.
•The BIU will separate the operation type from the operands and fetch any
operands from memory if required, and after that execution in done.
•In the execution phase, any instruction involving loading from or storing
into memory cause a read /write cycle to occur.
•An instruction which moves data between two registers, or must execute
a more complicated instruction with operands available within the
processor, is done in the Arithmetic and Logic Unit (ALU) alone.
Instruction Fetch Cycle
•The instruction is in memory and fetching it requires a memory read cycle
which takes 4 T states .
•Instruction cycle time does not include the time required to fetch the
instruction .
•For instructions which have memory operands not specified directly ,there is a
time involved in calculating the ‘effective address’.
•To increase the delay, we can use the NOP (No operation ) instruction which has no
operands and no function except to execute within 3 cycles.
•The NOP instruction is usually used to reserve space in programs ,for instructions
which may needed to be added later.
• Write a program to create a delay of 1 msec.
Soln:- MOV CX,N 4
HERE:NOP 3
LOOP HERE 17/5
• Most of the delay occurs within the loop
the total cycles of delay is =[(3+17) x N]-12.
• Total delay time =1 m sec =20N x 0.083 μsecs
• For 1 msec delay ,the value of N =602 or 25AH
• This value of N is inserted into program to create a delay of 1msec
• Generating delays in this manner is called software delays
• Application
Q) Generate a square wave of frequency 1 KHz at the output port with address 78H
• Solution:
AGAIN: MOV AL,0FFH
OUT 78H,AL
CALL DELAY_1MS
MOV AL,00
OUT 78H,AL
CALL DELAY_1MS
JMP AGAIN