Tuesday, September 25, 2012

Architecture of 8085 Microprocessor

Microprocessor : It is an electronic machine which process or manipulate the data. Microprocessor is consists of CPU (Central Processing Unit), input devices, output devices and memory. 8085, 8086, Pentium 4, Celeron, Athion, Dual core, Core 2 Duo are the general examples of CPU. It is design for multitasking operation. On the other hand it perform many tasks simultaneously.

Cpu (Central Processing Unit):
(a) Fetch an instruction from main memory.
(b) Perform arithmetic and logical operations.
(C) Decode it and generate appropriate timing arid control signals.
(d) Control the entire computer operations.

  1. Clock frequency: The processing speed of microprocessor depends upon clock frequency.
  2. BUS: It is a bundle of wires, which give single purpose (either data, address). These  wire give data, address and acts as control lines.
  3. Address Bus: The address bus also a set of parallel connected lines. The address bus consist of 16, 20, 24 or 32 parallel lines. Address bus carries the address of the memory or I/O location to be read or written from.
  4. Data Bus: The data bus consists of 8, 16 or 32 parallel lines. .The data bus is a bidirectional bus. The data bus can transfer the data from CPU to memory or vice versa. The data bus also connects the I/O ports and microprocessor.
  5. ALU (Arithmetic/logic unit): ALU stands (Arithmetic/logic unit). This units can perform arithmetic operations (like addition, subtraction, multiplication and division) and logical operations like (AND, OR, X-OR, NOT, Rotating etc.).

8085 (Microprocessor)
1, It is an 8-bit microprocessor. It can accept or provide 8 bit data simultaneously.
2. It has 8 bit ALU that can perform 8 bit operations.
3. It is based on NMOS technology.
4. It provides 16 address lines, hence it can access 216 = 64 Kb of memory.
5. It generates 8 bit I/O address; hence it can access 28 = 256 I/O ports.
6. It has 8-bit internal data bus and registers.
7. It provides 5 level interrupts.
8. It provides two serial i/O lines.
9. 8085 was the first processor that required’ only single +5V power Supply.
10. It has an on-chip clock generator.

Memory: It is a digital processing system which can store the data. Now days we used
Semiconductor memories like RAM, ROM, EPROM etc. Semiconductor memory is small size, high speed, better reliability, low cost.

Q 1. List the functions of ALU.

Ans. Functions of ALU:
(a) It performs arithmetic operations like ; addition, subtraction, increment, multiplication etc.
(b) It performs logical operations like ; AND ing, OR ing, X-OR ing, NOT etc.
(c) it accepts operands from accumulator and temporary register.
(d) It store the result in accumulator or temporary register.
(e) It provides states of result to the flag register.
(f) It looks after the branching decisions.

Q. 2. List the basic features of 8085 microprocessors.
Ans.
Q 3. What is Bus? How it is organized in 8085?
OR
Describe the bus architecture of 8085.

Ans. 
  1. Bus is a bundle of wires.
  2. It is used to transfer information between different element of microprocessor. information like data, address and element of  microprocessor like memory, 1/0 devices.
  3. Bus are divided into three categories like” address bus, data bus and control bud. So all these buses are carry information regarding data, address and control but also connects microprocessor to memory (RAM or ROM) and I/O devices.
    (a) Address Bus: It is bus which carries the address of a memory location or I/O location. It is also called unidirectional bus. In 8085 the address bus is 16-bit (A0 — A15). The 8085 microprocessor has 16-bit address bus to access memory, hence it can access 216 = 64KB memory locations.

    (b) Data Bus: It is bus which used to transfer, information between microprocessor, I/0 devices and memory. It is also called bi-directional bus. The number of data lines used in the data bus is equal to the size of data word being written or read. Data bus is time multiplexed with lower order address bus.

    (c) Control Bus: It is bus which is necessary to Control the direction of data flow on the bidirectional data bus and to differentiate between a memory address and an I/O address. Some of the control bus signals are follows:

    (I) Memory read
    (ii) Memory writer
    (iii) I/O read
    (iv) I/O writes.

    Q 4. What is a parity flag? When is it affected?
    Ans. The parity flag (P) is one among the five status flags that the Intel 8085 microprocessor contains. The .parity status flag P is set to 1, if the result of an arithmetic or logical operation contains even number of is. It is reset i.e. it is 0, if the result contains odd number of is. For e.g.
    The data byte 00000011 has even parity even if the magnitude of the number is odd.

    Q 5. Write three different methods to clear the Accumulator.

    Ans.
    • MVIA., OOH = Direct Addressing
    • MCVI B, OCH = MOV A, B
    • XRAA Accumulator XOR A

    01000011
    01000011
    00009000

    So accumulator will be cleaned

    Q 6 Why demultiplexing of AD7, AD0 is required’

    Ans Basically, ALE signal give us the information that which of the bus data bus or address bus we are using
     
    ALE signal is used to demultiplexing the bus
    The bus AD7 — AD0 is connected as the input to latch 74LS373 ALE signal is attached to enable pin of the latch (4)
    CC — output control ALE when high — latch is transparent output changes according to input data
    To reduce the number of pins to make it compact one and easy to use data bus a” address bus is demultiplexed

    Data bus — 8 bits
    Address bus —* 16 bits

    So 8 bits of address bus and data bus are multiplex and them ALE (Address I enable) is used to demultiplexed them.

    Q7 What is a PSW

    Ans. PSW: Program status word which implies to check the status of flags.

    S — sign flag — if bit D is set, sign flag is set. This flag is used with signed numbers. If D7 is set then number is viewed as negative number.
    Z — zero flag — zero flag is set if the ALU operation results in zero and the flag is reset when result is not zero.
    AC — Auxilliary carry flag — when carry is generated by the digit 03 and passed on to digit D4, the AC flag is set. Flag is used only internally for BCD.                         P — Parity flag — If accumulator has an even number of is, flag is set. If it has an odd number of is, the flag is reset.
     CY — Carry flag — If an arithmetic operations results in carry, the carry flag is set.

    Q8. What do you mean by a synchronous and asynchronous bus? Give at least one example of each.
    OR
    Distinguish between synchronous and Asynchronous buses.

    Ans. Synchronous means “at the same time”. The device which sends data the device which receives data are synchronised with the same clock. And this data transfer with I/O devices or using memory read/write when using same clock that is done by synchronous bus.
    When data transfer is not of regular intervals that is not based on predetermined timing pattern. Asynchronous data transfer is used for slow I/O devices. Then our is asynchronous bus.

    Q 9. List the sequence of operations needed for the FETCH cycle of a basic  computer.
     
    Q 10 Explain the requirement of a program counter in 8085 microprocessor

    Ans Program counter gives us the information about the next instruction to be executed PC has the address or point out the address of the next Instruction to be executed In call and ret statements the word and registers are temporary registers used to store the temporary address Then program counter will jump to the call or ret instruction address

    Q 11. How many clock cycles occur in 1 wait cycle?

    Ans. It will consume one clock cycle and the request will be given in the 3rd cycle of the instruction.

    Q 12 How many bus cycles are required to read as unaligned word of data frommemory? 

    Ans Two bus cycles are required to read on unaligned word from memory.

    Q 13 Explain the following terms SSI, MSI and LSI.

    Ans
  4. SSI (Small Scale Integration) It is basically integrated circuits (ICs) consists of several transistors, diodes and resistors on a single chip The 7400 and series ICs are SSI family
  5. MSI (Medium Scale Integration) It is also integrated circuits (ICs) consists of 100 transistors diodes and resistors on a single chip For examples 7490 IC
  6. LSI (Large Scale Integration) It is also integrated circuits (lCs) consists of 1000 — 10 000 transistors, diodes and resistors on a single chip For examples computer memories (RAMs) calculator chips .   
  7. Q 14 Write advantage of the assembly language in comparison with high level language.  
  8. Ans The advantages of assembly language in comparison with high level language are 1 Assembly language is directly communicate with operating system of a computer But high level language is difficult to communicate 2 Assembly language programming is required small memory space The high level programs require a large memory space 3 Assembly language programming helps to learn about the internal architecture of the microprocessor. 
    Q 15 Explain the function of the system controller in 8085 
    Ans The functions of the system controller in Intel 8085 are explained below
    I It is a fully integrated single-chip design Its provide complete system level functions
    for all external data access
    2 Its replace multiple discrete devices on the system
    3 It adapts different system requirements
    Q 16. What is the function of Accumulator?
    Ans. Accumulator
    1. It has to provide one of the operand for any ALU operations.
    2, It has to accumulate the result of ALU operations.
    Q17. Give timing and control signals for 8085 iiR

    Ans. Timing and Control:
  9. It is controls all internal and external circuits in the microprocessor system. It accepts information from instruction decoder and generates micro steps to perform it.
  10. This block accepts clock inputs, performs sequencing and synchronising operations. The synchronization is required for communication between microprocessor and peripheral devices. To implement this it uses different status and control signals.
    Q 18. Specify the function of address bus and the direction of the information flow on address bus.

    Ans. (I) The address bus is always unidirectional means the address is given by 8085 to select a memory or an I/O location.
    (ii) it is used for memory location.
    Q 19. What happens in a single board microcomputer when the power is turned on any reset key is pushed?

    Ans. After resetting the single board microcomputer starts executing instructions from 000H onwards.
    21 Discuss flag register for 8085 ,ip

    Ans. Flag register:
    (i) A flag is a flip flop It indicates some condition produced by execution of an instruction
    (ii) The flag register of 8085 microprocessor consists of five flags It flag register is connected to ALU
    (iii) When any operation is performed by ALU the result is transferred on internal data bus and the status of result will be stored in flip flops
    Q 22 Give microprocessor applications

    Ans Following are the applications of microprocessor
    (i) It is used as CPU of a computer used for controlling input, output and other devices of a computer
    (ii) Used for controlling appliances video games and automobiles
    (iii) They are used to measuring and controlling the temperature of a ‘furnace and oven, the speed of an electric motor the pressure of a boiler, to control the level of liquid in the tank
    (iv) They are used in computers for railway reservations, smart camera energy meters,
    photograph processing general administration
    (v) They are used in office automation data acquisition systems and associated  interfaces
    Q 23 State difference between synchronous and asynchronous bus

    Ans Synchronous Bus :
    A bus in which there is a gap in sending cut two adjacent characters is called as synchronous bus The transmitting end of the bus contains the start and stop bits
    The main feature regarding the synchronous bus is that the devices attached to this bus are synchronized and the common example is of memory compatible with microprocessor system.
    Asynchronous Bus :A bus in which there is no gap in sending of two adjacent characters is called as asynchronous bus After a fixed number of data bytes a special bit pattern called SYNC is sent to the transmitting end
    Asynchronous buses are based on the timing characteristics of I/O devices and the most common example is of data transfer scheme for an AID converter 
    Q 24. What is the various status signals used in 8085? 

    Ans. 1. Address latch enable (ALE)
    2. Input outputs/memory (IO/M)
    3. Status signals (S1 and S0)
    4. Read (RD)
    5. Write (W)
    6. READY.
    Q 25. What is the function performed by timing and control unit in a microprocessor?
     
  11.  Ans. The timing and control unit receives the decoded signal from instruction decoder and generates various control signals to execute the instruction.
  12. This unit provides status signals, control signals and timing signals which is necessary for any operation of memory and I/O device. -
  13. It also controls all internal and external circuits in the microprocessor system. On the other hand, we can say that, this unit controls the whole operation of microprocessor and I/O devices, it just like a human brain.
    Q 26. Draw a circuit diagram demonstrating how to create a32 k x 8 EPROM from two 16k x 8 EPROM as showing all signal connections. 
  14. Hence, we required two chips of capacity 16K x 8 EPROM.
    The two chips(16K x 8 EPROM) are connected to the address line individually.
    directional data lines of the chips (16K x 8 EPROM) are connected to each other.
    The read(RD) lines of two chip are connected to read pin (Read b).
    On the same write (W) line of all the chips are connected together. To access 16K locations we need 14 address lines A0 to

    A13 and to access 32K locations we require 15 address lines A0 to A14.
    A14 = 0 chip-i should be selected
    A14 = 1 chip-2 should be selected.
    Q 27. Write various functions (category wise) performed by the microprocessor.
    Ans. The various functions performed by the microprocessor are
    (a) Fetch an instruction
    (b) Decode an instruction
    (c) Execute an instruction
    (d) Read/write data from/to memory
    (e) Read/write data from/to I/O devices.
    Q 28. Draw the functional block diagram of 8085 microprocessor. Using example explain how an instruction is decoded and executed.
                                                     OR
    Draw the diagram of 8085 and explain the functions of each pin.
    Instruction Decoder and Machine Cycle Encoder
    • This accepts a bit pattern (OPCODE) from instruction register, decodes it and gives the decoded information to control logic. It is -a 8:256 decoder.
    • The information includes what operation is to be performed, who is going to perform it, how many operand bytes the instruction contains, etc. It means that it will understand the instruction in this block.
    • The decoded information is given to the Timing and control unit that provides control signals.
    • The 8085 executes seven types of machine cycles. The status signals give information about which machine cycle is currently being executed.
    Q29. Explain the function of ALE and 10/ M signals of the 8085 microprocessor.
    Ans. 1. ALE (Address Latch Enable): It is a output signal of 8085 microprocessor. It is basically used to give information of AD0 — AD7 contents. It is a positive going pulse generated during the first clock cycle of a machine cycle. If pulse is high it indicates that the contents of AD0 — AD7 are address.
    On the other hand if it is low it indicates that the contents are data

    ALE=1 = Address
    ALE=0=Data

    The ALE signal is used to separate AD0 — AD7 (i.e. demultiplex) to A0 — A7 and D0 — D7.


    2. Input Output/Memory (I0/Ti): It is an output status signal of 8085 microprocessor. It is basically used to give information of operation to be performed with memory or I/O device.
    If the lO/ii pin is low (i.e. lO/TI = 0), the microprocessor is performing a memory related operation. On the other hand, if the lO/T pin is high (i.e. IO/M = 1), the microprocessor is performing an I/O device related operation.

    IO/M = 0 Memory related operation.
    lO/M = 1 = I/O device related operation.

    Q 30. Explain all four operations performed by MPU using diagram.
    Ans.
    (a) Fetch an instruction
    (b) Decode an instruction
    (c) Execute an instruction
    (d) Read/write data from/to memory / read/write data from/to I/O devices.

    Q 31. How does 8085 based single board microcomputer works?
    Ans. 
  15. We have studied the architecture of a 8085 microprocessor. 8085 microprocessor when connected with the input device, output device and memory forms a microcomputer system.
  16. The input device like keyboard is used to enter the data and instructions.
  17. The memory is used to store the data and the output device like seven segment display or CRT is used to display the results. Fig. shows the block diagram of a 8085 based micro computer system.
  18. It consists of two types of memory, (EPROM and R/W memory) an input device, an output device and address bus, data bus and a few control signals connected to the peripherals (memory and I/O devices) and the microprocessor.
  19. The address lines 15.
  20. The O5 microprocessor are used to carry the addresses of the memory, input device and output devices.
  21. These lines are connected to the EPROM memory, R/W memory, input device and output device.
  22. The data lines of 8085 microprocessor D are used to carry the data. These are bidirectional lines.
  23. The data can flow- from the microprocessor to the peripherals (memory and input/output devices) and also from peripherals to the microprocessor.
  24. These bidirectional data lines are also connected to the EPROM memory, R/W memory, input and, output device.
  25. The four control signals generated by the microprocessor (Memory Read), (Memory Write), (I/O Read) and (I/O write) are also connected to different peripherals.
  26. First control signal, Memory Read is connected to the EPROM memory and R/W memory to read the data from these memories.
  27. The second control signal, memory write is connected to the R/W memory so that the data may be written in the R/W memory. The third control signal input/output read signal is connected to the input device.
  28. When this signal is active, the 8085 microprocessor can read data from the input device.
  29. The fourth control signal input/output write is connected to the output device and when this signal is active, the microprocessor can send data to the output device.
  30. The 8085 microprocessor communicates with only one peripheral (memory or I/O device) at a time by enabling the peripheral through its control signal.
  31. To read the data from the R/W memory, the 8085 microprocessor sends a low signal. When is low the memory section is enabled, the microprocessor places the address of memory on the address bus, data from the memory (whose address is placed) is’ read by the microprocessor through the data bus.
  32. To send the data to the output device, the microprocessor places the address of the output device on the address bus, data on the data bus and enables the output device by generating a control signal low.
  33. The data from the microprocessor is transferred to the output device. Similarly to read data, from the input device, the 8085 microprocessor generates a low control signal so that input device is enabled.
  34. Then the microprocessor place the address of the input device on the address bus and the data from the input device is placed on the data bus and it is read by the microprocessor through its data bus.
    Q 32. Draw a schematic to demultiplex bus AD7 — AD0 using any octal latch.
    Ans. The 8085 microprocessor is used IC 74LS373 to latch the address of 8085. Basically latch is consists of 8 flip flops. Generally we used D-flip flops (Delay).
    The clock of these flip flops are connected together and available as a output pin called enable.
    Working : The address will appear on AD0 AD7 lines. The ALE will go high and forcing
    Enable = 1. This will make latch enable and ready to work. Before address disappears ALE = 0. This will make latch disable. AD0 — AD7 will now be used as data bus.
    Hence, AD0 — AD7 (low order) address bus of the 8085 microprocessor is multiplexed (time-shared) with the data bus. The buses need to be demultiplexed.
    Q 33. Discuss PSW in detail for 8085 TR

    Ans. PSW (Program Status Word) : It stands for program status word. It is a 8 bit
    register which includes five status flags and the rest three bits are undefined.

    Flag is a flop flop. It indicates some condition produced by the execution of an instruction. example, the zero flag (ZF) will set if the result of execution of an instruction is zero. The rent flags of 8085 are:
    1. SF (Sign Flag) The flag is set when MSB bit of the result is 1. Otherwise the flag is
           SF=1 =MSBis1
           SF=0 =MSBis0.
  35. ZF (Zero Flag) : This flag is activated or set only if the result of ALU is equal to zero. the other hand, this flag is set, when the result of operation is zero, otherwise it is reset.
ZF = 1 = ALU result is zero
ZF = 0 ALU result is non-zero.

  1. AC (Auxiliary Carry Flag) : This flag is set, whenever there has been a carry out of lower nibble into the higher nibble or a borrow from hiher nibble into the lower nibble of 8 bit quantity, otherwise AF is reset.
    4 PF (Parity Flag) Basically parity is of two type one is even parity and second one is odd parity Parity is checked with just counting the number of is in given data

    This flag is set when the result has even parity an even number of 1 bits If parity is odd
    PF is reset
    PF = even parity PF = 0 odd parity

    5 CY (Carry Flag) This flag is set whenever there has been a carry out of or a borrow into the higher order bit of the result (8 or 16 bit)
    For example:
    Q 34 What are the functions of stack pointer and program

    Ans. Functions of the stack pointer:
    (i) It is used ‘for holding the address of program memory counter?
    (ii) It isaiways points to the next instruction to be fetched.
    (iii) The size of program counter depends upon the number of address bits.
    (iv) In Jump and call instructions, the address followed by the jump and call instructions is placed in the program counter.

    Functions of stack pointer:
    (i) It is used to keep the track of data stored on stack.
    (ii) Stack pointer is a reserved• portion of memory where information can be stored. This memory area is referred to as a stack area.
    (iii) Stack pointer is a 16-bit register used for defining the stack starting address. It is always points at the top of the stack.
    (iv) Stack pointer is decremented after each stack write operation and it is incremented after each stack read operation.
    (v) The stack pointer is loaded with an initial value by the means of a transfer type instruction. Initial value must be the highest address of an assigned stack in the
    memory.
    Q 35. What are the various registers used in 8085?
    OR
    What do you meant by register? Discuss various registers of 8085 iR
    OR
    Write the internal data operations and 8085 programmable registers.

    Ans. Registers: It is used to store data or address. It is a set of flip flops which are
    used for temporary storage of information (data or address or instruction). It consists of PIPO (Parallel in Parallel Out) Registers.
    The 8085 microprocessor consists of following registers
    1. Temporary data register
    2. Temporary registers W and Z
    3. 8-bit accumulator
    4. Flag register
    5. Six general purpose registers (B, C, D, E, H and L)
    6. 16-bit program counter :
    7. 16-bit stack pointer -
    8. Instruction register.

    1. Temporary Data Register : This register is also called as operand register. It provides operands to the ALU. It is a 8-bit register and not available to user.

    2. Temporary Registers (W and Z) : These registers are used by control section to hold the data during an arithmetic or logical operation. It is hold 8 bit data. These register are not available to user. They are internally used by the microprocessor.

    e.g.:
    (a) XCHG (exchange)
    (b) XTHL (exchange top of stack with registers H and L).

    3. 8-bit accumulator : This register is used to store the first input as well as result of any calculation is also stored in accumulator. The accumulator is identified as register A. It is an 8-bit general purpose register.

    4. Flag register : The flag register is give the status of the result. It is a part of arithmetic and logical section. It indicates some condition produced by the execution of an instruction. The 8085 microprocessor consists of five flags.
    (a) Sign Flag (S)
    (b) Zero Flag (Z)
    (c) Auxiliary Carry Flag (AC)
    (d) Parity Flag (P)
    (e) Carry Flag (CV)


  1. 5. Six general purpose registers (B, C, D, E, H and L) : The 8085 microprocessor contains 6 general purpose registers of 8 bits each, named as B, C, D, E, H and L. These registers are programmable by user. They are used to hold data, results of arithmetic and logical operations and address of data memory. The valid register pairs available are BC, DE and HL. The user cannot form a register pair of his/her choice.
    6. 16-bit program counter (PC) : The program counter is used to hold the address of program memory. It always points to the next instruction to be fetched i.e. it holds the memory address of the next instruction to be executed.

    7. 16-bit Stack Pointer (SP): Stack is a reserved portion of memory where information can be stored to taken back under software control. This memory area is referred to as stack area. The stack pointer is auto decremented by 2 after PUSH operation and auto incremented by 2 after POP operation.

    8. Instruction Register: An instruction fetched from memory is temporarily stored in Instruction Register before decoding. So after fetching instruction from memory, microprocessor stores it in the instruction register and after this it is decoded.
    1. Register Section : It consists of PIPO (Parallel in parallel out)’register.
    Register contains a set of. binary storage cells/flip flops with facilities of read and write. It. is used for temporary storage of instructions also used for data and address. Hence, the number of bits in a register is equal to data or address depending on the application. Fig. shows register section of 8085.
    Architecture of 8085 consists of following registers
    (a) Temporary data register
    (b) Instruction registers
    (c) 16-bit stack pointer
    (d) Flag register
    (e) Temporary registers W and Z
    (f) 8-bit accumulator
    (g) Six general purpose registers (B, C, D, E, H and L)
    (h) 16-bit program counter.
    Accumulator: It is 8-bit general purpose register of 8085. It has some special functions due to this it is also known as special register.
    Following are special functions of accumulator:
    (a) It has to private one of operand for any ALU operations.
    (b) It is used for accumulation.
    (c) Whenever a data is read from input device it comes in accumulator and similarly output device gets data from the accumulator.

    Status or Flag Register : Flag is a flip-flop. It indicates some condition produced by execution of an instruction.
    (a) The flag register 8085 consists of five flags. It is connected to the ALU.
    (b) When any operation is performed by ALU result is transferred on internal data bus and status of result will be stored in flip-flops.
    Instruction Register:
    1. The register is not accessible to user.
    2. Instruction register holds the opcode of instruction that is decoded and executed.
    3. This opcode is sent for instruction decoder to select one of 256 alternatives.
    Program Counter:
    1. Used for holding the address of program memory.
    2. In reset condition, the program counter is set to 000H, means that the address of first instruction to be fetched and executed.
    3. The size of program counter depends upon the number of address bits.
    4. In case of JUMP and call instructions, the address followed by JUMP and call instructions is placed in program counter. If the condition is satisfied then 8085 fetches the next instruction from the new adçiress specified by JUMP or call instructions.
    5. During instruction fetch operation, the contents of program counter on the address bus and it fetches first byte of instruction from memory location.
    Stack Pointer:
    1. It is portion of memory where information can be stored or taken back. This memory area is known as stack area.
    2. It is 16-bit register used for defining the stack starting address.
    3. Used to keep track of data store don stack.
    4. It is loaded with an initial value by means of transfer type instruction.

    Arithmetic Logic Unit (ALU) : This section processes all data i.e. it perform arithmetic and logic operations.
    1. It performs addition, subtraction and logical, operations like AND, OR, EX-OR.
    2. ALU is always controlled by timing and control circuits.
    3. It looks after the branching decisions.
    4. It provides status of result to the flag register.