Untitled document (7)
Untitled document (7)
Write an assembly language program to find the largest number from an array of a 10
numbers. Assume suitable data.
DATA SEGMENT
ARR DB 1,4,2,3,9,8,6,7,5,10
LN DW 10
L DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA, CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,ARR
MOV AL,ARR[SI]
MOV L,AL
MOV CX,LN
REPEAT: MOV AL,ARR[SI]
CMP L,AL
JG NOCHANGE (or JNC NOCHANGE) MOV L,AL
NOCHANGE: INC SI LOOP REPEAT MOV AH,4CH INT 21H CODE ENDS
END START
Pipelining allows the CPU to fetch the next instruction while executing the current
one. In the 8086 microprocessor, the Bus Interface Unit (BIU) fetches up to 6
instruction bytes in advance and stores them in a FIFO queue for the Execution Unit
(EU). The EU decodes and executes instructions from this queue, speeding up
operations by reducing memory access delays. For branch instructions, the queue is
cleared, and new instructions are fetched from the branch target address.
Draw minimum mode configuration of 8086 and explain the function of any four
control signals
INTA: Indicates the processor has accepted a non-vectored INTR interrupt.
ALE: Address Latch Enable signal used to demultiplex address and data:
DEN: Data Enable signal for output enable of 8286 in minimum mode, active LOW during
memory, I/O, and INTA cycles.
DT/R: Controls data flow direction: 1: Data transmitted from 8086, 0: Data received by 8086.
M/IO: Distinguishes memory (M/IO=1) and I/O (M/IO=0) transfers.
WR: Indicates a write operation (memory or I/O) based on M/IO signal.
HOLD: Request by peripheral to control address/data lines.
HLDA: Acknowledge from the microprocessor to grant control of address/data lines.
List the addressing modes of 8086 and describe them with an example.
Immediate Addressing: Data is part of the instruction, used as the source operand. Ex: MOV
CL, 03H; ADD AX, 1234H.
Register Addressing: Operands are registers (8-bit: AL, AH, etc.; 16-bit: AX, BX, etc.). Ex:
MOV AL, BL; ADD CL, DL; MOV DS, AX.
Memory Addressing:
● Direct: Offset address in the instruction. Ex: MOV AL, [2000H]; MOV [1020],
5050H.
● Indirect: EA is calculated.
○ Register Indirect: EA = [BX, SI, DI]. Ex: MOV [DI], 1234H; MOV AX,
[BX].
○ Based + Displacement: EA = BX/BP + displacement. Ex: MOV AX,
[BX+300H].
○ Indexed: EA = SI/DI + displacement. Ex: MOV [DI+2345H], 1234H.
○ Based Indexed: EA = BX/BP + SI/DI. Ex: MOV [BX+DI], 1234H.
○ Based Indexed + Displacement: EA = BX/BP + SI/DI + displacement. Ex: MOV
[DI+BX+37H], AX.
The converter compares analog voltage (Va) with reference voltage (Vi) using a comparator.
● Operation:
1. If Va = Vi, no conversion is needed, and digital output matches Vi.
2. If Va ≠ Vi, Vi is adjusted:
■ Va > Vi: Vi increases by 50%.
■ Va < Vi: Vi decreases by 50%.
3. The updated Vi is converted to analog using a DAC, and the process repeats
until Va = Vi.
● Conversion Process:
1. SAR is cleared, and DAC output starts at 0V.
2. MSB is set, and VDAC is compared with Vin:
■ If VDAC < Vin, the bit stays set.
■ If VDAC > Vin, the bit resets.
3. Steps repeat for all bits (D6 to D0).
4. Final SAR output matches the analog input, and an end of conversion signal
is sent.
Compare the following (Any three points) i) Volatile with Non-volatile memory
Definition: Volatile Memory requires electrical power to retain information. Non-Volatile
Memory retains information without power.
Classification: Volatile Memory includes all RAMs. Non-Volatile Memory includes ROMs,
EPROM, and magnetic memories.
Effect of Power: Volatile Memory loses information when power is off. Non-Volatile Memory
retains information regardless of power.
Applications: Volatile Memory is used for temporary storage. Non-Volatile Memory is used
for permanent storage.
Circuit Configuration: SRAM uses flip-flops; DRAM uses one MOSFET and a capacitor per
cell.
Bits Stored: SRAM stores bits as voltage; DRAM stores bits as charges.
● If AAA and BBB are both 1, then A⋅B=1A \cdot B = 1A⋅B=1, and its
complement is 0. The sum of the complements of AAA and BBB is also 0.
● If either AAA or BBB is 0, then A⋅B=0A \cdot B = 0A⋅B=0, and its
complement is 1. The sum of the complements of AAA and BBB is also 1.
Second Theorem (A+B‾=A‾⋅B‾\overline{A + B} = \overline{A} \cdot \
overline{B}A+B=A⋅B):
working of JK flip-flop
The JK flip-flop is an improved version of the SR flip-flop, resolving the invalid condition
when both inputs are high (S = R = 1) by introducing two inputs, J and K, along with a clock
input. It uses cross-coupling between Q and Q' to interlock the inputs, allowing the flip-flop to
toggle its state when J = K = 1. The operation is synchronized with the clock, enabling four
states: no change (J = 0, K = 0), reset (J = 0, K = 1), set (J = 1, K = 0), and toggle (J = 1, K =
1). This design ensures stable and valid output for all input combinations.