મુખ્ય સામગ્રી પર જાઓ
  1. સંસાધનો/
  2. અભ્યાસ સામગ્રી/
  3. ઇન્ફોર્મેશન અને કમ્યુનિકેશન ટેકનોલોજી એન્જિનિયરિંગ/
  4. આઈસીટી સેમેસ્ટર 3/
  5. માઇક્રોપ્રોસેસર અને માઇક્રોકંટ્રોલર સિસ્ટમ્સ (1333202)/

માઈક્રોપ્રોસેસર અને માઈક્રોકંટ્રોલર સિસ્ટમ્સ (1333202) - ઉનાળો 2025 સોલ્યુશન

23 મિનિટ· ·
Study-Material Solutions Microprocessor Microcontroller 8085 8051 1333202 2025 Summer
મિલવ ડબગર
લેખક
મિલવ ડબગર
ઇલેક્ટ્રિકલ અને ઇલેક્ટ્રોનિક મેન્યુફેક્ચરિંગ ઉદ્યોગમાં અનુભવી લેક્ચરર. એમ્બેડેડ સિસ્ટમ્સ, ઈમેજ પ્રોસેસિંગ, ડેટા સાયન્સ, મેટલેબ, પાયથન, STM32માં કુશળ. એલ.ડી. કોલેજ ઓફ એન્જિનિયરિંગ - અમદાવાદથી કમ્યુનિકેશન સિસ્ટમ્સ એન્જિનિયરિંગમાં માસ્ટર્સ ડિગ્રી ધરાવતા મજબૂત શિક્ષણ વ્યાવસાયિક.
અનુક્રમણિકા

પ્રશ્ન 1(અ) [3 ગુણ]
#

8085 નું બસ ઓર્ગેનાઈઝેશન દોરો.

જવાબ:

CS8Coi0Png8Utn5raCololsntrAodDlda1r8tB86e-au0-sbs8bsiB5itutBsMuIsCROPROCESSMIPOe/oRmOrotrsy

બસના પ્રકારો:

  • Address Bus: મેમરી એડ્રેસિંગ માટે 16-bit એકદિશીય બસ
  • Data Bus: ડેટા ટ્રાન્સફર માટે 8-bit દ્વિદિશીય બસ
  • Control Bus: RD, WR, ALE, IO/M જેવા કંટ્રોલ સિગ્નલ્સ

મેમરી ટ્રીક: “ADC - Address, Data, Control”

પ્રશ્ન 1(બ) [4 ગુણ]
#

માઈક્રોપ્રોસેસરની માઈક્રોકંટ્રોલર સાથે સરખામણી કરો.

જવાબ:

લક્ષણમાઈક્રોપ્રોસેસરમાઈક્રોકંટ્રોલર
આર્કિટેક્ચરબાહ્ય ઘટકોની જરૂરએક જ ચિપ પર બધા ઘટકો
મેમરીબાહ્ય RAM/ROM જરૂરીઆંતરિક RAM/ROM ઉપલબ્ધ
કિંમતવધુ સિસ્ટમ કોસ્ટઓછી સિસ્ટમ કોસ્ટ
પાવરવધુ પાવર વપરાશઓછો પાવર વપરાશ
સાઈઝમોટું સિસ્ટમ સાઈઝકોમ્પેક્ટ સિસ્ટમ
ઉપયોગસામાન્ય હેતુ કમ્પ્યુટિંગએમ્બેડેડ કંટ્રોલ એપ્લિકેશનો

મુખ્ય મુદ્દાઓ:

  • માઈક્રોપ્રોસેસર: માત્ર CPU, બાહ્ય સપોર્ટ ચિપ્સ જરૂરી
  • માઈક્રોકંટ્રોલર: ચિપ પર સંપૂર્ણ કમ્પ્યુટર સિસ્ટમ

મેમરી ટ્રીક: “MICRO - Memory Internal, Compact, Reduced cost, Optimized”

પ્રશ્ન 1(ક) [7 ગુણ]
#

8085 માઈક્રોપ્રોસેસરના દરેક બ્લોક દોરો અને સમજાવો.

જવાબ:

graph TB
    A[Accumulator] --> ALU[Arithmetic Logic Unit]
    B[Register Array] --> ALU
    ALU --> F[Flag Register]
    
    PC[Program Counter] --> AB[Address Buffer]
    SP[Stack Pointer] --> AB
    AB --> ADDR[Address Bus 16-bit]
    
    IR[Instruction Register] --> ID[Instruction Decoder]
    ID --> CU[Control Unit]
    CU --> CB[Control Bus]
    
    DB[Data Buffer] <--> DATA[Data Bus 8-bit]
    
    T[Timing & Control] --> CU

બ્લોકના કાર્યો:

  • ALU: અંકગણિત અને તાર્કિક ઓપરેશન કરે છે
  • Accumulator: ડેટા પ્રોસેસિંગ માટે પ્રાથમિક કામકાજ રજિસ્ટર
  • Register Array: B, C, D, E, H, L સામાન્ય હેતુ રજિસ્ટરો
  • Program Counter: આગળના instruction નું address ધરાવે છે
  • Stack Pointer: મેમરીમાં stack ના ટોપને પોઈન્ટ કરે છે
  • Control Unit: પ્રોસેસરના એકંદર ઓપરેશનને કંટ્રોલ કરે છે

મેમરી ટ્રીક: “APRIL - ALU, Program counter, Registers, Instruction decoder, Logic control”

પ્રશ્ન 1(ક) OR [7 ગુણ]
#

8085 માઈક્રોપ્રોસેસરનો પીન ડાયાગ્રામ દોરો અને કોઈ પણ 4 પીન સમજાવો.

જવાબ:

ARTRRRIIDESSRSSSNN0VXXSOIATTTTT-s12EDDP765RA7sT...5551211-21234567890110988008855PI4333333333322N0987654321031-D2IVHHCRRISRWA9AAcOLLEEO1DRL1GcLDKSA/EA5RDA(EDM8-AOTY-AMUA8TI1)N5

પીન સમજાવટ:

  • ALE (Pin 30): Address Latch Enable - multiplexed bus પર address અને data અલગ કરે છે
  • RD (Pin 32): Read control signal - active low, read operation દર્શાવે છે
  • WR (Pin 31): Write control signal - active low, write operation દર્શાવે છે
  • RESET (Pin 36): Reset input - low થાય ત્યારે processor initialize કરે છે

મેમરી ટ્રીક: “ARWA - ALE, Read, Write, rAset”

પ્રશ્ન 2(અ) [3 ગુણ]
#

વ્યાખ્યા આપો: (1) Opcode (2) Operand

જવાબ:

વ્યાખ્યાઓ:

  • Opcode: Operation Code - કરવાનું operation સ્પષ્ટ કરે છે (ADD, MOV, JMP)
  • Operand: જે ડેટા અથવા address પર operation કરવાનું છે

ઉદાહરણ:

MOV A, B
|   |  |
|   |  +-- Operand 2 (Source)  
|   +-- Operand 1 (Destination)
+-- Opcode

મેમરી ટ્રીક: “OO - Operation + Operand”

પ્રશ્ન 2(બ) [4 ગુણ]
#

RISC અને CISC વચ્ચે તફાવત આપો.

જવાબ:

લક્ષણRISCCISC
Instructionsસરળ, fixed formatજટિલ, variable format
ExecutionSingle cycle executionMultiple cycle execution
Addressingથોડા addressing modesઘણા addressing modes
MemoryLoad/Store architectureMemory-to-memory operations
Compilerજટિલ compiler designસરળ compiler design

મુખ્ય મુદ્દાઓ:

  • RISC: Reduced Instruction Set Computer - સરળ, ઝડપી
  • CISC: Complex Instruction Set Computer - feature rich

મેમરી ટ્રીક: “RISC is SLIM - Simple, Load-store, Instruction reduced, Memory efficient”

પ્રશ્ન 2(ક) [7 ગુણ]
#

Von-Neumann અને Harvard Architecture વચ્ચે તફાવત આપો.

જવાબ:

લક્ષણVon-NeumannHarvard
Memorydata અને instructions માટે single memorydata અને instructions માટે અલગ memory
Bus StructureSingle bus systemDual bus system
Accessdata અને instructions ને sequential accesssimultaneous access શક્ય
Costઓછી કિંમતવધુ કિંમત
Speedbus conflicts કારણે ધીમુંparallel access કારણે ઝડપી
Examples8085, સામાન્ય computers8051, DSP processors
graph LR
    subgraph "Von-Neumann"
        CPU1[CPU] <--> MEM1[Combined Memory<br/>Data + Instructions]
    end
    
    subgraph "Harvard"  
        CPU2[CPU] <--> IMEM[Instruction Memory]
        CPU2 <--> DMEM[Data Memory]
    end

મેમરી ટ્રીક: “VH - Von has one bus, Harvard has two”

પ્રશ્ન 2(અ) OR [3 ગુણ]
#

વ્યાખ્યા આપો: (1) T-State (2) Instruction Cycle (3) Machine Cycle

જવાબ:

વ્યાખ્યાઓ:

  • T-State: Time state - મૂળભૂત timing unit, એક clock period
  • Instruction Cycle: એક instruction નું સંપૂર્ણ execution
  • Machine Cycle: એક memory operation માટે જરૂરી T-states નું જૂથ

સંબંધ:

Instruction Cycle = Multiple Machine Cycles
Machine Cycle = Multiple T-States (3-6 T-states)

મેમરી ટ્રીક: “TIM - T-state, Instruction cycle, Machine cycle”

પ્રશ્ન 2(બ) OR [4 ગુણ]
#

8085 ના Address અને Data Bus નું De-Multiplexing સમજાવો.

જવાબ:

graph TD
    A[AD0-AD7<br/>Multiplexed Bus] --> L[74LS373 Latch]
    ALE[ALE Signal] --> L
    L --> ADDR[A0-A7<br/>Address Lines]
    A --> DATA[D0-D7<br/>Data Lines]

પ્રક્રિયા:

  • Step 1: T1 દરમિયાન, AD0-AD7 માં lower 8-bit address હોય છે
  • Step 2: ALE high થાય છે, external latch માં address latch થાય છે
  • Step 3: બાકીના T-states માટે AD0-AD7 data bus બને છે

જરૂરી ઘટકો:

  • 74LS373: Address latching માટે Octal latch IC
  • ALE: Timing માટે Address Latch Enable signal

મેમરી ટ્રીક: “LAD - Latch Address with Data separation”

પ્રશ્ન 2(ક) OR [7 ગુણ]
#

8085 નો Flag Register દોરો અને સમજાવો.

જવાબ:

D7SD6ZD5XD4ACD3XD2PD1XD0CY

Flag વર્ણન:

  • CY (D0): Carry flag - carry આવે ત્યારે set થાય છે
  • P (D2): Parity flag - even parity માટે set થાય છે
  • AC (D4): Auxiliary carry - BCD operations માટે set થાય છે
  • Z (D6): Zero flag - પરિણામ zero હોય ત્યારે set થાય છે
  • S (D7): Sign flag - પરિણામ negative હોય ત્યારે set થાય છે

Flag Operations:

  • Conditional Jumps: Flag status પર આધારિત (JZ, JC, JP)
  • Arithmetic Results: ALU operations પછી automatically update થાય છે

મેમરી ટ્રીક: “SZAPC - Sign, Zero, Auxiliary, Parity, Carry”

પ્રશ્ન 3(અ) [3 ગુણ]
#

SFR એટલે શું? કોઈ પણ ત્રણ SFR ની યાદી બનાવો.

જવાબ:

SFR વ્યાખ્યા: Special Function Register - microcontroller માં વિશિષ્ટ કાર્યો સાથે dedicated registers

ત્રણ SFRs:

  • ACC (E0H): Accumulator register
  • PSW (D0H): Program Status Word
  • SP (81H): Stack Pointer register

લાક્ષણિકતાઓ:

  • Address Range: Internal RAM માં 80H થી FFH
  • Bit Addressable: કેટલાક SFRs individual bit access આપે છે
  • Function Specific: દરેકનું dedicated hardware function હોય છે

મેમરી ટ્રીક: “APS - ACC, PSW, Stack Pointer”

પ્રશ્ન 3(બ) [4 ગુણ]
#

Program Counter (PC) અને Data Pointer (DPTR) Register સમજાવો.

જવાબ:

Program Counter (PC):

  • Size: 16-bit register
  • Function: આગળના instruction નું address ધરાવે છે
  • Auto-increment: Instruction fetch પછી automatically increment થાય છે
  • Range: 0000H થી FFFFH

Data Pointer (DPTR):

  • Size: 16-bit register (DPH + DPL)
  • Function: External data memory locations ને point કરે છે
  • Usage: External memory access માટે MOVX instructions સાથે વપરાય છે
  • Components: DPH (83H) અને DPL (82H)
PDCP:TR:8PD3CPHHH8PD2CPHLL1166--bbiitt

મેમરી ટ્રીક: “PD - PC Points to Program, DPTR Points to Data”

પ્રશ્ન 3(ક) [7 ગુણ]
#

8051 નું આર્કિટેક્ચર દોરો અને સમજાવો.

જવાબ:

graph TB
    subgraph "8051 Architecture"
        ALU[8-bit ALU]
        ACC[Accumulator A]
        B[B Register]
        PSW[Program Status Word]
        
        SP[Stack Pointer]
        DPTR[Data Pointer DPTR]
        PC[Program Counter PC]
        
        ROM[4KB ROM<br/>0000-0FFF]
        RAM[128B RAM<br/>00-7F]
        SFR[SFR Area<br/>80-FF]
        
        P0[Port 0]
        P1[Port 1] 
        P2[Port 2]
        P3[Port 3]
        
        T0[Timer 0]
        T1[Timer 1]
        UART[Serial Port]
        INT[Interrupt Control]
    end
    
    ALU --- ACC
    ALU --- B
    ALU --- PSW

આર્કિટેક્ચર ઘટકો:

  • CPU: Accumulator અને B register સાથે 8-bit ALU
  • Memory: 4KB internal ROM, 128B internal RAM
  • I/O Ports: ચાર 8-bit bidirectional ports (P0-P3)
  • Timers: બે 16-bit timers/counters (T0, T1)
  • Serial Port: Communication માટે full duplex UART
  • Interrupts: Priority levels સાથે 5 interrupt sources

વિશેષ લક્ષણો:

  • Boolean Processor: Bit manipulation capabilities
  • Addressing Modes: 8 અલગ addressing modes
  • Power Management: Idle અને power-down modes

મેમરી ટ્રીક: “MIPTIS - Memory, I/O, Processor, Timers, Interrupts, Serial”

પ્રશ્ન 3(અ) OR [3 ગુણ]
#

8051 ની નીચેની પીન સમજાવો: (1) ALE (2) PSEN (3) XTAL1 & XTAL2

જવાબ:

પીન કાર્યો:

  • ALE (Pin 30): Address Latch Enable

    • Lower address byte latch કરવા માટે output pulse
    • Oscillator frequency ના 1/6 પર active high signal
  • PSEN (Pin 29): Program Store Enable

    • External program memory read માટે active low output
    • External EPROM ના OE pin સાથે જોડાય છે
  • XTAL1 & XTAL2 (Pins 19, 18): Crystal connections

    • Clock generation માટે external crystal જોડાય છે
    • સામાન્ય frequency: 11.0592 MHz અથવા 12 MHz
CrystXaT[GlACNL1DO1]scill-a[tCorrysCtoanln]e-c-t-i-onX[G:TCNA2DL]2

મેમરી ટ્રીક: “APX - ALE latches Address, PSEN enables Program, XTAL generates clocK”

પ્રશ્ન 3(બ) OR [4 ગુણ]
#

8051 માઈક્રોકંટ્રોલરનું આંતરિક RAM ઓર્ગેનાઈઝેશન સમજાવો.

જવાબ:

8773211000F80080805HHHHHHHH1IntBBBBDeaaaaerGSGDnnnnfneceakkkkaanrntuleaea3210lrtrtRacaM((((AlhleRRRRRMm0000ePPPo----gOuaurRRRRirrdry7777sgpp))))taoAoensrsrieeezaBaatnikon(173110028080808HHHHHH------B771100yF7F7F7tHHHHHHes(()872bybtyetse)s)

RAM વિભાગો:

  • Register Banks: 4 banks × 8 registers દરેક (00H-1FH)
  • Bit Addressable: Individual bit access સાથે 16 bytes (20H-2FH)
  • General Purpose: User data માટે 80 bytes (30H-7FH)
  • Stack Area: સામાન્યતે 08H થી ઉપર શરૂ થાય છે

Addressing:

  • Direct: વાસ્તવિક address વાપરીને (MOV 30H, A)
  • Indirect: Register pointer વાપરીને (MOV @R0, A)

મેમરી ટ્રીક: “RBGS - Register banks, Bit addressable, General purpose, Stack”

પ્રશ્ન 3(ક) OR [7 ગુણ]
#

8051 નો પીન ડાયાગ્રામ દોરો અને કોઈ પણ 4 પીન સમજાવો.

જવાબ:

PPPPPPPPXXPPPPPPPPR33333333TTV11111111E........AAS........S01234567LLS01234567E////////21TRTIITTWRXXNN01RDDDTT01123456789111111111120123456789080850151P43333333333222222222I09876543210987654321NDVPPPPPPPPEAPPPPPPPPPIc00000000ALS22222222Ac......../EE........G01234567V/N76543210R////////PP////////AAAAAAAAAPRAAAAAAAAMDDDDDDDDO1111119801234567G543210

પીન સમજાવટ:

  • RESET (Pin 9): Reset input - Active high, microcontroller initialize કરે છે
  • EA/VPP (Pin 31): External Access - Program memory selection control કરે છે
  • P0 (Pins 32-39): Port 0 - External memory માટે multiplexed address/data bus
  • P2 (Pins 21-28): Port 2 - External memory માટે high-order address bus

મેમરી ટ્રીક: “REPP - REset, External Access, Port 0, Port 2”

પ્રશ્ન 4(અ) [3 ગુણ]
#

R0 રજિસ્ટરમાં સ્ટોર થયેલ ડેટાને R1 રજિસ્ટરમાં સ્ટોર થયેલ ડેટા સાથે ગુણાકાર કરો અને પરિણામ R2 રજિસ્ટરમાં(LSB) અને R3 રજિસ્ટરમાં(MSB) સ્ટોર કરવાનો પ્રોગ્રામ લખો.

જવાબ:

ORG 0000H
MOV R0, #05H    ; પહેલો નંબર લોડ કરો
MOV R1, #03H    ; બીજો નંબર લોડ કરો
MOV A, R0       ; R0 ને accumulator માં મૂકો
MOV B, R1       ; R1 ને B register માં મૂકો
MUL AB          ; A અને B નો ગુણાકાર કરો
MOV R2, A       ; LSB ને R2 માં સ્ટોર કરો
MOV R3, B       ; MSB ને R3 માં સ્ટોર કરો
END

પ્રોગ્રામ ફ્લો:

  • Operands લોડ કરો R0 અને R1 માં
  • ટ્રાન્સફર કરો ગુણાકાર માટે A અને B registers માં
  • Execute કરો MUL AB instruction
  • સ્ટોર કરો 16-bit પરિણામ (A=LSB, B=MSB)

પરિણામ સ્ટોરેજ:

  • R2: Product ના lower 8 bits
  • R3: Product ના upper 8 bits

મેમરી ટ્રીક: “LTSE - Load, Transfer, multiply, Store result”

પ્રશ્ન 4(બ) [4 ગુણ]
#

ડેટા ટ્રાન્સફર ઇન્સ્ટ્રકશનની યાદી આપો. કોઈ પણ બે ડેટા ટ્રાન્સફર ઇન્સ્ટ્રકશન ઉદાહરણ સહિત સમજાવો.

જવાબ:

ડેટા ટ્રાન્સફર ઇન્સ્ટ્રકશન:

Instructionકાર્ય
MOVRegisters/memory વચ્ચે data move કરે છે
MOVXExternal memory થી data move કરે છે
MOVCCode byte ને accumulator માં move કરે છે
PUSHData ને stack પર push કરે છે
POPStack માંથી data pop કરે છે
XCHAccumulator સાથે register exchange કરે છે
XCHDLower nibble exchange કરે છે

વિગતવાર ઉદાહરણો:

1. MOV Instruction:

MOV A, #50H     ; Immediate data 50H ને accumulator માં લોડ કરો
MOV R0, A       ; Accumulator content ને R0 માં copy કરો
MOV 30H, A      ; Accumulator content ને address 30H પર સ્ટોર કરો

2. PUSH/POP Instructions:

PUSH ACC        ; Accumulator ને stack પર push કરો
PUSH 00H        ; R0 content ને stack પર push કરો
POP 01H         ; Stack content ને R1 માં pop કરો
POP ACC         ; Stack content ને accumulator માં pop કરો

મેમરી ટ્રીક: “Move Makes Programs Possible - MOV, MOVX, PUSH, POP”

પ્રશ્ન 4(ક) [7 ગુણ]
#

8051 ના એડ્રેસિંગ મોડ્સને વ્યાખ્યાયિત કરો અને સમજાવો.

જવાબ:

8051 એડ્રેસિંગ મોડ્સ:

મોડવર્ણનઉદાહરણઉપયોગ
ImmediateData instruction નો ભાગ છેMOV A, #50Hસ્થિર મૂલ્યો
RegisterRegister નો સીધો ઉપયોગMOV A, R0ઝડપી access
Directસીધું address વાપરે છેMOV A, 30HRAM locations
IndirectRegister ને pointer તરીકે વાપરે છેMOV A, @R0Dynamic addressing
IndexedBase + offset addressingMOVC A, @A+DPTRTable lookup
RelativePC + offsetSJMP LOOPBranch instructions
AbsoluteDirect jump addressLJMP 1000HLong jumps
BitIndividual bit accessSETB P1.0Control operations

વિગતવાર ઉદાહરણો:

; Immediate Addressing
MOV A, #25H         ; 25H ને A માં લોડ કરો

; Register Addressing  
MOV A, R1           ; R1 ને A માં copy કરો

; Direct Addressing
MOV A, 40H          ; Address 40H માંથી લોડ કરો

; Indirect Addressing
MOV R0, #40H        ; R0 40H ને point કરે છે
MOV A, @R0          ; R0 દ્વારા pointed address માંથી લોડ કરો

; Indexed Addressing
MOV DPTR, #TABLE    ; Table ને point કરો
MOV A, #02H         ; Index value
MOVC A, @A+DPTR     ; TABLE+2 માંથી લોડ કરો

મેમરી ટ્રીક: “IRIDRAB - Immediate, Register, Indirect, Direct, Relative, Absolute, Bit”

પ્રશ્ન 4(અ) OR [3 ગુણ]
#

R0 રજિસ્ટરમાં સ્ટોર થયેલ ડેટાનું 2’s Complement શોધવાનો પ્રોગ્રામ લખો.

જવાબ:

ORG 0000H
MOV R0, #85H        ; ટેસ્ટ ડેટા લોડ કરો
MOV A, R0           ; ડેટાને accumulator માં copy કરો
CPL A               ; બધા bits complement કરો (1's complement)
INC A               ; 2's complement માટે 1 ઉમેરો
MOV R1, A           ; પરિણામ R1 માં સ્ટોર કરો
END

Algorithm:

  • Step 1: R0 માંથી ડેટાને accumulator માં લોડ કરો
  • Step 2: CPL A વાપરીને બધા bits complement કરો
  • Step 3: 2’s complement માટે INC A વાપરીને 1 ઉમેરો
  • Step 4: પરિણામ પાછું સ્ટોર કરો

ચકાસણી:

મૂળ: 85H = 10000101B
1's Comp: 7AH = 01111010B  
2's Comp: 7BH = 01111011B

મેમરી ટ્રીક: “CCI - Complement, aCd 1, Include result”

પ્રશ્ન 4(બ) OR [4 ગુણ]
#

લોજિકલ ઇન્સ્ટ્રકશનની યાદી આપો. કોઈ પણ બે લોજિકલ ઇન્સ્ટ્રકશન ઉદાહરણ સહિત સમજાવો.

જવાબ:

લોજિકલ ઇન્સ્ટ્રકશન:

Instructionકાર્ય
ANLLogical AND operation
ORLLogical OR operation
XRLLogical XOR operation
CPLComplement operation
RL/RLCRotate left
RR/RRCRotate right
SWAPSwap nibbles

વિગતવાર ઉદાહરણો:

1. ANL (AND Logic):

MOV A, #0F0H        ; A = 11110000B
ANL A, #0AAH        ; 10101010B સાથે AND કરો
                    ; પરિણામ: A = 10100000B = A0H

ઉપયોગ: વિશિષ્ટ bits masking, અનચાહતા bits clear કરવા

2. ORL (OR Logic):

MOV A, #0F0H        ; A = 11110000B  
ORL A, #00FH        ; 00001111B સાથે OR કરો
                    ; પરિણામ: A = 11111111B = FFH

ઉપયોગ: વિશિષ્ટ bits setting, bit patterns combine કરવા

મેમરી ટ્રીક: “AXOR - AND masks, XOR toggles, OR sets, Rotate shifts”

પ્રશ્ન 4(ક) OR [7 ગુણ]
#

નીચેની ઇન્સ્ટ્રકશન સમજાવો: (1)ADDC (2) INC (3) DEC (4) JZ (5) SUBB (6) NOP (7) RET

જવાબ:

ઇન્સ્ટ્રકશન સમજાવટ:

1. ADDC (Add with Carry):

MOV A, #80H
ADDC A, #90H    ; A = A + 90H + Carry flag

કાર્ય: Source, destination, અને carry flag ઉમેરે છે

2. INC (Increment):

INC A           ; A = A + 1
INC R0          ; R0 = R0 + 1  
INC 30H         ; (30H) = (30H) + 1

કાર્ય: Operand માં 1 વધારે છે

3. DEC (Decrement):

DEC A           ; A = A - 1
DEC R1          ; R1 = R1 - 1
DEC 40H         ; (40H) = (40H) - 1  

કાર્ય: Operand માંથી 1 ઓછું કરે છે

4. JZ (Jump on Zero):

DEC A
JZ ZERO_LABEL   ; A = 0 હોય તો jump કરો

કાર્ય: Zero flag set હોય ત્યારે conditional jump

5. SUBB (Subtract with Borrow):

MOV A, #50H
SUBB A, #30H    ; A = A - 30H - Carry flag

કાર્ય: Accumulator માંથી source અને carry ઓછું કરે છે

6. NOP (No Operation):

NOP             ; કંઈ ન કરો, 1 cycle વાપરો

કાર્ય: Timing delay આપે છે, placeholder

7. RET (Return):

CALL SUBROUTINE
...
SUBROUTINE:
    MOV A, #10H
    RET         ; Caller ને પાછા જાઓ

કાર્ય: Subroutine માંથી calling address પર પાછા જાય છે

મેમરી ટ્રીક: “AIDS NR - Add, Increment, Decrement, Subtract, No-op, Return”

પ્રશ્ન 5(અ) [3 ગુણ]
#

DJNZ અને CJNE ઇન્સ્ટ્રકશન યોગ્ય ઉદાહરણ સહિત સમજાવો.

જવાબ:

DJNZ (Decrement and Jump if Not Zero):

MOV R0, #05H        ; Counter initialize કરો
LOOP:
    MOV A, #00H     ; કોઈ operation
    DJNZ R0, LOOP   ; R0 ઓછું કરો, zero નથી તો jump કરો

કાર્ય: Decrement અને conditional jump operations combine કરે છે

CJNE (Compare and Jump if Not Equal):

MOV A, #30H
CJNE A, #30H, NOT_EQUAL  ; A ને 30H સાથે compare કરો
MOV R0, #01H             ; Equal case
SJMP CONTINUE
NOT_EQUAL:
    MOV R0, #00H         ; Not equal case
CONTINUE:

કાર્ય: બે operands compare કરે છે અને સમાન નથી તો jump કરે છે

ઉપયોગો:

  • DJNZ: Loop control, counting operations
  • CJNE: Decision making, condition checking

મેમરી ટ્રીક: “DC - Decrement count, Compare jump”

પ્રશ્ન 5(બ) [4 ગુણ]
#

ટાઈમર 0 નો ઉપયોગ કરી 30 મિલી સેકંડનો ટાઈમ ડિલે જનરેટ કરવા માટે એસેમ્બલી પ્રોગ્રામ બનાવો. ક્રિસ્ટલ ફ્રિકવન્સી 12 મેગા હર્ટઝ ગણતરીમાં લેવી.

જવાબ:

ORG 0000H
MAIN:
    CALL DELAY_30MS     ; 30ms delay call કરો
    SJMP MAIN           ; Repeat કરો

DELAY_30MS:
    MOV TMOD, #01H      ; Timer 0, Mode 1 (16-bit)
    MOV TH0, #8AH       ; 30ms માટે high byte લોડ કરો
    MOV TL0, #23H       ; Low byte લોડ કરો
    SETB TR0            ; Timer 0 start કરો
WAIT:
    JNB TF0, WAIT       ; Timer overflow માટે રાહ જુઓ
    CLR TR0             ; Timer stop કરો
    CLR TF0             ; Timer flag clear કરો
    RET
END

30ms delay માટે ગણતરી:

Crystal Frequency = 12 MHz
Machine Cycle = 12/12 MHz = 1 µs
30ms માટે = 30,000 µs = 30,000 machine cycles

Timer Count = 65536 - 30000 = 35536 = 8A23H
TH0 = 8AH, TL0 = 23H

Timer Configuration:

  • TMOD: Timer mode register configuration
  • TH0/TL0: Timer 0 high/low byte registers
  • TR0: Timer 0 run control bit
  • TF0: Timer 0 overflow flag

મેમરી ટ્રીક: “CLSW - Calculate, Load, Start, Wait”

પ્રશ્ન 5(ક) [7 ગુણ]
#

8051 માઈક્રોકંટ્રોલર સાથે LCD નો ઇન્ટરફેસિંગ ડાયાગ્રામ દોરો અને ઇન્ટરફેસિંગ માટે જરૂરી LCD ની તમામ પીનો સમજાવો.

જવાબ:

88PPPPPPP+GG0022221115NN55.......VDD117654210toLCDInterDDDDERRVVVf7654NWSCSEaCSEci((((((((((nPPPPPPPPPPgiiiiiiiiiinnnnnnnnnn(41111654213-14321))))))b6))))ix[t2ComLnoCtdDrea)st]

LCD પીન કાર્યો:

  • RS (Pin 4): Register Select - 0=Command, 1=Data
  • RW (Pin 5): Read/Write - 0=Write, 1=Read
  • EN (Pin 6): Enable - Data transfer માટે high to low pulse
  • D4-D7 (Pins 11-14): Commands/data માટે 4-bit data lines

ઇન્ટરફેસ જરૂરિયાતો:

  • Power Supply: VCC=+5V, VSS=GND, VEE=Contrast control
  • Control Lines: LCD control માટે 3 pins (RS, RW, EN)
  • Data Lines: 4-bit mode operation માટે 4 pins (D4-D7)

મૂળભૂત LCD Commands:

  • 0x38: Function set (8-bit, 2 lines)
  • 0x0E: Display ON, cursor ON
  • 0x01: Clear display
  • 0x80: Set cursor to first line

મેમરી ટ્રીક: “REED - RS selects, RW reads, EN enables, Data transfers”

પ્રશ્ન 5(અ) OR [3 ગુણ]
#

65h મેમરી લોકેશન પર સ્ટોર થયેલ ડેટાનું 75h મેમરી લોકેશન પર સ્ટોર થયેલ ડેટા સાથે OR ઓપરેશન કરો અને પરિણામ R6 રજિસ્ટરમાં સ્ટોર કરવાનો પ્રોગ્રામ લખો.

જવાબ:

ORG 0000H
MOV 65H, #0F0H      ; 65H પર ટેસ્ટ ડેટા સ્ટોર કરો
MOV 75H, #0AAH      ; 75H પર ટેસ્ટ ડેટા સ્ટોર કરો

MOV A, 65H          ; 65H માંથી ડેટાને accumulator માં લોડ કરો
ORL A, 75H          ; 75H પરના ડેટા સાથે OR કરો
MOV R6, A           ; પરિણામ R6 register માં સ્ટોર કરો
END

ઓપરેશન વિગતો:

  • Load: Memory location 65H માંથી પહેલો operand
  • OR: 75H પરના બીજા operand સાથે logical OR કરો
  • Store: પરિણામ R6 register માં

ઉદાહરણ ગણતરી:

65H પરનો ડેટા: F0H = 11110000B
75H પરનો ડેટા: AAH = 10101010B  
OR પરિણામ:   FAH = 11111010B

મેમરી ટ્રીક: “LOS - Load, OR, Store result”

પ્રશ્ન 5(બ) OR [4 ગુણ]
#

P1.3 પર 2 કિલો હર્ટઝનો સ્કવેર વેવ જનરેટ કરવા માટે એસેમ્બલી પ્રોગ્રામ લખો. ક્રિસ્ટલ ફ્રિકવન્સી 11.0592 મેગા હર્ટઝ ગણતરીમાં લેવી.

જવાબ:

ORG 0000H
MAIN:
    SETB P1.3           ; P1.3 ને high કરો
    CALL DELAY_250US    ; અડધા period માટે delay
    CLR P1.3            ; P1.3 ને low કરો
    CALL DELAY_250US    ; અડધા period માટે delay
    SJMP MAIN           ; સતત repeat કરો

DELAY_250US:
    MOV TMOD, #01H      ; Timer 0, Mode 1
    MOV TH0, #0FEH      ; High byte લોડ કરો
    MOV TL0, #0CBH      ; Low byte લોડ કરો
    SETB TR0            ; Timer 0 start કરો
WAIT:
    JNB TF0, WAIT       ; Overflow માટે રાહ જુઓ
    CLR TR0             ; Timer stop કરો
    CLR TF0             ; Flag clear કરો
    RET
END

2KHz Square Wave માટે ગણતરી:

Frequency = 2KHz, Period = 500µs
Half Period = 250µs

Crystal = 11.0592 MHz
Machine Cycle = 11.0592/12 = 0.921 MHz = 1.085µs

Timer Count = 250µs / 1.085µs = 230 cycles
Timer Value = 65536 - 230 = 65306 = FECBH
TH0 = FEH, TL0 = CBH

Square Wave Generation:

  • High Period: Pin high કરો, 250µs રાહ જુઓ
  • Low Period: Pin low કરો, 250µs રાહ જુઓ
  • Frequency: 1/(250µs + 250µs) = 2KHz

મેમરી ટ્રીક: “SCDW - Set high, Clear low, Delay, Wait”

પ્રશ્ન 5(ક) OR [7 ગુણ]
#

8051 માઈક્રોકંટ્રોલર સાથે 7-Segment ડિસ્પ્લેનો ઇન્ટરફેસિંગ દોરો અને સમજાવો.

જવાબ:

88PPPPPPPP[FCFC0011111111Roooo55........]rmrm1101234567mm=CoCotPononooCmmrumpmp7t--------roioi-[[[[[[[[rnnnnS1RRRRRRRRee]]]]]]]]nC(A(g--------taPnPm--------tioie--------lhndnn--------ioet>>>>>>>>md3:3ie,,Dabcdefgdt:88ipi))snp((((((((glPPPPPPPPaiiiiiiiirynnnnnnnne7sI-76421915iG+nS))))))0)sN5te)tDVegormrfean(ctffee3iagd3nDagd0giagdΩsagd)pbbccldapy

ડિસ્પ્લે કોન્ફિગરેશન:

અક્ષરCommon Cathode કોડCommon Anode કોડ
03FHC0H
106HF9H
25BHA4H
34FHB0H
466H99H
56DH92H
67DH82H
707HF8H
87FH80H
96FH90H

નમૂના પ્રોગ્રામ:

ORG 0000H
MOV DPTR, #DIGIT_TABLE  ; Lookup table ને point કરો
MOV A, #05H             ; અંક 5 દર્શાવો
MOVC A, @A+DPTR         ; 7-segment કોડ મેળવો
MOV P1, A               ; Display ને મોકલો
SJMP $                  ; અહીં રહો

DIGIT_TABLE:
DB 3FH, 06H, 5BH, 4FH, 66H  ; 0,1,2,3,4
DB 6DH, 7DH, 07H, 7FH, 6FH  ; 5,6,7,8,9
END

ઇન્ટરફેસ ઘટકો:

  • Current Limiting Resistors: LED current મર્યાદિત કરવા 330Ω
  • Common Connection: GND ને cathode અથવા +5V ને anode
  • Data Lines: Segments a-g અને decimal point માટે 8 bits

મલ્ટિપલ ડિજિટ્સ માટે Multiplexing:

  • Digit Select: Digit selection માટે વધારાના pins
  • Time Division: Digits વચ્ચે ઝડપથી switch કરવું
  • Persistence of Vision: એકસાથે display નો ભ્રમ બનાવે છે

મેમરી ટ્રીક: “CRAM - Common connection, Resistors limit, Address segments, Multiplex digits”

સંબંધિત

માઇક્રોપ્રોસેસર અને માઇક્રોકંટ્રોલર સિસ્ટમ્સ (1333202) - શિયાળો 2023 સોલ્યુશન
23 મિનિટ
Study-Material Solutions Microprocessor Microcontroller 1333202 2023 Winter Gujarati
Java Programming (4343203) - Summer 2025 Solution (ગુજરાતી)
27 મિનિટ
Study-Material Solutions Java-Programming 4343203 2025 Summer
Foundation of AI and ML (4351601) - Summer 2025 Solution (Gujarati)
Study-Material Solutions Ai-Ml 4351601 2025 Summer Gtu Gujarati
VLSI (4361102) - Summer 2025 Solution - ગુજરાતી
Study-Material Solutions Vlsi 4361102 2025 Summer
વાયરલેસ સેન્સર નેટવર્ક્સ અને IoT (4353201) - સમર 2025 સોલ્યુશન
32 મિનિટ
Study-Material Solutions Wireless-Sensor-Networks Iot 4353201 2025 Summer
Computer Networks & Data Communication (4361101) - Summer 2025 Solution (Gujarati)
Study-Material Solutions Computer-Networks 4361101 2025 Summer Gujarati