More topics in 8085 Microprocessors Course

Understanding the 8085 Architecture

Microprocessors are used almost everywhere. Some common household items where you are likely to find a microprocessor are washing machines, microwave ovens, laptops, digital clocks and smartphones.

There are many varieties of microprocessors available in the market. These microprocessors are the brainchildren of major chip manufacturing companies like Intel, AMD, etc. And one of the things that set the microprocessors of these major manufacturers apart is their architecture. In this post, we will learn about what the architecture of a microprocessor constitutes. We will look at the Intel 8085’s architecture. And we will compare this ‘old’ architecture with the newer ARM 7 architecture.

A bit of microprocessor history

The first microprocessor introduced was the 4-bit 4004 microprocessor, launched in 1971 by Intel. Having the word size limited to 4 bits, this microprocessor could represent signed numbers in a tiny range, extending from -8 to 7 only. Thus, this was not really useful for any arithmetic operations. However, it found its application in controlling devices.

Following closely, the first 8-bit microprocessor, Intel 8008, was developed in 1972.  But this microprocessor was limited to a minimal functionality, performing only a small set of simple instructions, and thus a better model was needed. Intel 8080 was the first 8-bit processor which had made a mark in the commercial applications.

The Intel 8085 is a successor of the Intel 8080, which was developed more for efficient 8-bit operations and working.

Intel 8085
Intel 8085

What is Processor Architecture?

The architecture of a processor is the layout of its internal components and their relative functioning. Architectures differ between processor families; each family has its own distinct architecture. For example, the x86 architecture is Intel’s architecture that was first introduced in the 8086 microprocessor. The ARM architecture of the ARM processors. The MIPS architecture of MIPS technologies and so on.

The assembly language is programming view of the architecture of a given processor. Each processor has its own assembly language. Thus, when you study any assembly language, you learn the architecture of a given processor. And that is one of the reasons that embedded system pros suggest learning machine/assembly level programming. It gives you an understanding of the internal ‘wiring’ of a microprocessor.

We’ll be learning to program the 8085 using assembly language later in this 8085 course.

Are modern microprocessor architectures similar to the 8085 architecture?

This is a prevalent question that a lot of new learners have. “Why should I study the 8085? It’s too old.”

The answer is, yes, it is too old. You might probably never even use an 8085 in your career. However, it’s one of the easiest microprocessors to learn. Consequently, it sets the foundational knowledge towards understanding more complex microprocessor architectures.

Of course, the architectures and the instruction sets have evolved quite a bit from the days of 8085. However, the terminologies and the basic functions of a lot of the elements still remain the same.

For example, modern processors still have registers and ALUs. But, in addition, they also have modern elements like floating point units and complex circuitry that allows hyperthreading. The point is, understanding the 8085 will equip you with the basics towards understanding processor architectures.

Think of studying 8085 as Level 0 of a video game. The one where you get acquainted with the controls and the game environment.

The Architecture of the 8085

Before we begin with the main architectural block diagram of the 8085, let us discuss the key features of this processor.

  • The Intel 8085 is an 8-bit general-purpose microprocessor.
  • It has an 8-bit data bus. This means that 8 bits of data can flow around in the innards of the microprocessor.
  • Apart from the data bus, it also has a 16-bit address bus, which addresses up to 64KB.
  • It also has a 16-bit program counter & a 16-bit stack pointer.
  • There are six 8-bit registers which are arranged in pairs: BC, DE, HL.
  • It requires a voltage supply of +5V to operate at 3.2MHZ single-phase clock frequency
  • The Intel 8085 comes as a 40-pin IC package.

The 8085 is based on Von-Neumann architecture, where the data and instructions are in the same memory space without any distinction between them.

8085 Architecture
8085 Architecture

A lot of components, right? Don’t get overwhelmed. It will become easier as we progress.

Clearly, we can see the different functional units in the architecture:

  • Accumulator
  • Arithmetic and Logic Unit
  • General-purpose register
  • Program counter
  • Stack pointer
  • Temporary register
  • Flag register
  • Instruction register and decoder
  • Timing and control unit
  • Serial Input/output control
  • Interrupt Control
  • Address buffer and address-data buffer
  • Address bus and data bus

We shall see the explanation of each of these parts in the next section.

But now, for the sake of relevance, check out this fairly modern ARM 7 architecture and compare it with the 8085’s architecture. Go ahead, really look and stare at them. We will discuss the commonalities towards the end of this post.

ARM 7 Architecture
ARM 7 Architecture

What does each component of the 8085 do?

Accumulator

The accumulator sometimes referred to as ‘Acc’, is an 8-bit register which is connected to the internal data bus and the ALU. The outcome of the operations carried out by the ALU (the Arithmetic and Logical Operations) are stored in the accumulator. The accumulator is also referred to as register A.

Arithmetic Logical Unit

The primary functioning of the ALU is arithmetic & logical operations – these include addition, incrementing, subtraction, decrementing, logical tasks like OR, AND, XOR, complement, left shift or the right shift. It uses the data from memory and always stores the result of all operations in the Accumulator.

Address bus and data bus

The data bus carries data to be stored in the system. It is a bidirectional bus, whereas the address bus carries the location to where the data should be stored and is unidirectional.

Instruction Register and Decoder

  • The instruction register and decoder can be considered as a part of the ALU.
  • This is an 8-bit register which is linked to the instruction cycle of the microprocessor.
  • When an instruction is fetched from memory, it is loaded into the instruction register.
  • The decoder decodes this instruction and establishes the corresponding sequence of events to be followed.
  • The IR is non-programmable and cannot be accessed through any instructions.

General-Purpose Registers

The Intel 8085 has six general-purpose registers, namely B, C, D, E, H and L. Each register can hold data of 8-bits. We can also use these registers in pairs – BC, DE and HL. When in pairs, these registers can contain 16-bit data.

Program Counter

Let us consider that an instruction is being executed by the microprocessor. When the ALU finishes executing one instruction, it begins searching for the next instruction to be performed. Thus, there is a requirement of keeping the next instruction’s address ready to be executed, in order to save time. This is taken care of by the program counter.

The Program Counter (PC) is a 16-bit register which is used to store the memory location of the next instruction in line for execution.

Stack Pointer

The Stack Pointer (SP) is a 16-bit register which works similar to the stack and is always incremented/decremented by two during any push or pop operations.

Internal Registers

The two temporary internal registers, W and Z, hold 8-bit data during the execution of a few arithmetic and logical instructions, as well as the  CALL and XCHG instructions.

Flag Register

FLAG REGISTER OF 8085
Flag register contents. D1, D3 and D5 slots are empty. A lot of processors have these ’empty’ register slots in their designs to accommodate future design updates.

The 8085 has an 8-bit flag register, but there are only five active flag bits. They are – S, Z, AC, P and CY. Flags are basically flip-flops which are used to show the status of some units of the 8085 after the completion of their respective operations. These flip-flops are either set or reset as per the condition of the result in the registers.

  1. Sign Flag (S)
  • The sign flag indicates whether the result of an arithmetic / logical operation is positive or negative.
  • If the flag is set, i.e. S = 1, the result of the recently carried out operation is negative; whereas if the result turns out to be positive, the flag is reset, i.e. S=0.
  1. Zero Flag (Z)
  • The zero flag indicates whether the output of an arithmetic / logical operation turns out to be zero or not.
  • If the result of the most recent operation is zero, the flag will be set (i.e. Z=1). Else, the flag will be simply reset (Z=0).
  • This flag’s value is changed after the ALU operation by the result stored in the accumulator and other registers.
  1. Auxiliary Carry Flag (AC):
  • This flag comes into consideration only during BDC arithmetic operations.
  • In BCD operations, when a carry is generated by the D3 bit and is passed on to the D4th bit, the AC flag will be set. Else, the AC flag will be reset.
  • The programmer cannot change the sequence of the program using the jump instruction.
  1. Parity Flag (P):
  • Parity is used to indicate whether a number is of even parity (has even number of 1’s in the binary number) or of odd parity (has an odd number of 1’s in the binary number).
  • Thus, the parity flag in the flag register indicates if the most recent result of the ALU operation is of even parity or odd parity.
  • If it follows even parity, the P flag will be set to 1; else it remains zero.
  1. Carry flag (CY):
  • The Carry flag indicates a carry or borrow generated during any arithmetic operations carried out in the ALU.
  • If a carry or borrow has been generated, the flag will be set to 1; else it is reset.

Timing and Control Unit

  • This component produces all the timing & control signal for all the microprocessor operation.
  • This unit synchronizes all the microprocessor operations with the internal clock and generates the necessary control signals for communication between the 8085 and the peripherals.
  • Given below are the timing & control signals which control the external and internal circuits −
    • Control Signals: READY, RD’, WR’, ALE
    • Status Signals: S0, S1, IO/M’
    • DMA Signals: HOLD, HLDA
    • RESET Signals: RESET IN, RESET OUT

Interrupt Control

As the name goes, this component controls the interrupts popping up during a process. Basically, an interrupt suspends the normal course of execution of the microprocessor, shifts the control to the subroutine, completes the interrupt handling and then goes back to the main program. When a microprocessor is executing a set of instructions and an interrupt pops up, the 8085 shifts control from the main program to process the incoming interrupt request. After the request has been processed, the control shifts back to the main program. This interrupt might be a hardware or a software interrupt. Some interrupts can be ignored (or maskable) while some cannot (non-maskable). There are five interrupt signals in 8085 microprocessor: INTR, RST 7.5, RST 6.5, RST 5.5, TRAP.

Increment or Decrement Register

The ‘8-bit register contents’ or a ‘memory position’ can be increased or decreased by one. The 16-bit register is useful for incrementing/decrementing the PC or the  SP registers’ content by one.

Address-Buffer & Address-Data-Buffer

The contents stored in the Stack Pointer Register and the Program Counter Register are loaded in the address buffer and the address-data buffer to communicate with the processor. The memory and I/O chips are connected with these buses; the CPU can exchange the required data with the memory and I/O chips.

Serial Input / Output control

This unit controls the serial data communication by using two instructions: SID (Serial Input Data) and the SOD (Serial Output Data). In serial data transmission, the data bits are sent over a single line, one bit at a time.

Does the functionality of the system remain the same in the ARM 7 architecture?

Let’s discuss the small task we gave you a couple of sections above. Let’s check out the commonalities between an old processor design and a newer one. Before we begin, let us get acquainted with a brief background on the ARM 7 Processor.

Some information on the ARM 7

Developed by the ARM Corporation, the ARM 7 is a 32 bit RISC ( Reduced Instruction Set Computer ) processor. Generally, we see the application of ARM cores in mobiles phones, portable devices and handheld organizers. Today, the ARM processors have the most popular and most favoured embedded architecture. Their cores are very simple when compared to most of the other general-purpose processors. Thus, they can be fabricated using comparatively lesser transistors, occupying smaller area and leaving extra space for application-specific macro-cells. An ARM chip contains many peripheral controllers, a digital signal processor, and memory along with an ARM core. There are 37 32 – bit registers in the ARM 7 Architecture.

Here are the common internal components and their functionalities. Notice the changes.

Arithmetic Logic Unit

The ALU in the ARM 7 architecture has two 32-bits inputs (As opposed to two 8-bit inputs of the 8085). One of the inputs comes from the register file (Accumulator in 8085), while the other one comes from the shifter (Temporary register). Any output given by the ALU modifies the status of the register flags as well (same as 8085).

The V (oVerflow) flag (not present in 8085) is affected by the V-bit output, and the C (carry) flag is also set if there is a carry in the operation carried out in the ALU. The MSB value is reflected in the S (sign) flag. If the output of the ALU is Zero, it again affects the Z (zero) flag. (The rest of the status flags are present in 8085) A 4-bit function bus in the ALU permits up to 16 op-code to be implemented. (Not a feature found in 8085)

Accumulator

There is no separate accumulator register as such, but the first register (R0) in the General – Purpose Registers is used as the Accumulator. (The 8085 has a dedicated accumulator)

General Purpose Registers

ARM has a total of 31 general-purpose 32-bit registers. At any time, 16 of these registers are available and visible. The other registers are, thus, used to speed up the exception processing. (The 8085 has eight 8-bit general-purpose registers, two of them cannot be accessed)

Special purpose registers

Stack pointer(SP)

This register is used by the POP and PUSH instructions, required to save temporary data. (Present in 8085 too. 8-bit)

Link register

This register holds the address value of the next instruction after a subroutine call is made using the Branch and Link (BL or BLX) instruction. It is also utilized for return address information on an entry to the exception modes. (Not present in 8085)

Program Counter

This register can be used in to point the instruction, which is two instructions after the currently – executed instruction. (Present in 8085)

Control Unit

The control unit in a microprocessor is the heart of the system. It is responsible for the operation of the system. This unit is generally a pure combinational circuit. The processor’s timing controls are also included in the control unit.  Signals from the ARM control unit are connected to each and every component in the processor to manage its functioning. (The 8085 has a timing and control unit too.)

CPSR Register

The Current Program Status Register is used in monitoring and controlling the internal operations. It is a 32-bit register which resides in the register file.

This register is divided into four distinct fields, each supporting 8 bits width, namely: status, flags, execution and control.

The status and extension fields are reserved for any future use. The control fields hold information regarding the processor mode, the state, and interrupt masking bits. The flag field contains information on conditional flags (The 8085 has a separate flag register).

CPSR REGISTER
CPSR REGISTER

Interrupt Control Register

The ARM processor supports 32 interrupt request inputs. A special controller called the Vectored Interrupt Controller is assigned for dealing with the interrupts. (The 8085 has a dedicated interrupt control register too.)

Instruction Pipeline

ARM has an instruction pipeline. Pipelining is a concept where the microprocessor begins the execution of a second command before the first one has been completely finished. Hence, many instructions are in the pipeline at the same time, each at a different processing phase. You can read more about pipelining and how it works here. (The 8085 has an instruction register, which, you can call as an older design of a pipeline, performing a similar function. This is a significant oversimplification, but the analogy holds for the sake of understanding.)

Instruction decoder

An instruction decoder decodes the incoming instruction into binary. It’s a vital part of any microprocessor. (Of course, the 8085 has one too.)

About The Writer

CLOSE

Leave a Reply

Your email address will not be published. Required fields are marked *