Functional Block Diagram of 8085 Microprocessor
- The ALU performs the actual numerical and logical operations such as ‘add’, ‘subtract’, ‘AND’, ‘OR’ etc.
- Uses data from memory and from Accumulator to perform the arithmetic operations and always stores the result of the operation in the Accumulator.
- The ALU consists of an accumulator, flag register and temporary register.
- The accumulator is an 8-bit register that is a part of the arithmetic/logic unit (ALU). This register is used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation is stored in the accumulator.
- The accumulator is also identified as register A.
b. Flag Register
8085 has an 8-bit flag register. There are only 5 active flags.
- Flags are flip-flops that are used to indicate the status of the accumulator and another register after the completion of the operation.
- These flip-flops are set or reset according to the data condition of the result in the accumulator and other registers.
i. Sign flag(S):
- A sign flag indicates whether the result of a mathematical or logical operation is negative or positive.
- If the result is negative, this flag will be set (i.e. S=1) and if the result is positive, the flag will be reset (i.e. S=0).
ii. Zero flags (Z):
- A zero flag indicates whether the result of a mathematical or logical operation is zero or not.
- If the result of the current operation is zero, the flag will be set (i.e. Z=1) otherwise the flag will be reset (Z=0).
- This flag will be modified by the result in the accumulator as well as in the other register.
iii. Auxiliary carry flag (AC):
- In operation when a carry is generated by bit D3 and passes on to bit D4, the AC flag will be set otherwise AC flag will be reset.
- This flag is used only internally for BCD operation and is not available for the programmer to change the sequence of the program with the jump instruction.
iv. Parity flag (P):
- This flag indicates whether the current result is of even parity (no. of 1’s is even) or odd parity (no. of 1’s is odd).
- If even parity, the P flag will be set otherwise reset.
v. Carry flag (CY):
- This flag indicates whether during an addition or subtraction operation carry or borrow is generated or not.
- If carry or borrow is generated, the flag will be set otherwise reset.
2. Timing and control unit
- This unit produces all the timing and control signals for all the operations.
- This unit synchronizes all the MP operations with the clock and generates the control signals necessary for communication between the MP and peripherals.
3. Instruction register and decoder
- The instruction register and decoder are part of ALU. When an instruction is fetched from memory, it is loaded in the instruction register.
- The decoder decodes the instruction and establishes the sequence of events to follow.
- The IR is not programmable and cannot be accessed through any instruction.
4. Register Array
- The register unit of 8085 consists of
-Six general-purpose data registers B, C,D, E,H, L
-Two internal registers W and Z
-Two 16-bit address registers PC (program counter) and SP (stack pointer)
-One increment/decrement counter register
-And, one multiplexer (MUX)
- The six general-purpose registers are used to store 8-bit data. They can be combined as register pairs BC, DE, and HL to perform some 16-bit operations.
- The two internal registers W and Z are used to hold 8-bit data during the execution of some instructions, CALL and XCHG instructions.
- SP is a 16-bit register used to point to the address of data stored in the stack memory. It always indicates the top of the stack.
- PC is a 16-bit register used to point the address of the next instruction to be fetched and executed stored in the memory.
5. System bus
a. Data bus
- It carries ‘data’, in binary form, between MP and other external units, such as memory.
- The typical size is 8 or 16 bits.
b. Address bus
- It carries the ‘address’ of the operand in binary form.
- The typical size is 16-bit.
c. Control Bus
- Control Bus are various lines that have specific functions for coordinating and controlling MP operations.
- E.g.: Read/Write control line.
6. Interrupt Control
- An interrupt is a signal, which suspends the routine that the MP is doing, brings the control to perform the subroutine, completes it, and returns to the main routine.
- Maybe hardware or software interrupts. Some interrupts may be ignored (maskable), and some cannot (non-maskable).
- E.g. INTR, TRAP, RST 7.5, RST 6.5, RST 5.5
7. Serial I/O Control
- The MP performs serial data input or output (one bit at a time). In serial transmission, data bits are sent over a single line, one bit at a time.
- The 8085 has two signals to implement the serial transmission: SID (serial input data) and SOD (serial output data).