CN 320: MICROPROCESSOR AND
MICROCONTROLLER SYSTEMS
    LECTURE II - MICROPROCESSOR AND
     MICROCOMPUTER ARCHITECTURE
1
    MICROPROCESSOR
     Microprocessor – CPU built on a single chip
     Microcomputer – A digital computer that has one
      microprocessor
     Putting a CPU, ROM,RAM and data i/o circuitry into a
      single IC will make a single chip microprocessor
     Single – chip microprocessor come compact and cheap, but
      do not allow user to choose built in functions
     Single – chip microprocessors are also referred to as
      microcomputer.
2
    Single chip / Multi – chip
         Microprocessor
3
                             Buses
     Various I/O and memory devices are connected to CPU
      through lines known as Bus
     A bus that connect all the internal computer components to
      the CPU and main memory
     Types:
       -Address Bus
       - Data Bus
       - Control Bus
4
    FUNCTIONAL COMPONENTS OF A
          MICROPROCESSOR
5
     FUNCTIONAL COMPONENTS OF A
           MICROPROCESSOR
     Arithmetic and Logic Unit (ALU): It performs
      arithmetic and logic operations such as addition,
      substraction, multiplication, division ,AND, OR, NOT etc.
     Control Unit (CU): is a component that directs the
      operation of the processor, It tells the computer's memory,
      arithmetic and logic unit and input and output devices how
      to respond to the instructions that have been sent to the
      processor.
     Registers: Memory Locations within a CPU designed to
      hold small set of data.
     A register may hold an instruction a storage address, or any
6
      kind of data. Some instructions specify registers as part of the
      instruction.
     8085 Microprocessor Architecture
     8085 Microprocessor is an 8 bit microprocessor designed by
      Intel in 1977 using NMOS technology.
     Available as a 40-pin IC package
     8 bit data bus & 16 bit address bus, thus it can address 2^16
      = 64 KB of Memory
     Requires +5 volt power supply
     Runs at a maximum frequency of 3MHz
7
    8085 Microprocessor Internal Architecture
8
                8085 Microprocessor
     Arithmetic and Logic Unit: performs numerical and
      logic operations such as Addition (ADD), Subtraction (SUB),
      And, OR etc.
     Uses data from memory and Accumulator, the result is stored
      in the Accumulator.
     Register: 8085 has six registers, one accumulator and one
      flag register
     In addition it has two 16-bit registers, stack pointer and
      program counter
9
     8085 Microprocessor Registers
      The six general purpose registers store 8-bit data and they
       are identified as B,C,D,E,H and L
      They can be combined as register pairs BC,DE and HL to
       perform some 16 bit operations
      The programmer can use these registers to store or copy data
       into the register by using data copy instruction
10
     8085 Microprocessor registers
11
     8085 Microprocessor Registers
      Accumulator: an 8-bit register that is a part of ALU.
      This register is used to store 8-bit data and to perform
       arithmetic and logical operations
      Flag register: The ALU includes five flip-flops, which are
       set or reset after an operation according to data condition of
       the result in the accumulator and other registers.
      They are called Zero (Z), Carry (CY), Sign (S), Parity (P)
       and Auxiliary Carry (AC) flags.
12
     8085 Microprocessor Registers
      Program Counter (PC): This 16-bit register deals with
         sequencing the execution of instructions
        This register is a memory pointer
        Stack Pointer (SP): is also a 16-bit register, used as a
         memory pointer
        It points to a memory location in R/W memory, called stack
        Instruction Register/Decoder: It is an 8-bit register
         that temporarily stores the current instruction of a program
        Control Unit: Generates signals on data bus, address bus
         and control bus within microprocessor to carry out the
         instruction, which has been decoded.
13
                            8085 Bus
     Typical buses and their timing are described as follows:
      Data Bus: Data bus carries data in binary form between
       microprocessor and other external units such as memory.
      Data bus is bidirectional in nature. The data bus width of
       8085 microprocessor is 8-bit i.e.
      2^8 combination of binary digits and are typically identified
       as D0 – D7.
      With only 8-bit wide then largest number is 11111111 (255
       in decimal).
      Therefore, larger numbers have to be broken down into
       chunks of 255. This slows microprocessor
14
                            8085 Bus
      Address Bus: The address bus carries addresses and is one way
       bus from microprocessor to the memory or other devices
      8085 microprocessor contain 16-bit address bus and are
       generally identified as A0 - A15.
      The higher order address lines (A8 – A15) are unidirectional
       and the lower order lines (A0 – A7) are multiplexed (time-
       shared) with the eight data bits (D0 – D7) and hence, they
       are bidirectional
15
                           8085 Bus
      Control Bus: Control bus are various lines which have
       specific functions for coordinating and controlling
       microprocessor operations. The control bus carries control
       signals partly unidirectional and partly bidirectional.
     The control and status signals used by 8085 processor:
      ALE (output): Address Latch Enable is a pulse that is
       provided when an address appears on the AD0 – AD7 lines,
       after which it becomes 0.
      RD(active low output): The Read signal indicates that
       data are being read from the selected I/O or memory device
       and that they are available on the data bus.
16
                           8085 Bus
      WR (active low output): The Write signal indicates that
       data on the data bus are to be written into a selected memory
       or I/O location.
      IO/M(output): It is a signal that distinguished between a
       memory operation and an I/O operation. When IO/M= 0 it
       is a memory operation and IO/M= 1 it is an I/O operation.
      S1 and S0 (output): These are status signals used to specify
       the type of operation being performed
17
     Status signal
18
            Microprocessor operations
      The microprocessor performs primarily four operations:
     i.   Memory Read: Reads data (or instruction) from memory.
     ii. Memory Write: Writes data (or instruction) into memory.
     iii. I/O Read: Accepts data from input device.
     iv. I/O Write: Sends data to output device.
19
      The 8085 processor performs these functions using address
       bus, data bus and control bus as shown in fig bellow:
20
     8085 PIN DESCRIPTION
21
     8085 PIN DESCRIPTION
      The logical and pin layout are grouped into six groups
      Address bus
      Data Bus
      Control and status signals
      Power supply and frequency signals
      External initiated signals
      Serial I/O signals
22
     8085 PIN DESCRIPTION
     Address and Data Buses:
      A8 – A15 (output, 3-state): Most significant eight bits of
       memory addresses and the eight bits of the I/O addresses.
      AD0 – AD7 (input/output, 3-state): Lower significant bits of
       memory addresses and the eight bits of the I/O addresses
       during first clock cycle
     Control & Status Signals:
      ALE: Address latch enable
      RD : Read control signal.
      WR : Write control signal.
      IO/M, S1 and S0 : Status signals.
23
     8085 PIN DESCRIPTION
     Power Supply & Clock Frequency:
      Vcc: +5 V power supply
      Vss: Ground reference
      X1, X2: A crystal having frequency of 6 MHz is connected at
       these two pins
      CLK: Clock output
24
     8085 PIN DESCRIPTION
     Externally Initiated and Interrupt Signals:
      RESET IN: When the signal on this pin is low, the PC is set
       to 0, the buses are tri-stated and the processor is reset.
      RESET OUT: This signal indicates that the processor is being
       reset. The signal can be used to reset other devices.
      READY: When this signal is low, the processor waits for an
       integral number of clock cycles until it goes high.
      HOLD: This signal indicates that a peripheral like DMA
       (direct memory access) controller is requesting the use of
       address and data bus.
25
     8085 PIN DESCRIPTION
     Externally Initiated and Interrupt Signals:
      HLDA: This signal acknowledges the HOLD request.
      INTR: Interrupt request is a general-purpose interrupt.
      INTA :This is used to acknowledge an interrupt.
      RST 7.5, RST 6.5, RST 5,5 – restart interrupt: These are
       vectored interrupts and have highest priority than INTR
       interrupt.
      TRAP: This is a non-maskable interrupt and has the highest
       priority.
26
     8085 PIN DESCRIPTION
     Serial I/O Signals:
      SID: Serial input signal. Bit on this line is loaded to D7 bit of
       register A using RIM instruction.
      SOD: Serial output signal. Output SOD is set or reset by
       using SIM instruction.
27
                8085 INSTRUCTION SET
      Based on the design of the ALU and decoding unit, the
       microprocessor manufacturer provides instruction set for
       every microprocessor.
      The instruction set consists of both machine code and
       mnemonics.
      An instruction is a binary pattern designed inside a
       microprocessor to perform a specific function
      The entire group of instructions that a microprocessor
       supports is called instruction set.
28
               8085 INSTRUCTION SET
      Microprocessor instructions can be classified based on the
       parameters such functionality, length and operand
       addressing.
     Classification based on functionality:
      Data transfer operations: This group of instructions
       copies data from source to destination. The content of the
       source is not altered.
      Arithmetic operations: Instructions of this group
       perform operations like addition, subtraction, increment &
       decrement. One of the data used in arithmetic operation is
       stored in accumulator and the result is also stored in
29
       accumulator
               Classification based on
                    functionality:
      Logical operations: Logical operations include AND, OR,
       EXOR, NOT
      The operations like AND, OR and EXOR uses two operands,
       one is stored in accumulator and other can be any register or
       memory location
      The result is stored in accumulator. NOT operation requires
       single operand, which is stored in accumulator.
30
               Classification based on
                    functionality:
      Branching operations: Instructions in this group can be
       used to transfer program sequence from one memory
       location to another either conditionally or unconditionally.
      Machine control operations: Instruction in this group
       control execution of other instructions and control
       operations like interrupt, halt etc.
31
     Classification based on length
      One-byte instructions: Instruction having one byte in
       machine code. Examples MOV A,B. ADD M.
      Two-byte instructions: Instruction having two byte in
       machine code. Examples MVI A,7EH. ADI 07H
      Three-byte instructions: Instruction having three byte in
       machine code. Examples JMP 9050H. LDA 8850H
32
     Addressing Modes in Instructions
      The process of specifying the data to be operated on by the
         instruction is called addressing.
     8085 has the following five types of addressing:
     I. Immediate addressing
     II. Memory direct addressing
     III. Register direct addressing
     IV. Indirect addressing
     V. Implicit addressing
33
                   Addressing Modes
      Immediate Addressing: In this mode, the operand is given
       in the instruction - a byte or word – transfers to the
       destination register or memory location. Ex: MVI A, 9AH
      The operand is a part of the instruction.
      The operand is stored in the register mentioned in the
       instruction.
34
     Addressing Modes
      Memory Direct Addressing: Memory direct addressing
       moves a byte or word between a memory location and
       register.
      The memory location address is given in the instruction.
       Example: LDA 850FH
      This instruction is used to load the content of memory
       address 850FH in the accumulator.
35
     Addressing Modes
      Register Direct Addressing: Register direct addressing
       transfer a copy of a byte or word from source register to
       destination register.
      Example: MOV B, C
      It copies the content of register C to register B.
36
                      Addressing Modes
      Indirect Addressing: Indirect addressing transfers a byte
         or word between a register and a memory location.
        Ex: MOV A, M
        Here the data is in the memory location pointed to by the
         contents of HL pair. The data is moved to the accumulator.
        Implicit Addressing: In this addressing mode the data
         itself specifies the data to be operated upon.
        Ex: CMA The instruction complements the content of the
         accumulator.
        No specific data or operand is mentioned in the instruction.
37
     SEE 8085 INSTRUCTION SET
            DATASHEET
38
     Pin Diagram of 8085
39
                       Take Home Quiz
     1.   What is the function of a microprocessor in a system?
     2.   Why is the data bus in 8085 bidirectional?
     3.   How does microprocessor differentiate between data and
          instruction?
     4.   Sketch and explain the various pins of the 8085.
     5.   What is meant by ‘priority of the interrupts’? Explain the
          operation of the interrupts structure of the 8085.
40