Tribhuvan University
Faculty of Management
Office of the Dean
2023 AD / Regular Examination
Time: 3 Hrs. | Full Marks: 60 | Pass Marks: 30
Subjective Questions
- [2]
List out the components of microprocessor.
View model solution
Components of a Microprocessor
A microprocessor consists of three primary functional components integrated onto a single semiconductor chip:
- Arithmetic Logic Unit (ALU): Performs arithmetic operations (addition, subtraction, multiplication) and logical operations (AND, OR, NOT, XOR, comparisons) on binary operands.
- Register Array (Registers): High-speed internal storage locations used to hold immediate data, memory addresses, intermediate calculation results, instruction codes, and status flags (e.g., Accumulator, Program Counter, Stack Pointer, Instruction Register, General-Purpose Registers).
- Control and Timing Unit (CU): Generates timing and control signals needed to coordinate and synchronize all internal microprocessor operations and external bus transactions (fetching, decoding, and executing instructions).
- [2]
Name the Pin that are used for DMA operation in 8085 microprocessor.
View model solution
DMA Pins in 8085 Microprocessor
Direct Memory Access (DMA) allows high-speed peripheral devices to transfer data directly to/from main memory without continuous CPU intervention. The 8085 microprocessor provides two dedicated hardware pins for DMA operations:
- HOLD (Pin 39 - Input): An active-high control signal asserted by an external DMA controller (such as Intel 8257/8237) requesting the microprocessor to relinquish control of the address, data, and control buses.
- HLDA (Hold Acknowledge - Pin 38 - Output): An active-high signal driven by the 8085 microprocessor to acknowledge that it has received the HOLD request and has placed its address, data, and control lines into a high-impedance (tri-state float) condition upon completion of the current machine cycle.
- [2]
Define operation code.
View model solution
Definition of Operation Code (Opcode)
An Operation Code (Opcode) is the specific binary portion of a machine-language instruction that specifies the exact operation to be performed by the processor (e.g.,
ADD,SUB,MOV,JMP).- Structure: In an instruction format, the opcode is accompanied by zero or more operands (or operand addresses).
- Function: During the instruction fetch phase, the opcode is fetched from memory into the Instruction Register (IR) and decoded by the instruction decoder to generate the corresponding micro-operations and control sequences required for execution.
- [2]
Differentiate between shift right and arithmetic shift right operation.
View model solution
Shift Right vs. Arithmetic Shift Right
Feature Logical Shift Right (SHR / LSR) Arithmetic Shift Right (ASR / SAR) MSB Handling Always shifts in a 0 into the Most Significant Bit (MSB). Preserves and duplicates the sign bit (MSB remains unchanged). Bit Movement All bits shift one position to the right; LSB enters carry flag. Bits 0 through shift right; original MSB is copied into bit . Mathematical Meaning Performs unsigned division by 2. Performs signed (two’s complement) division by 2, preserving negative sign. Example ( 10010110_2)Result: 01001011_2(unsigned positive value).Result: 11001011_2(remains negative signed value). - [2]
What is data transfer instruction?
View model solution
Data Transfer Instructions
A Data Transfer Instruction is a category of CPU machine instructions responsible for copying binary data from a source location to a destination location without altering the data contents or modifying CPU condition flags (flags remain unaffected in most architectures like 8085/8086).
Permitted Source/Destination Transfers:
- Register to Register (e.g.,
MOV B, C) - Immediate data to Register (e.g.,
MVI A, 32H) - Memory to Register (e.g.,
LDA 2050HorMOV A, M) - Register to Memory (e.g.,
STA 3000HorMOV M, B) - I/O Port to Accumulator (e.g.,
IN 01H,OUT 02H)
- Register to Register (e.g.,
- [2]
What is data dependency problem in pipelining system?
View model solution
Data Dependency Problem in Pipelining Systems
A Data Dependency Problem (Data Hazard) occurs in an instruction pipeline when an instruction in an early pipeline stage depends on the execution result of a preceding instruction that has not yet completed its write-back stage.
Classification of Data Hazards:
- RAW (Read After Write - True Dependency): Instruction
tries to read a register/source operand before instruction writes to it. - WAR (Write After Read - Anti-Dependency): Instruction
writes to a destination before instruction reads its old value. - WAW (Write After Write - Output Dependency): Instruction
writes its output before instruction writes, leading to incorrect final state.
Solutions:
Hardware forwarding (operand bypassing), pipeline stalls (interlocks / bubbles), or compiler instruction scheduling.
- RAW (Read After Write - True Dependency): Instruction
- [2]
Define relative addressing mode.
View model solution
Relative Addressing Mode
In Relative Addressing Mode, the effective address (EA) of the operand or target branch instruction is calculated by adding a signed displacement (offset) specified in the instruction to the current contents of the Program Counter (PC):
Key Characteristics:
- Position-Independent Code: Enables relocatable code blocks (such as shared libraries or subroutines) because branch targets are calculated relative to the instruction location rather than using absolute physical addresses.
- Short Instruction Size: Allows branching within a localized neighborhood using small 8-bit or 16-bit signed offsets (e.g., short jumps in 8086).
- [2]
Why we need I/O interface?
View model solution
Why We Need an I/O Interface
An Input/Output (I/O) Interface is an essential intermediary electronic subsystem between the CPU/memory and peripheral devices for several critical technical reasons:
- Speed Mismatch: Microprocessors execute at gigahertz/megahertz speeds, whereas mechanical and human-interface peripherals (keyboards, printers, sensors) operate at orders of magnitude slower speeds. Buffering is required.
- Signal Level & Format Differences: Peripheral devices often produce analog, serial, or non-TTL voltage levels, whereas the CPU utilizes standardized digital parallel binary signals.
- Operating Mode Diversity: Peripherals transmit data in serial streams or blocks, requiring parallel-to-serial conversion, parity checking, and error correction.
- Synchronization & Control: Coordinates data transfers using interrupts, polling, or handshaking signals to avoid data loss.
- [2]
What is the limitation of Associative memory?
View model solution
Limitations of Associative Memory (Content Addressable Memory - CAM)
Associative memory accesses data based on content rather than physical memory address. While offering exceptionally fast search times (
parallel lookup), it suffers from notable limitations: - High Hardware Cost & Complexity: Each bit cell in an associative memory array requires dedicated comparison logic (XOR gates) in addition to storage flip-flops, making it much more complex than standard SRAM/DRAM.
- Higher Power Dissipation: Simultaneous parallel matching across all memory words generates significant heat and consumes substantial electrical power.
- Limited Storage Capacity: Due to silicon real-estate constraints and gate density, associative memories are restricted to relatively small sizes (used primarily in Translation Lookaside Buffers [TLB] and high-speed cache tag directories).
- [2]
Write down microopration for POP operation in register stack.
View model solution
Micro-operations for POP Operation in a Register Stack
In a computer system utilizing a register stack where the Stack Pointer (
) points to the current top of the stack, the POP micro-operations retrieve the top word into the Data/Destination Register ( ) and increment the stack pointer (or decrement in inverted stack implementations): Micro-operation Sequence:
- Read Data from Stack Top:
- Update Stack Pointer:
- Check for Underflow:
- Read Data from Stack Top:
- [5]
Explain any two types of priority interrupt.
View model solution
Priority Interrupt Systems
A Priority Interrupt System is an arbitration mechanism that establishes a priority hierarchy among multiple concurrent interrupt requests, ensuring that higher-priority devices (e.g., power failure, clock tick, disk controllers) are serviced before lower-priority devices (e.g., keyboard, serial printer).
1. Daisy-Chaining Method (Hardware Serial Polling)
- Architecture: All interrupt-requesting devices are connected in a serial daisy-chain loop. The interrupt request lines are wired-ORed together to the CPU’s
INTRpin. - Operation:
- When one or more devices request service,
INTRis asserted. - The CPU acknowledges by sending an active-low Interrupt Acknowledge (
INTA) signal to the highest-priority device at the head of the chain. - If that device requested the interrupt, it intercepts the signal, places its vector address (VAD) on the data bus, and does not propagate the grant.
- If it did not request an interrupt, it passes the grant signal to the next device down the line.
- When one or more devices request service,
- Advantage: Minimal hardware connections required.
- Disadvantage: Propagation delay increases linearly with the number of devices.
2. Parallel Priority Interrupt (Priority Encoder Method)
- Architecture: Uses dedicated interrupt request lines (
) feeding directly into an Priority Encoder circuit (such as the Intel 8259A PIC). - Operation:
- Each device is assigned an input pin where
holds highest priority and lowest. - If multiple inputs are simultaneously active, the priority encoder outputs the binary code corresponding to the highest active index.
- An Interrupt Status Register (ISR) and Interrupt Mask Register (IMR) allow programmatic masking of individual interrupts.
- The generated vector is placed on the bus for immediate vector table dispatching.
- Each device is assigned an input pin where
- Advantage: Extremely fast arbitration (
gate delay) and dynamic software programmability.
- Architecture: All interrupt-requesting devices are connected in a serial daisy-chain loop. The interrupt request lines are wired-ORed together to the CPU’s
- [5]
Illustrate and explain the bus structure of microprocessor system.
View model solution
Bus Structure of a Microprocessor System
A Bus is a shared communication pathway consisting of parallel conducting wires that transmit data, addresses, and control signals between the CPU, memory, and peripheral interfaces.
+--------------------------------------------+ | 8085 Microprocessor | +-------+---------------+------------+-------+ | | | Address Bus | 16-bit | Data Bus | Control Bus (Unidirectional) | 8-bit | (Bidirectional) | | (Bidir) | v v v +-------+---------------+------------+-------+ | System Main Memory | +--------------------------------------------+ | | | v v v +-------+---------------+------------+-------+ | I/O Interfaces & Peripherals | +--------------------------------------------+1. Address Bus (16-bit Unidirectional in 8085):
- Transmits memory addresses and I/O port addresses from the CPU to memory/peripherals.
- With 16 lines (
), the microprocessor can directly address distinct byte locations ( ). - Unidirectional: signals flow exclusively from the CPU to external components.
2. Data Bus (8-bit Bidirectional in 8085):
- Carries data words and instruction opcodes between the CPU, memory, and I/O modules.
- Bidirectional: the CPU can both read data from memory/inputs and write data to memory/outputs.
- In 8085, the lower 8 address lines (
) are time-multiplexed with the 8 data lines to conserve package pins, de-multiplexed using the ALE(Address Latch Enable) signal.
3. Control Bus (Control & Timing Signals):
- Carries command, synchronization, and status signals that coordinate operations across the system.
- Key signals include
RD(Read),WR(Write),IO/M(I/O or Memory selection),ALE,RESET,CLK, and interrupt acknowledge.
- [5]
Describe any three addressing mode available in 8085 microprocessor.
View model solution
Addressing Modes in 8085 Microprocessor
The addressing mode defines how the operand of an instruction is specified. 8085 supports five addressing modes; three primary ones are detailed below:
1. Immediate Addressing Mode:
The operand (8-bit or 16-bit data) is specified directly within the instruction itself.
- Characteristics: The data immediately follows the opcode in memory.
- Instruction Format: Opcode + 8-bit/16-bit Data.
- Examples:
MVI A, 45H: Move 8-bit immediate valueinto Accumulator . LXI H, 2050H: Load 16-bit immediate addressinto register pair .
2. Direct Addressing Mode:
The 16-bit memory address where the operand is stored is specified directly in the instruction bytes following the opcode.
- Characteristics: Requires a 3-byte instruction (1-byte opcode + 2-byte address).
- Examples:
LDA 3000H: Load the data byte located at memory addressinto Accumulator . STA 4000H: Store the contents of Accumulatorinto memory address .
3. Register Indirect Addressing Mode:
The operand is stored in memory, but its 16-bit memory address is held inside a register pair (most commonly the
pair, denoted as memory reference ). - Characteristics: The instruction is compact (1 byte) because it only references the register pair holding the pointer.
- Examples:
MOV A, M: Move data byte from memory address pointed to by register pairinto Accumulator . STAX B: Store Accumulator contents into memory address held in register pair.
- [5]
Illustrate and explain the importance of memory hierarchy.
View model solution
Memory Hierarchy and Its Importance
The Memory Hierarchy is a structured architectural organization of computer memory technologies arranged according to access speed, cost per bit, and storage capacity.
/\ Speed: Fastest | Cost: Highest | Size: Smallest / \ ----------------------------------------------- / CPU\ CPU Registers (<1 ns, ~1 KB) /------\ / Cache \ L1, L2, L3 SRAM Cache (1-10 ns, MBs) /----------\ / Main Memory\ DRAM / RAM (50-100 ns, GBs) /--------------\ / Secondary Disk \ SSD / NVMe / HDD (microseconds to ms, TBs) /------------------\ / Magnetic Tape / Arc\ Archival Storage (seconds, Petabytes) ----------------------Why Memory Hierarchy is Crucial:
- Bridging the Processor-Memory Speed Gap: CPUs execute instructions in picoseconds/nanoseconds, while main DRAM access takes 50–100 nanoseconds. Without high-speed cache, the CPU would spend over 90% of its cycles stalled.
- Economic Viability (Cost Optimization): High-speed static RAM (SRAM) is prohibitively expensive to build in multi-gigabyte capacities. Hierarchical staging delivers near-SRAM speeds at DRAM/disk cost points.
- Exploiting the Principle of Locality of Reference:
- Temporal Locality: Items accessed recently are likely to be accessed again soon (loops, subroutines, counters). Kept in cache.
- Spatial Locality: Items stored at adjacent memory addresses are likely to be accessed consecutively (arrays, sequential instructions). Fetched into cache in multi-word blocks.
- [5]
Describe 4-bit binary incrementer with its block diagram.
View model solution
4-Bit Binary Incrementer
A 4-bit binary incrementer is a combinational circuit that adds 1 to a 4-bit binary number (
), generating an output word ( ) and an output carry ( ). Logic Design Using Half Adders:
An incrementer can be implemented efficiently using four cascaded Half Adders (HAs):
- The least significant bit
is added with a constant logic (input carry ). - Subsequent bits
are added to the carry output produced by the preceding stage.
A0 1 (C0) A1 C1 A2 C2 A3 C3 | | | | | | | | +---------+ +-----------+ +-----------+ +-----------+ | Half | | Half | | Half | | Half | | Adder 0 | | Adder 1 | | Adder 2 | | Adder 3 | +----+----+ +----+------+ +----+------+ +----+------+ | Carry C1 | Carry C2 | Carry C3 | Carry C4 |--------+ |-------+ |-------+ |---------> C4 | | | | v v v v S0 S1 S2 S3Boolean Equations:
For each stage
( ): - Sum:
- Carry:
- With initial carry input
: , and , and , and , and
- The least significant bit
- [5]
What are the differences between RISC and CISC architecture.
View model solution
Comparison: RISC vs. CISC Architecture
Parameter RISC (Reduced Instruction Set Computer) CISC (Complex Instruction Set Computer) Instruction Set Small set of simple, fundamental instructions (~50–100). Large set of diverse, complex instructions (300+). Instruction Length Fixed format (typically 32 bits / 4 bytes). Variable length (e.g., 1 to 15 bytes in x86). Execution Time Single-cycle execution for most instructions (pipelined). Multi-cycle execution per instruction. Memory Access Load/Store Architecture: Only LOADandSTOREaccess memory.Memory operands can be manipulated directly in ALU instructions. Addressing Modes Few, simple addressing modes (register, direct, displacement). Many complex addressing modes (scaled index, memory indirect). Registers Large general-purpose register file (32 or more). Smaller set of specialized/general registers (8–16). Control Unit Hardwired control unit for maximum speed. Microprogrammed control unit with control ROM. Pipelining Highly efficient and straightforward pipeline. Pipelining is complex due to variable length instructions. Examples ARM, MIPS, RISC-V, SPARC. Intel x86, AMD, Motorola 68000, VAX. - [5]
Explain the concept of associative mapping and direct mapping.
View model solution
Associative Mapping vs. Direct Mapping in Cache Memory
Cache mapping determines how blocks from main memory are placed into cache slots (cache lines).
1. Direct Mapping:
In direct mapping, each main memory block maps to exactly one specific cache line determined by a fixed modular function:
- Address Split: Divided into
[ Tag | Index / Line | Word Offset ]. - Advantages:
- Extremely simple hardware; lookup requires checking only one cache tag comparator.
- Very fast access time and inexpensive to build.
- Disadvantages:
- Conflict Misses (Thrashing): If two frequently used memory blocks map to the identical cache slot, they constantly evict each other even if other cache lines are empty.
2. Fully Associative Mapping:
In fully associative mapping, any block of main memory can reside in any line of the cache.
- Address Split: Divided only into
[ Tag | Word Offset ]. - Advantages:
- Maximum flexibility; virtually eliminates conflict misses. A block is only evicted when the entire cache is full (using replacement algorithms like LRU).
- Disadvantages:
- Requires parallel search across all tags simultaneously using expensive Content Addressable Memory (CAM) comparators, leading to higher hardware complexity and power consumption.
- Address Split: Divided into
- [10]
Write an assembly language program for addition of two 8-bit binary number and after addition the sum should be store in memory location 3040H.
View model solution
8085 Assembly Language Program: Addition of Two 8-Bit Numbers
Problem Statement:
Write an assembly program to add two 8-bit binary numbers stored in memory locations
3020Hand3021H. The result (sum) should be stored in memory location3040H, and if a carry is generated, store the carry in3041H.Assembly Source Code:
; ========================================================== ; Program: Addition of two 8-bit binary numbers ; Inputs: Memory 3020H (First Operand), 3021H (Second Operand) ; Outputs: Memory 3040H (Sum), 3041H (Carry) ; ========================================================== ORG 2000H ; Origin address in RAM MVI C, 00H ; Clear Register C to hold carry (Carry = 0) LDA 3020H ; Load first 8-bit number from 3020H into Accumulator (A) MOV B, A ; Copy first number into Register B LDA 3021H ; Load second 8-bit number from 3021H into Accumulator (A) ADD B ; Add Register B to Accumulator (A = A + B) JNC STORE_SUM ; Jump if No Carry (CY = 0) to STORE_SUM INR C ; If Carry generated (CY = 1), increment Register C STORE_SUM: STA 3040H ; Store lower 8-bit sum into memory location 3040H MOV A, C ; Move carry flag value from Register C to Accumulator STA 3041H ; Store carry (00H or 01H) into memory location 3041H HLT ; Halt the microprocessor executionStep-by-Step Program Walkthrough:
MVI C, 00H: Initializes carry counter registerto 00H.LDA 3020H: Fetches the first operand from memory address3020Hinto accumulator. MOV B, A: Saves the first operand into registerso accumulator can receive the second operand. LDA 3021H: Fetches second operand from3021Hinto. ADD B: The ALU addsto . Flags (Carry CY, ZeroZ, SignS) are updated based on sum.JNC STORE_SUM: Evaluates Carry flag. If no carry was produced, execution jumps overINR C.INR C: Executes only if carry occurred, setting. STA 3040H: Writes sum to3040H.STA 3041H: Writes carry byte to3041H.
- [10]
Illustrate and explain arithmetic pipeline for addition of two floating point binary number.
View model solution
Arithmetic Pipeline for Floating-Point Addition
Floating-point numbers are represented in normalized scientific notation:
wheredenotes the fractional mantissa and represents the exponent. Adding two floating-point binary numbers requires an arithmetic pipeline organized into four discrete sub-operation stages:
[ Input Operands: X = Mx * 2^Ex, Y = My * 2^Ey ] | v +-------------------------------+ | Stage 1: Compare Exponents | ---> Determine larger exponent | and Difference (d) | d = |Ex - Ey| +---------------+---------------+ | v +-------------------------------+ | Stage 2: Align the Mantissas | ---> Shift mantissa of smaller | (Right-shift smaller)| number right by d positions +---------------+---------------+ | v +-------------------------------+ | Stage 3: Add / Subtract | ---> Add aligned mantissas: | Mantissas | Mz = Mx' + My' +---------------+---------------+ | v +-------------------------------+ | Stage 4: Normalize Result & | ---> Shift Mz left/right until | Adjust Exponent | MSB is 1; update Ez +---------------+---------------+ | v [ Final Output: Z = Mz * 2^Ez ]Detailed Stage Breakdown:
-
Stage 1 — Compare Exponents by Subtraction:
- The exponents
and are subtracted: . - The larger exponent is chosen as the tentative exponent of the result (
). - If
, alignment is bypassed ( ).
- The exponents
-
Stage 2 — Align Mantissas (Shifter):
- The mantissa belonging to the operand with the smaller exponent is shifted to the right by
bit positions. - This equalizes the power bases of both operands so fractional parts can be directly added.
- The mantissa belonging to the operand with the smaller exponent is shifted to the right by
-
Stage 3 — Add Mantissas:
- The two mantissas (one unshifted and one right-shifted) are added using a high-speed parallel binary adder.
- Result: intermediate mantissa
.
-
Stage 4 — Normalize the Result:
- If mantissa addition overflowed (carry out of MSB = 1),
is shifted right by one bit and exponent is incremented by 1. - If mantissa has leading zeros,
is shifted left until the leading non-zero bit is in the normalized fraction position, and is decremented accordingly.
- If mantissa addition overflowed (carry out of MSB = 1),
-
- [10]
Explain strobe control method for Asynchronous Data Transfer.
View model solution
Strobe Control Method for Asynchronous Data Transfer
In Asynchronous Data Transfer, the transmitting and receiving units operate on separate, independent internal clock frequencies. Data transfer must be coordinated using control signals rather than a shared clock.
The Strobe Control Method employs a single control signal (the “strobe”) to indicate the initiation or readiness of a transfer.
1. Source-Initiated Strobe Transfer
In this method, the transmitting (source) unit initiates and drives the data transfer.
Source Unit Destination Unit +---------+ Data Bus [8-bit] +-------------+ | | ============================> | | | | Strobe Pulse | | | | ----------------------------> | | +---------+ +-------------+ Timing Diagram: Data Bus: ----------< Valid Data Word >-------------- +-------+ Strobe: --------------------+ +--------------Step-by-Step Sequence:
- The source unit places valid data onto the data bus.
- After a brief propagation delay (ensuring data lines stabilize), the source activates the Strobe line (logic high pulse).
- The destination unit senses the active strobe pulse and latches the data from the data bus into its input buffer register.
- The source deactivates the strobe and removes data from the bus.
2. Destination-Initiated Strobe Transfer
In this method, the receiving (destination) unit initiates the request for data from the source unit.
Source Unit Destination Unit +---------+ Data Bus [8-bit] +-------------+ | | ============================> | | | | Strobe Pulse | | | | <---------------------------- | | +---------+ +-------------+ Timing Diagram: +-------+ Strobe: --------------------+ +-------------- Data Bus: ----------------------< Valid Data Word >--Step-by-Step Sequence:
- The destination unit activates the Strobe signal requesting the source to send data.
- The source unit detects the strobe pulse, retrieves data, and places it onto the data bus.
- The destination unit latches the data off the bus and removes the strobe pulse.
Critical Limitation of Strobe Control (Why Handshaking is Preferred):
- Lack of Acknowledgment: The source has no way of verifying whether the destination actually received the data before placing new data on the bus.
- If the destination is slow or busy, data will be lost (overrun). Handshaking solves this by using two reciprocal lines (
Data ReadyandData Accepted).
- [10]
Explain the internal architecture of 8085 microprocessor with its functional block diagram.
View model solution
Internal Architecture of 8085 Microprocessor
The Intel 8085 is an 8-bit NMOS microprocessor packaged in a 40-pin DIP IC operating on a single
power supply with an internal clock frequency of . +-----------------------------------------------+ | 8085 FUNCTIONAL ARCHITECTURE | +-----------------------------------------------+ | [ Interrupt Control ] [ Serial I/O ] | | TRAP, RST7.5-5.5, INTR SID, SOD | +-----------------------+-----------------------+ | 8-bit Internal Bus +-----------------------+-------------------------+ | | | v v v +-------------+ +-------------+ +--------------+ | Accumulator | | Temp Reg (W)| | Instruction | | (8-bit) | +-------------+ | Register(IR) | +------+------+ | Temp Reg (Z)| +-------+------+ | +------+------+ | v | v +-------------+ | +--------------+ | ALU |<---------------+ | Instruction | | (8-bit) | | Decoder | +------+------+ +-------+------+ | | +---------> [ Flag Register (5 Flags) ] v +--------------+ +------------------------------------+ | Timing & | | General Purpose Registers | | Control Unit | | B (8) | C (8) | +--------------+ | D (8) | E (8) | | H (8) | L (8) | | Stack Pointer (SP - 16 bit) | | Program Counter (PC - 16 bit) | | Incrementer / Decrementer | +------------------+-----------------+ | +------------+------------+ | | v v [ Address Buffer ] [ Address / Data Buffer ] A15 - A8 (8-bit) AD7 - AD0 (8-bit)Major Functional Units:
-
Arithmetic and Logic Unit (ALU):
- Performs 8-bit arithmetic operations (addition, subtraction) and logical operations (AND, OR, XOR, complement).
- Operates on operands from the Accumulator and temporary registers (
and ).
-
Accumulator and Status Flags (Flag Register):
- Accumulator (A): Primary 8-bit register that holds one operand and receives ALU results.
- Flag Register (F): 5 flip-flops reflecting ALU status:
(Sign): Set if MSB ( ) of result is 1 (negative). (Zero): Set if result is exactly 0. (Auxiliary Carry): Set if carry generated from bit to (used for BCD). (Parity): Set if result contains even number of 1s. (Carry): Set if arithmetic operation produced carry out of MSB .
-
Register Array:
- General Purpose Registers (
): Can be used individually as 8-bit registers or paired as 16-bit register pairs ( ) for 16-bit pointers. - Program Counter (PC - 16 bits): Holds memory address of next instruction to be fetched; auto-increments after fetch.
- Stack Pointer (SP - 16 bits): Holds memory address of the current top of the stack in RAM.
- General Purpose Registers (
-
Instruction Register and Decoder:
- Fetches 8-bit opcode into IR and decodes it to determine micro-operation timing signals.
-
Timing and Control Unit:
- Generates signals:
CLK OUT,ALE,RD,WR,IO/M,S0,S1,RESET IN/OUT.
- Generates signals:
-
Interrupt Control & Serial I/O:
- Hardware interrupts:
TRAP(highest, non-maskable),RST 7.5,RST 6.5,RST 5.5,INTR. - Serial lines:
SID(Serial Input Data) andSOD(Serial Output Data).
- Hardware interrupts:
-
- [10]
What is divide overflow? Divide +(16)10 by -(3)10 using any one of the division algorithm.
View model solution
Divide Overflow and Binary Division Algorithm
1. Divide Overflow:
A Divide Overflow occurs in fixed-point binary division when the magnitude of the quotient is too large to be represented within the allocated quotient register.
- In computer hardware dividing a
-bit dividend by an -bit divisor, the quotient register is typically bits wide. - Overflow Condition: If the higher-order
bits of the dividend ( ) are greater than or equal to the divisor ( ): When detected, the hardware sets a Divide-Overflow flip-flop and aborts the division to prevent invalid arithmetic results.
2. Division:
by Operand Setup:
- Dividend:
(Magnitude = ) - Divisor:
, absolute magnitude = - Since signs are opposite (
and ):
Using the standard Restoring Division Algorithm on positive magnitudes (
): - Dividend in
(5 bits), Register , Divisor , Counter .
Step-by-Step Execution Table:
Step / Action Register A Register Q Counter ( ) Description Initial 00000100005 Load magnitudes of A and Q Cycle 1: Shift Left 000010000_Left shift 111100000_(Negative result) Restore , 00001000004 Restore , set Cycle 2: Shift Left 000100000_Left shift 111110000_(Negative) Restore , 00010000003 Restore , set Cycle 3: Shift Left 001000000_Left shift 000010000_( , Positive!) Set 00001000012 Successful subtraction, Cycle 4: Shift Left 000100001_Left shift 111110001_(Negative) Restore , 00010000101 Restore , set Cycle 5: Shift Left 001000010_Left shift 000010010_( , Positive!) Set 00001001010 , Counter reached 0 (Finish) Final Result:
- Quotient (
): . With negative sign: Quotient - Remainder (
): . With positive sign: Remainder - Verification:
(Accurate).
- In computer hardware dividing a