Hardware - Work of microprocessor Z80.

ZX Time #10
 Claptraps
───────────── ───────────────────────────
Alexander Sizenko (Alex_S)              
                                        
 How does the microprocessor execute the command?  
                                        
   When compiling this or that program, we
never wonder why one co-
The microprocessor executes the command in 4 steps.
one and the other, let's say for 6? What lies behind
these numbers? Why are there no commands to execute?
let's say in one beat or two?
For those readers who are interested
this question, and this is intended
chapter from the book "The simplest microcomputer"
L.N.Bupeeva, A.L.Dydko, V.N.Zakharova
slightly revised by the author of the article.  
                                        
                 - - -                  
                                        
   Operation of the microprocessor (MP) in real life
tion of each command of the user program
The body is based on the principle of mukponporpam-
nogo management. This means that every
this command is implemented as some
sequence of microcommands or micro-
operations leading to the required pe-
result.  (It would be great if
it was possible to program the mi-
kpopoceccop! For example partco-systems
mand. I wonder if there are such processes
ry in nature?) Read from the memory of the world
cross-processor team, or rather, 8 of them
bit binary code (opcode),
enters the command register, where it is stored
ends during the execution time
cunts. Based on the result of code decryption
teams are formed in a sequence
microcommands (mukponporpam-
we), the process of execution of which determines
divides all subsequent operations necessary
dimmable for executing a read command.
                                        
   Thus, the execution of each calculation
tannoy MP commands of the user program
carried out in a strictly defined
sequences.  In this case, execution
individual micro-operations are synchronized
in time by clock generator signals
pa.  One of the most important concepts of all
process of executing program commands
is the concept of the machine cycle. B MP
Z80 process of execution of each command
can be broken down into a number of basic operations.
Time allotted to complete the operation
accessing memory or input device
yes/output, constitutes a machine cycle. Ta-
Thus, the process of executing a command
consists of as many machine cycles as
how many accesses to memory or device
ctbam I/O is required for ee use
fullness.  The machine cycle in turn
consists of several machine cycles.
Undermachine tact implies in-
time interval corresponding to one
period of clock pulses supplied
from the synchronizer.                    
                                        
   To organize machine cycles, three
formation of strictly synchronized
bathroom in time sequence of up-
control signals that provide the right
correct data paths in strictly
certain points in time, and complete
definition of the required microoperations. As already from-
It was noted that the initial data for this
are the results of deciphering the op-
rational command code. Execution of co-
manda always begins with a reverse cycle
memory, as a result of which
The code is being read, uhtepnpetu-
controlled MP as an operation code. Let's review
start machine cycles of one sim command
oxen C1, C2, etc., and machine strokes
one cycle T1, T2, etc. This way
So, machine cycle C1 is always a cycle
team selections. Its duration is usually
- four or five bars. Subsequent
cycles usually consist of three cycles.    
B качестве примера рассмотрим команду LD A,(NNNN) (загрузить данные из ячейки памяти c адресом NNNN в аккумулятор), требующую для реализации четыре машинных цикла. На рисунке приведена временная диаграмма команды LD A,(NNNN). Первый машиный цикл С1, как и следо- вало ожидать, отведен под выборку коман- ды из памяти. При этом код операции по- мeщaeтcя, как это уже говорилось в pe-
ructp команд. Выполнение последователь- ности микрокоманд приводит к следующим действиям.In the first measure T1 contents program counter is issued via a bus buffer We transfer the addresses to the address bus. The second measure you- divided to represent time for departure beta memory. In the third measure appeared data on the data bus is sent to pe- ructp commands. In the fourth measure the sample command is completed, the operation code is the command is passed to the command decoder for micro-sequence formation operations. In this case, the increment will be contents of the program counter. The second machine cycle corresponds to reading from memory the eight least significant digits addresses that, as a result of execution this loop must be placed in pe- ructp Z. In the first measure of this cycle co- the contents of the program counter are transferred to cut the address bus buffer into the address bus. On the second clock cycle the microprocessor waits answer from memory. The third beat contains The data bus pressure is transferred to the Z register and the program counter again increases tion. The third machine cycle is similar to the second rum, except that from memory are selected and sent to the W register eight most significant bits of the address. After- The activity of microoperations is the same. In the fourth machine cycle occurs final executioncommands: accu- The simulator is loaded with data from memory by address in registers W and Z. In the first stroke of the fourth machine cycle, the contents of the W and Z registers are transferred is given via a buffer to the address bus. Bo the second beat provides time for memory response. Finally in the third beat the contents of the data bus are sent through cut buffer into the battery. Execution of co- mand completed in 13 machine cycles.

Share your thoughts about the article