Professional Documents
Culture Documents
Coa 4th Lesson
Coa 4th Lesson
Coa 4th Lesson
The multiplexers of 3-state gates are performed with the buses. The
state of 14 binary selection inputs determines the control word. The
14-bit control word defines a micro-operation.
001 R1 R1 R1
010 R2 R2 R2
011 R3 R3 R3
100 R4 R4 R4
101 R5 R5 R5
110 R6 R6 R6
111 R7 R7 R7
01010 OR A and B OR
ALU Micro-Operations
STACK ORGANIZATION:
Stack is also known as the Last In First Out (LIFO) list. It is the most
important feature in the CPU. It saves data such that the element
stored last is retrieved first. A stack is a memory unit with an address
register. This register influence the address for the stack, which is
known as Stack Pointer (SP). The stack pointer continually influences
the address of the element that is located at the top of the stack.
It can insert an element into or delete an element from the stack. The
insertion operation is known as push operation and the deletion
operation is known as pop operation. In a computer stack, these
operations are simulated by incrementing or decrementing the SP
register.
Register Stack
The element C is at the top of the stack and the stack pointer holds
the address of C that is 3. The top element is popped from the stack
through reading memory word at address 3 and decrementing the
stack pointer by 1. Then, B is at the top of the stack and the SP holds
the address of B that is 2. It can insert a new word, the stack is
pushed by incrementing the stack pointer by 1 and inserting a word in
that incremented location.
The stack pointer includes 6 bits, because 2 6 = 64, and the SP cannot
exceed 63 (111111 in binary). After all, if 63 is incremented by 1,
therefore the result is 0(111111 + 1 = 1000000). SP holds only the six
least significant bits. If 000000 is decremented by 1 thus the result is
111111.
Therefore, when the stack is full, the one-bit register ‘FULL’ is set to 1.
If the stack is null, then the one-bit register ‘EMTY’ is set to 1. The
data register DR holds the binary information which is composed into
or readout of the stack.
A new element is deleted from the stack if the stack is not empty (if
EMTY = 0). The pop operation includes the following sequence of
micro-operations −
The top element from the stack is read and transfer to DR and thus
the stack pointer is decremented. If the stack pointer reaches 0, then
the stack is empty and ‘EMTY’ is set to 1. This is the condition when
the element in location 1 is read out and the SP is decremented by 1.
INSTRUCTION FORMATS
Instruction includes a set of operation codes and operands that manage with
the operation codes. Instruction format supports the design of bits in
an instruction. It contains fields including opcode, operands, and
addressing mode.
The opcode field has 1 or 2 bytes. The addressing mode field also
includes 1 or 2 bytes. In the addressing mode field, an instruction
needs only one byte if it uses only one register to generate the
effective address of an operand.
The field that directly follows the addressing mode field is the
displacement field. If an effective address for a memory operand is
computed using the displacement value, then it uses either one or four
bytes to encode. If an operand is an immediate value, then it is
located in the immediate field and it appears either one or four bytes.
ADDRESSING MODES :
Data transfer instructions move data from one place in the computer
to another without changing the data content. The most common
transfers are between memory and processor registers, between
processor registers and input or output, and between the processor
registers themselves.
a. Arithmetic instructions
b. Logical and bit manipulation
instructions
c. Shift instructions
Arithmetic Instructions
Shift Instructions
Instructions to shift the content of an operand are quite useful and are
often provided in several variations. Shifts are operations in which the
bits of a word are moved to the left or right. The bit shifted in at the
end of the word determines the type of shift used. Shift instructions
may specify either logical shifts, arithmetic shifts, or rotate-type
operations. In either case the shift may be to the right or to the left.
The logical shift inserts 0 to the end bit position. The end position is
the leftmost bit for shift right and the rightmost bit position for the
shift left.
The arithmetic shift-right instruction must preserve the sign bit in the
leftmost position. The sign bit is shifted to the right together with the
rest of the number, but the sign bit itself remains unchanged. This is a
shift-right operation with the end bit remaining the same. The
arithmetic shift-left instruction inserts 0 to the end position and is
identical to the logical shift-left instruction.
The rotate instructions produce a circular shift. Bits shifted out at one
end of the word are not lost as in a logical shift but are circulated back
into the other end.
PROGRAM-CONTROL
Instructions of the computer are always stored in consecutive memory
locations. These instructions are fetched from successive memory
locations for processing and executing.
Branch BR
Jump JMP
Skip SKP
Call Call
Return RET
These registers can work in pair to hold 16-bit data and their pairing
combination is like B-C, D-E & H-L.
Program counter
Stack pointer
Temporary register
Flag register
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
The content stored in the stack pointer and program counter is loaded
into the address buffer and address-data buffer to communicate with
the CPU. The memory and I/O chips are connected to these buses; the
CPU can exchange the desired data with the memory and I/O chips.
8085 Architecture