Microprocessor and PC Hardware- Semester 3- First Internal Examination, September 2023

 

Section A

Answer any 5 questions. Each question carries 2 marks.

  1. Microprocessor:
    • A microprocessor is an integrated circuit (IC) that serves as the central processing unit (CPU) of a computer or electronic device. It is responsible for executing instructions, performing arithmetic and logic operations, and controlling the overall functioning of the system.
    • Microprocessors are the "brains" of computers and are crucial components in various devices, from desktop computers to smartphones and embedded systems.
  2. Instruction Cycle:
    • The instruction cycle, also known as the fetch-decode-execute cycle, is the fundamental operation of a CPU in processing instructions. It consists of three main steps:
      1. Fetch: The CPU fetches the next instruction from memory (typically RAM) using the program counter (PC) to determine the address.
      2. Decode: The fetched instruction is decoded to determine what operation needs to be performed and which operands are involved.
      3. Execute: The CPU performs the actual operation or instruction, which may involve arithmetic, logic, data movement, or control flow.
  3. Interrupt:
    • An interrupt is a signal or event that halts the normal execution of a program to request the CPU's attention for handling a specific event or task. Interrupts are used to handle various external events and can be categorized into several types, including:
      1. Hardware Interrupts: Triggered by external hardware devices to signal events like I/O completion or hardware errors.
      2. Software Interrupts: Also known as exceptions or traps, these are initiated by the CPU itself or software programs to request specific services from the operating system.
      3. Maskable Interrupts: Can be enabled or disabled by the programmer using interrupt masks.
      4. Non-Maskable Interrupts (NMI): Cannot be disabled by the programmer and are typically used for critical events like hardware failures.
  4. Register:
    • A register is a small, high-speed storage location within a CPU that is used for temporary data storage and manipulation during program execution. Registers are directly accessible by the CPU and provide fast data access. They serve various purposes, such as holding operands for arithmetic operations, storing program counters, and managing data flow.
    • Example: In x86 architecture, there are several registers, including the EAX register for general-purpose data storage, the ECX register for counting loops, and the EIP register for the instruction pointer.
  5. Generations of Microprocessors:
    • Microprocessors have evolved through multiple generations, each marked by advancements in technology, performance, and capabilities. The main generations are:
      1. First Generation: Characterized by the Intel 4004 (1971), these microprocessors used 4-bit data paths and were relatively simple in functionality.
      2. Second Generation: Included processors like the Intel 8008 and 8080, featuring 8-bit data paths and improved performance.
      3. Third Generation: The Intel 8086 and 8088 introduced 16-bit architecture, more memory, and greater computational power.
      4. Fourth Generation: Notable processors include the Intel 80386 and 80486, featuring 32-bit architecture and improved performance.
      5. Fifth Generation: Introduced RISC (Reduced Instruction Set Computer) architecture, including processors like the Intel Pentium series and later advancements.
  6. Purpose of BUS in Microprocessor:
    • A bus in a microprocessor is a collection of wires or traces that serve as communication channels to transfer data, addresses, and control signals between various components of the computer system, such as the CPU, memory, and I/O devices. The primary purposes of buses in a microprocessor are:
      • Data Transfer: Buses facilitate the transfer of data between different parts of the computer, allowing the CPU to read from or write to memory and I/O devices.
      • Addressing: Buses are used to transmit memory addresses, indicating the location of data to be accessed in memory.
      • Control Signals: Buses carry control signals like read, write, and clock signals to coordinate data transfer and operations.
      • Synchronization: Buses help synchronize the activities of various components, ensuring data integrity and orderly execution of instructions.
    • Common types of buses in microprocessors include the data bus, address bus, and control bus, each serving specific roles in data communication and control within the CPU and the broader system.

                                                 (5 x 2 =10 Marks)

 

Section B

Answer any 3 questions. Each question carries 5 marks.

7.    Define the timing diagram of 8085

Draw the diagram for memory read /write.

IO read /write

Opcode fetch

 

8.    Explain the status flags of 8085.

The Intel 8085 microprocessor, an 8-bit CPU from the 8080 family, features a set of status flags that indicate the outcome of arithmetic and logical operations. These flags are stored in the flag register (also known as the status register), which is a part of the CPU's general-purpose registers. The status flags in the 8085 microprocessor are:

 

Sign Flag (S):

 

The Sign Flag (S) is set if the result of an operation is negative, i.e., if the most significant bit (bit 7) of the result is 1.

S = 1 indicates a negative result.

S = 0 indicates a non-negative (positive or zero) result.

Zero Flag (Z):

 

The Zero Flag (Z) is set if the result of an operation is zero.

Z = 1 indicates that the result is zero.

Z = 0 indicates that the result is non-zero.

Auxiliary Carry Flag (AC):

 

The Auxiliary Carry Flag (AC) is used for binary-coded decimal (BCD) arithmetic. It is set if there is a carry from the low nibble (bits 0-3) to the high nibble (bits 4-7) during an operation.

AC = 1 indicates an auxiliary carry occurred.

AC = 0 indicates no auxiliary carry.

Parity Flag (P):

 

The Parity Flag (P) is set if the result of an operation contains an even number of set (1) bits.

P = 1 indicates even parity (even number of set bits).

P = 0 indicates odd parity (odd number of set bits).

Carry Flag (CY):

 

The Carry Flag (CY) is set if there is a carry out of the most significant bit (bit 7) during an operation. It is used for indicating overflows and borrow conditions.

CY = 1 indicates a carry occurred.

CY = 0 indicates no carry.

 

 

The Zero Flag (Z) is duplicated in the status flags. It is an additional copy of the Z flag.

These status flags are crucial for controlling program flow, making decisions, and handling conditional branch instructions in assembly language programming for the 8085 microprocessor. Programmers can use conditional branch instructions to check the values of these flags and execute different code paths based on their states.

9.    Intel 8085 Instruction Set: The Intel 8085 microprocessor has a relatively simple and straightforward instruction set, consisting of various instructions categorized into several groups. Here's an overview of the key categories of instructions in the 8085 instruction set:

1.    Data Transfer Instructions:

·         MOV: Used to move data between registers and between memory and registers.

·         MVI: Loads an immediate value into a register or memory location.

·         LXI: Loads a 16-bit immediate value into register pairs (e.g., BC, DE, HL, SP).

2.    Arithmetic Instructions:

·         ADD, ADC, SUB, SBB: Perform arithmetic operations with or without carry.

·         INR, DCR: Increment or decrement a register or memory location.

·         DAD: Add register pair to HL register pair.

·         CMA, CMC, STC: Complement accumulator, complement carry, set carry flag.

3.    Logical Instructions:

·         ANA, XRA, ORA: Perform bitwise AND, XOR, or OR operations with accumulator and a source.

·         CMP: Compare accumulator with a source, setting flags accordingly.

·         RLC, RRC, RAL, RAR: Rotate accumulator and carry left or right.

4.    Branching Instructions:

·         JMP: Unconditional jump to a specified memory address.

·         CALL: Call a subroutine at a specified address.

·         RET: Return from a subroutine.

·         RIM, SIM: Read/Write status and data from/to peripheral devices.

·         XTHL, SPHL: Exchange stack pointer with HL register pair.

5.    Input/Output Instructions:

·         IN, OUT: Input/output data from/to specified I/O ports.

6.    Control Instructions:

·         HLT: Halt the CPU until a hardware reset.

·         NOP: No operation (do nothing).

·         DI, EI: Disable/Enable interrupts.

7.    Conditional Branch Instructions:

·         Various conditional jump and call instructions based on the state of status flags (e.g., JNZ, JZ, JP, JM).

These instructions, along with the addressing modes, provide the foundation for programming the Intel 8085 microprocessor. Programmers can use these instructions to perform a wide range of data manipulation, control, and arithmetic operations.

10.  Addressing Modes: Addressing modes in a microprocessor define how operands (data) are accessed for an instruction. The Intel 8085 microprocessor supports multiple addressing modes:

·         Immediate Addressing:

o   In immediate addressing, the operand is a constant or immediate value specified in the instruction itself.

o   Example: MVI A, 5h loads the immediate value 5h into the accumulator.

·         Register Addressing:

o   In register addressing, the operand is located in one of the CPU registers (e.g., accumulator, B, C, D, E, H, L).

o   Example: ADD B adds the value in the B register to the accumulator.

·         Direct Addressing:

o   In direct addressing, the memory location (address) is specified directly in the instruction to access the operand in memory.

o   Example: LDA 2000h loads the accumulator with the data from memory address 2000h.

·         Register Indirect Addressing:

o   In register indirect addressing, the operand is indirectly referenced through a register or register pair.

o   Example: MOV A, M copies the value at the memory location pointed to by the HL register pair into the accumulator.

·         Immediate Addressing (with Register Pair):

o   In immediate addressing with a register pair, the immediate value is used as an offset from a register pair.

o   Example: LXI H, 3000h loads the HL register pair with the immediate value 3000h.

·         Implicit Addressing:

o   In implicit addressing, the operand is implicitly defined by the instruction itself, and no additional addressing mode is required.

o   Example: NOP (no operation) is an example of an instruction with implicit addressing; it doesn't need an operand.

·         Indexed Addressing:

o   Indexed addressing involves using an index register or offset to access data in an array or table.

o   This addressing mode is not directly supported by the 8085 but can be emulated using instructions like LHLD and SHLD in combination with indirect addressing.

o   These addressing modes provide flexibility for accessing data and memory locations, allowing programmers to write efficient and compact assembly code for various applications on the 8085 microprocessor.

 

 

Section C

Answer any 1 question. The question carries 15 marks

11.  Explain 8085 pin Diagram

Draw the diagram explain the categories in detail

 

12.Explain 8085 Architecture

 Draw the diagram and  explain the components

                                                                                                               (1 X 15 = 15 Marks)

Comments