Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

1) What is a Timing Diagram?

The timing diagram is the diagram which provides information about the various conditions of signals
such as high/low, when a machine cycle is being executed. Without the knowledge of timing diagram
it is not possible to match the peripheral devices to the microprocessors. These peripheral devices
includes memories, ports etc. Such devices can only be matched with microprocessors with the help of
timing diagram.
Instruction cycle:
Assume that the microprocessor is executing an instruction. Instruction cycle is nothing but the time
taken to complete the execution of that instruction by the microprocessor. The 8085 instruction cycle
consists of 1 to 6 machine cycles.
Machine Cycle:
Machine cycle is nothing but the time required to complete one operation of accessing memory, I/O. It
is also the time required to complete one operation of acknowledging an external request. One
machine cycle may consist of 3 to 6 T-states.
T-state:
T-state is nothing but one subdivision of the operation performed in one clock period. These
subdivisions are internal state of the microprocessor synchronized with system clock.
2) What is Instruction Execution Cycle:
Once a program is in memory it has to be executed. To do this, each instruction must be looked at,
decoded and acted upon in turn until the program is completed. This is achieved by the use of what is
termed the 'instruction execution cycle', which is the cycle by which each instruction in turn is
processed. However, to ensure that the execution proceeds smoothly, it is is also necessary to
synchronise the activites of the processor.
To keep the events synchronised, the clock located within the CPU control unit is used. This produces
regular pulses on the system bus at a specific frequency, so that each pulse is an equal time following
the last. This clock pulse frequency is linked to the clock speed of the processor - the higher the clock
speed, the shorter the time between pulses. Actions only occur when a pulse is detected, so that
commands can be kept in time with each other across the whole computer unit.
The instruction execution cycle can be clearly divided into three different parts, which will now be
looked at in more detail. For more on each part of the cycle click the relevant heading, or use the next
arrow as before to proceed though each stage in order.
Fetch Cycle
The fetch cycle takes the address required from memory, stores it in the instruction register, and moves
the program counter on one so that it points to the next instruction.
Decode Cycle
Here, the control unit checks the instruction that is now stored within the instruction register. It
determines which opcode and addressing mode have been used, and as such what actions need to be
carried out in order to execute the instruction in question.
Execute Cycle
The actual actions which occur during the execute cycle of an instruction depend on both the
instruction itself, and the addressing mode specified to be used to access the data that may be required.
However, four main groups of actions do exist, which are discussed in full later on.

3) What is Synchronous and Asynchronous Data transfer?


Data is transmitted between communication devices in multiples of fixed-length units, typically 8-bits.
For example, if the computer is transferring a source program, the data will be made up of a block of
8-bit binary-encoded characters. On the other hand, if the data is in the form of a compiled object code
of the program, the data will be made up of a block of 8-bit bytes. At the receiving end, the following
parameters are determined to decode and interpret the message correctly.
1. The start of each bit period.
2. The start and end of each character or byte.
3. The start and stop of each complete message block.
These three parameters are known as bit synchronization, character, or byte synchronization,
respectively.
In general, there are two transmission modes; they are synchronous and asynchronous modes. In a
synchronous mode, the transmitter and the receiver use the same clock. But in an asynchronous mode,
two independent clocks are used on either side.
Synchronous mode Asynchronous transmission is used only when the rate at which characters
generated is unknown or the transmission data rate is too low. For the transmission of a large block of
data at relatively higher bit rates, synchronous transmission is used. In synchronous mode, the sending
and receiving devices are synchronized with a common clock signal. This eliminates the need for the
start and stop bits. The complete block of data is transmitted with fixed time interval between the bits.
Before the start of transmission, clocks at both ends are to be synchronized. This is achieved by
sending special character bytes called sync bytes or sync charactersbetween the sender and the
receiver. The sender informs the receiver about the start of a block. The receiver figures out the start of
each character by knowing the coding scheme used. If the sender is idle or does not transmit any
character, the receiver searches for the next group of sync characters. The devices are then
resynchronized to receive the next block of characters. The block length varies from few bytes to
many hundreds of bytes. The most commonly used protocol is the BISYNC or Bit Synchronous
Protocol.

Asynchronous mode Asynchronous mode is also known as start-stop mode. This mode is used when
data to be transmitted is generated at random intervals. For example, when a user communicates with a
computer using a keyboard, the time interval between two successive keystrokes is random. This
means that the signal on the transmission line will be in idle state for a long time interval between
characters. With this type of communication, the receiver must be able to resynchronize at the start of
each new character received. To accomplish this, each transmitted character or byte is encapsulated
between an additional start bit and one or more stop bits. This mode is mainly used for the
transmission of characters between a keyboard and a computer. Asynchronous transmission can also
be used for the transmission of a block of characters or bytes between two computers. The time
interval between successive characters is a variable entity.

4) What is Two Pass Assembler?


An assembler is a translator, that translates an assembler program into a conventional machine
language program. Basically, the assembler goes through the program one line at a time, and generates
machine code for that instruction. Then the assembler procedes to the next instruction. In this way, the
entire machine code program is created. For most instructions this process works fine, for example for
instructions that only reference registers, the assembler can compute the machine code easily, since the
assembler knows where the registers are.

Consider an assembler instruction like the following:


JMP LATER
...
...
LATER:
This is known as a forward reference. If the assembler is processing the file one line at a time, then it
doesn't know where LATER is when it first encounters the jump instruction. So, it doesn't know if the
jump is a short jump, a near jump or a far jump. There is a large difference amongst these instructions.
They are 2, 3, and 5 bytes long respectively. The assembler would have to guess how far away the
instruction is in order to generate the correct instruction. If the assembler guesses wrong, then the
addresses for all other labels later in the program woulds be wrong, and the code would have to be
regenerated. Or, the assembler could alway choose the worst case. But this would mean generating
inefficiency in the program, since all jumps would be considered far jumps and would be 5 bytes long,
where actually most jumps are short jumps, which are only 2 bytes long.
It scans the code twice. The first time, just count how long the machine code instructions will be, just
to find out the addresses of all the labels. Also, create a table that has a list of all the addresses and
where they will be in the program. This table is known as the symbol table. On the second scan,
generate the machine code, and use the symbol table to determine how far away jump labels are, and
to generate the most efficient instruction.
This is known as a two-pass assembler. Each pass scans the program, the first pass generates the
symbol table and the second pass generates the machine code.

You might also like