Skip to main content
  1. Resources/
  2. Study Materials/
  3. Information & Communication Technology Engineering/
  4. ICT Semester 3/
  5. Microprocessor & Microcontroller Systems (1333202)/

Microprocessor & Microcontroller Systems (1333202) - Winter 2024 Solution

21 mins· ·
Study-Material Solutions Microprocessor Microcontroller 8085 8051 1333202 2024 Winter
Milav Dabgar
Author
Milav Dabgar
Experienced lecturer in the electrical and electronic manufacturing industry. Skilled in Embedded Systems, Image Processing, Data Science, MATLAB, Python, STM32. Strong education professional with a Master’s degree in Communication Systems Engineering from L.D. College of Engineering - Ahmedabad.
Table of Contents

Question 1(a) [3 marks]
#

List the features of 8051 Microcontroller.

Answer:

The 8051 microcontroller has several important features:

FeatureDescription
CPU8-bit CPU optimized for control applications
Memory4KB internal ROM, 128 bytes internal RAM
I/O Ports4 bidirectional 8-bit I/O ports (P0-P3)
TimersTwo 16-bit timer/counters (Timer 0 & Timer 1)
Interrupts5 interrupt sources with 2 priority levels
Serial PortFull duplex UART for serial communication

Mnemonic: “CPU Memory Input-Output Timers Interrupts Serial” (C-MIT-IS)

Question 1(b) [4 marks]
#

Define: Opcode, Operand, Instruction cycle, Machine cycle

Answer:

TermDefinition
OpcodeOperation code that specifies the operation to be performed
OperandData or address on which the operation is performed
Instruction CycleComplete process of fetching, decoding and executing an instruction
Machine CycleTime required to access memory or I/O device

Diagram:

graph LR
    A[Fetch] --> B[Decode] --> C[Execute]
    C --> A
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8

Mnemonic: “OOID” - Opcode Operand Instruction-cycle Data-cycle

Question 1(c) [7 marks]
#

Compare Von Neumann and Harvard Architecture.

Answer:

ParameterVon NeumannHarvard
Memory StructureSingle memory for program and dataSeparate memory for program and data
Bus SystemSingle bus systemSeparate bus for program and data
SpeedSlower due to bus conflictsFaster simultaneous access
CostLower costHigher cost
ComplexitySimple designComplex design
Examples8085, x86 processors8051, DSP processors

Diagram:

graph TB
    subgraph "Von Neumann"
        A[CPU] --- B[Single Bus]
        B --- C[Memory<br/>Program + Data]
    end
    
    subgraph "Harvard" 
        D[CPU] --- E[Program Bus]
        D --- F[Data Bus]
        E --- G[Program Memory]
        F --- H[Data Memory]
    end

Mnemonic: “VSBSC vs HSDFC” (Von-Single-Bus-Simple-Cheap vs Harvard-Separate-Dual-Fast-Complex)

Question 1(c) OR [7 marks]
#

Compare RISC and CISC.

Answer:

ParameterRISCCISC
Instruction SetReduced, simple instructionsComplex instruction set
Instruction SizeFixed size instructionsVariable size instructions
Execution TimeSingle clock cycle per instructionMultiple clock cycles
Memory AccessLoad/Store architectureMemory-to-memory operations
CompilerComplex compiler requiredSimple compiler
ExamplesARM, MIPS8085, x86

Diagram:

graph LR
    subgraph "RISC"
        A[Simple Instructions] --> B[Fast Execution]
        B --> C[Complex Compiler]
    end
    
    subgraph "CISC"
        D[Complex Instructions] --> E[Slow Execution]
        E --> F[Simple Compiler]
    end

Mnemonic: “RISC-SFS vs CISC-CSS” (Simple-Fast-Complex vs Complex-Slow-Simple)

Question 2(a) [3 marks]
#

List the 16-bit Registers available in 8085 and Explain its Function.

Answer:

RegisterFunction
PC (Program Counter)Points to next instruction address
SP (Stack Pointer)Points to top of stack in memory
BC, DE, HLGeneral purpose register pairs for data storage
  • PC: Automatically increments after each instruction fetch
  • SP: Decrements during PUSH, increments during POP operations
  • Register Pairs: Can store 16-bit addresses or data

Mnemonic: “PC SP BDH” (Program-Counter Stack-Pointer BC-DE-HL)

Question 2(b) [4 marks]
#

Explain Address and Data Bus De-multiplexing in 8085.

Answer:

De-multiplexing separates address and data signals from AD0-AD7 pins.

Process:

  • ALE (Address Latch Enable) signal controls the process
  • During T1 state: AD0-AD7 contains lower 8-bit address
  • ALE goes HIGH: Address is latched in external latch (74LS373)
  • During T2-T3: AD0-AD7 becomes data bus

Diagram:

AD0-78085D0-ADL7E(Data7L4aBLtuScs3h)73A0-A7

Mnemonic: “ALE Latches Address Low”

Question 2(c) [7 marks]
#

Explain Pin Diagram of 8085 with neat sketch.

Answer:

The 8085 is a 40-pin microprocessor with the following pin configuration:

Pin GroupFunction
AD0-AD7Multiplexed Address/Data bus (Lower 8-bit)
A8-A15Higher order Address bus
ALEAddress Latch Enable signal
RD, WRRead and Write control signals
IO/MI/O or Memory operation indicator
S0, S1Status signals

Pin Diagram:

RRRRETSSSIISSSRTTTNNAAAAAAAAVXXEOIA765TTDDDDDDDDs12TDDP...RA01234567s555------123456789111111111120123456789080854333333333322222222209876543210987654321VHHCRRISRWASAAAAAAAAcOLLEEO1DRL011111198cLDKSA/E543210DAEDMTYIN

Key Features:

  • 40-pin DIP package
  • Multiplexed bus reduces pin count
  • Control signals for timing and operation
  • Interrupt pins for external device communication

Mnemonic: “Address Data Control Power Interrupt” (ADCPI)

Question 2(a) OR [3 marks]
#

Explain Instruction Fetching Operation in 8085.

Answer:

Instruction fetching is the first step in instruction cycle:

Steps:

  1. PC contents placed on address bus (A0-A15)
  2. ALE signal goes high to latch address
  3. RD signal goes low to read memory
  4. Instruction fetched from memory to data bus
  5. PC incremented to point to next instruction

Timing:

  • Occurs during T1 and T2 states of machine cycle
  • Takes 4 clock cycles for simple instructions

Mnemonic: “PC ALE RD Fetch Increment” (PARFI)

Question 2(b) OR [4 marks]
#

Explain Flag Register of 8085.

Answer:

The Flag Register stores status information after arithmetic/logical operations:

BitFlagFunction
D7S (Sign)Set if result is negative
D6Z (Zero)Set if result is zero
D5-Not used
D4AC (Auxiliary Carry)Set if carry from bit 3 to 4
D3-Not used
D2P (Parity)Set if result has even parity
D1-Not used
D0CY (Carry)Set if carry/borrow generated

Diagram:

D7SD6ZD5XD4ACD3XD2PD1XD0CY

Mnemonic: “S-Z-X-AC-X-P-X-CY”

Question 2(c) OR [7 marks]
#

Explain Architecture of 8085 with neat sketch.

Answer:

The 8085 architecture consists of several functional blocks:

Major Components:

  • ALU (Arithmetic Logic Unit): Performs arithmetic and logical operations
  • Registers: Store data and addresses temporarily
  • Control Unit: Generates control signals for operation
  • Address/Data Bus: Communicates with external devices

Block Diagram:

graph TB
    subgraph "8085 Architecture"
        A[Accumulator<br/>A] 
        B[Registers<br/>B,C,D,E,H,L]
        C[ALU]
        D[Flags]
        E[PC]
        F[SP]
        G[Control Unit]
        H[Address Bus<br/>A0-A15]
        I[Data Bus<br/>AD0-AD7]
        
        A <--> C
        B <--> C
        C --> D
        G --> H
        G <--> I
        E --> H
        F --> H
    end

Key Features:

  • 8-bit microprocessor with 16-bit address bus
  • Von Neumann architecture with shared bus
  • Register-based operations for faster execution
  • Interrupt capability for real-time applications

Mnemonic: “ALU Registers Control Address Data” (ARCAD)

Question 3(a) [3 marks]
#

Explain Internal RAM Organization of 8051 Microcontroller.

Answer:

The 8051 has 128 bytes of internal RAM organized as:

Address RangePurpose
00H-1FHRegister Banks (4 banks of 8 registers each)
20H-2FHBit Addressable Area (16 bytes)
30H-7FHGeneral Purpose RAM (80 bytes)

Organization:

  • Bank 0: 00H-07H (Default register bank)
  • Bank 1: 08H-0FH
  • Bank 2: 10H-17H
  • Bank 3: 18H-1FH

Diagram:

7320F000HHHHGBeiRnteBegarAAinaRdrsklAdetsMraePerusrspaobslee

Mnemonic: “Register Bit General” (RBG)

Question 3(b) [4 marks]
#

Explain Function of Each bit of TMOD SFR of 8051 Microcontroller.

Answer:

TMOD (Timer Mode) register controls the operation of Timer 0 and Timer 1:

BitNameFunction
D7GATE1Timer 1 gate control
D6C/T1Timer/Counter select for Timer 1
D5M11Mode bit 1 for Timer 1
D4M01Mode bit 0 for Timer 1
D3GATE0Timer 0 gate control
D2C/T0Timer/Counter select for Timer 0
D1M10Mode bit 1 for Timer 0
D0M00Mode bit 0 for Timer 0

Bit Functions:

  • GATE: 1 = External gate control, 0 = Internal control
  • C/T: 1 = Counter mode, 0 = Timer mode
  • M1,M0: Timer operating modes (00=Mode0, 01=Mode1, 10=Mode2, 11=Mode3)

Mnemonic: “GATE C/T Mode1 Mode0” for each timer

Question 3(c) [7 marks]
#

Explain Architecture of 8051 with neat sketch.

Answer:

The 8051 microcontroller has Harvard architecture with separate program and data memory:

Key Components:

  • 8-bit CPU with Boolean processor
  • Internal ROM: 4KB program memory
  • Internal RAM: 128 bytes data memory
  • Four I/O Ports: P0, P1, P2, P3 (8-bit each)
  • Two Timers: 16-bit Timer/Counter 0 and 1
  • Serial Port: Full duplex UART

Architecture Diagram:

graph TB
    subgraph "8051 Architecture"
        A[CPU<br/>8-bit]
        B[Internal ROM<br/>4KB]
        C[Internal RAM<br/>128 bytes]
        D[Port 0<br/>P0.0-P0.7]
        E[Port 1<br/>P1.0-P1.7]
        F[Port 2<br/>P2.0-P2.7]
        G[Port 3<br/>P3.0-P3.7]
        H[Timer 0]
        I[Timer 1]
        J[Serial Port]
        K[Interrupt<br/>Controller]
        
        A --- B
        A --- C
        A --- D
        A --- E
        A --- F
        A --- G
        A --- H
        A --- I
        A --- J
        A --- K
    end

Special Features:

  • Harvard Architecture: Separate buses for program and data
  • SFR (Special Function Registers): Control various peripherals
  • Interrupt System: 5 interrupt sources
  • Power Saving Modes: Idle and Power-down modes

Mnemonic: “CPU ROM RAM Ports Timers Serial Interrupts” (CRRRPTI)

Question 3(a) OR [3 marks]
#

Explain PSW SFR of 8051 Microcontroller.

Answer:

PSW (Program Status Word) contains status flags and register bank selection:

BitFlagFunction
D7CYCarry flag
D6ACAuxiliary carry flag
D5F0Flag 0 (user defined)
D4RS1Register bank select bit 1
D3RS0Register bank select bit 0
D2OVOverflow flag
D1-Reserved
D0PParity flag

Register Bank Selection:

  • RS1=0, RS0=0: Bank 0 (00H-07H)
  • RS1=0, RS0=1: Bank 1 (08H-0FH)
  • RS1=1, RS0=0: Bank 2 (10H-17H)
  • RS1=1, RS0=1: Bank 3 (18H-1FH)

Mnemonic: “CY AC F0 RS1 RS0 OV - P”

Question 3(b) OR [4 marks]
#

Explain Function of Each bit of SCON SFR of 8051 Microcontroller.

Answer:

SCON (Serial Control) register controls the serial port operation:

BitNameFunction
D7SM0Serial mode bit 0
D6SM1Serial mode bit 1
D5SM2Multiprocessor communication
D4RENReceive enable
D3TB89th bit to transmit
D2RB89th bit received
D1TITransmit interrupt flag
D0RIReceive interrupt flag

Serial Modes:

  • Mode 0: Shift register, fixed baud rate
  • Mode 1: 8-bit UART, variable baud rate
  • Mode 2: 9-bit UART, fixed baud rate
  • Mode 3: 9-bit UART, variable baud rate

Control Functions:

  • REN: Must be set to enable reception
  • TI/RI: Set by hardware, cleared by software

Mnemonic: “SM0 SM1 SM2 REN TB8 RB8 TI RI”

Question 3(c) OR [7 marks]
#

Explain Pin Diagram of 8051 with neat sketch.

Answer:

The 8051 is available in 40-pin DIP package:

Pin Groups:

  • Ports 0-3: I/O pins with dual functions
  • Power: VCC, VSS pins
  • Crystal: XTAL1, XTAL2 for clock
  • Control: RST, EA, ALE, PSEN

Pin Diagram:

PPPPPPPP33333333XXPPPPPPPP........TT11111111R01234567AAV........S////////LLs01234567TRTIITTWR21sXXNN01RDDDTT01----123456789111111111120123456789080514333333333322222222209876543210987654321VPPPPPPPPEAPPPPPPPPPc00000000ALS22222222c......../EE........01234567V/N76543210////////PP////////AAAAAAAAPRAAAAAAAADDDDDDDDO1111119801234567G543210

Port Functions:

  • Port 0: Multiplexed address/data bus
  • Port 1: General purpose I/O
  • Port 2: Higher order address bus
  • Port 3: Alternate functions (UART, interrupts, timers)

Mnemonic: “Port Power Crystal Control” (PPCC)

Question 4(a) [3 marks]
#

Write and Explain any Three Data Transfer Instructions of 8051 Microcontroller.

Answer:

Data transfer instructions move data between registers, memory, and I/O:

InstructionFunction
MOV A,R0Move contents of R0 to Accumulator
MOV R1,#50HMove immediate data 50H to R1
MOV 30H,AMove Accumulator contents to address 30H

Code Examples:

MOV A,R0        ; A = R0
MOV R1,#50H     ; R1 = 50H  
MOV 30H,A       ; [30H] = A

Key Features:

  • No flags affected during data transfer
  • Various addressing modes supported
  • Single cycle execution for most instructions

Mnemonic: “MOV Between Register Immediate Direct” (MBRID)

Question 4(b) [4 marks]
#

Write 8051 Assembly Language Program to Multiply Content of R0 and R1 and Store Result in R5 (Lower Byte) and R6 (Higher Byte).

Answer:

ORG 0000H           ; Origin at 0000H

START:
    MOV A,R0        ; Load R0 into Accumulator
    MOV B,R1        ; Load R1 into B register
    MUL AB          ; Multiply A and B
    MOV R5,A        ; Store lower byte in R5
    MOV R6,B        ; Store higher byte in R6
    
    SJMP $          ; Stop program

END                 ; End of program

Program Flow:

  1. Load multiplicand from R0 to A
  2. Load multiplier from R1 to B
  3. Execute multiplication using MUL AB
  4. Store lower byte of result in R5
  5. Store higher byte of result in R6

Note: MUL AB instruction automatically stores 16-bit result with lower byte in A and higher byte in B.

Question 4(c) [7 marks]
#

List Addressing Modes of 8051 Microcontroller and Explain each with Example.

Answer:

The 8051 supports several addressing modes:

ModeDescriptionExample
ImmediateData specified in instructionMOV A,#50H
RegisterRegister contains dataMOV A,R0
DirectMemory address specifiedMOV A,30H
IndirectRegister contains addressMOV A,@R0
IndexedBase + offset addressingMOVC A,@A+DPTR
RelativePC + offsetSJMP LABEL
BitBit-specific operationsSETB P1.0

Detailed Examples:

1. Immediate Addressing:

MOV A,#25H      ; A = 25H (immediate data)

2. Register Addressing:

MOV A,R1        ; A = contents of R1

3. Direct Addressing:

MOV A,40H       ; A = contents of memory location 40H

4. Indirect Addressing:

MOV R0,#40H     ; R0 = 40H (address)
MOV A,@R0       ; A = contents of location pointed by R0

Mnemonic: “I-R-D-I-I-R-B” (Immediate Register Direct Indirect Indexed Relative Bit)

Question 4(a) OR [3 marks]
#

Write and Explain any Three Logical Instructions 8051 Microcontroller.

Answer:

Logical instructions perform bitwise operations:

InstructionFunction
ANL A,R0AND Accumulator with R0
ORL A,#0FHOR Accumulator with immediate data 0FH
XRL A,30HXOR Accumulator with contents of address 30H

Code Examples:

ANL A,R0        ; A = A AND R0
ORL A,#0FH      ; A = A OR 0FH
XRL A,30H       ; A = A XOR [30H]

Applications:

  • ANL: Masking specific bits (clear unwanted bits)
  • ORL: Setting specific bits
  • XRL: Toggling bits, checksum calculations

Mnemonic: “AND OR XOR” logical operations

Question 4(b) OR [4 marks]
#

Write 8051 Assembly Language Program to Subtract Number Stored in 2000h from 2001h and Store result in 2002h. All given memory locations are External Memory locations.

Answer:

ORG 0000H           ; Origin at 0000H

START:
    MOV DPTR,#2001H ; Point to minuend address
    MOVX A,@DPTR    ; Load minuend from external memory
    MOV R0,A        ; Store minuend in R0
    
    MOV DPTR,#2000H ; Point to subtrahend address  
    MOVX A,@DPTR    ; Load subtrahend from external memory
    MOV R1,A        ; Store subtrahend in R1
    
    MOV A,R0        ; Load minuend into A
    CLR C           ; Clear carry flag
    SUBB A,R1       ; Subtract: A = R0 - R1
    
    MOV DPTR,#2002H ; Point to result address
    MOVX @DPTR,A    ; Store result in external memory
    
    SJMP $          ; Stop program

END                 ; End of program

Program Steps:

  1. Load minuend from external memory 2001H
  2. Load subtrahend from external memory 2000H
  3. Perform subtraction using SUBB instruction
  4. Store result in external memory location 2002H

Note: MOVX instruction is used for external memory access.

Question 4(c) OR [7 marks]
#

Explain Instructions: (i) RET (ii) PUSH (iii) CLR PSW.0 (iv) RLC A (v) CJNE A,#DATA,LABEL (vi) NOP (vii) ANL A,#DATA

Answer:

InstructionFunctionDescription
RETReturn from subroutinePops PC from stack and returns control
PUSH 30HPush to stackPushes contents of address 30H to stack
CLR PSW.0Clear carry flagClears bit 0 of PSW (Carry flag)
RLC ARotate left through carryRotates A left through carry flag
CJNE A,#50H,NEXTCompare and jumpJump to NEXT if A ≠ 50H
NOPNo operationDoes nothing, consumes one cycle
ANL A,#0FHAND with immediateA = A AND 0FH

Detailed Explanations:

RET: Used to return from subroutine calls

CALL SUB1       ; Call subroutine
...
SUB1: 
    MOV A,#10H
    RET         ; Return to caller

PUSH: Saves data on stack

PUSH ACC        ; Save accumulator on stack

RLC A: Bit rotation with carry

CYA7A6A5A4A3A2A1A0CY

CJNE: Conditional branching

CJNE A,#50H,NOT_EQUAL   ; If A≠50H, jump to NOT_EQUAL
; A equals 50H
NOT_EQUAL:
; A not equal to 50H

Mnemonic: “Return Push Clear Rotate Compare No-op AND” (RPCRNA)

Question 5(a) [3 marks]
#

List the application of Microcontroller in various fields.

Answer:

Microcontrollers are used in numerous applications across various fields:

FieldApplications
Consumer ElectronicsTV remotes, washing machines, microwaves
AutomotiveEngine control, ABS, airbag systems
IndustrialProcess control, robotics, automation
MedicalPacemakers, blood glucose meters, ventilators
CommunicationMobile phones, modems, routers
Home AutomationSmart thermostats, security systems, lighting

Key Advantages:

  • Low cost and compact size
  • Low power consumption
  • Real-time operation
  • Easy interfacing with sensors and actuators

Mnemonic: “Consumer Automotive Industrial Medical Communication Home” (CAIMCH)

Question 5(b) [4 marks]
#

Interface Stepper Motor with 8051 Microcontroller and Explain in brief.

Answer:

Stepper motor interfacing requires driver circuit due to current requirements:

Interface Circuit:

PPPP1111....01238051GNDIIIInnnnppppUuuuuLttttN12342003CCCCooooiiiillllSABCDtepperMotor

Control Sequence (Half-Step):

StepP1.3P1.2P1.1P1.0Binary
1000101H
2001103H
3001002H
4011006H
5010004H
611000CH
7100008H
8100109H

Driver Circuit:

  • ULN2003: Darlington driver IC provides current amplification
  • Protection diodes: Protect against back EMF
  • Common ground: Between 8051 and motor supply

Mnemonic: “Step Sequence Driver Protection” (SSDP)

Question 5(c) [7 marks]
#

Draw interfacing circuit to interface 4 LED at port 2.0 to 2.3 of microcontroller 8051 and write assembly language program to flash it.

Answer:

Interface Circuit:

8PPPP022225....10123PinR3333e3333s0000iΩΩΩΩstorLLLLLEEEEEDDDDD1234GGGGNNNNDDDD

Assembly Program:

ORG 0000H               ; Start address

MAIN:
    MOV P2,#0FH         ; Turn ON all LEDs (P2.0-P2.3)
    CALL DELAY          ; Call delay subroutine
    MOV P2,#00H         ; Turn OFF all LEDs
    CALL DELAY          ; Call delay subroutine
    SJMP MAIN           ; Repeat flashing

DELAY:
    MOV R0,#255         ; Outer loop counter
LOOP1:
    MOV R1,#255         ; Inner loop counter  
LOOP2:
    DJNZ R1,LOOP2       ; Decrement and jump if not zero
    DJNZ R0,LOOP1       ; Decrement outer counter
    RET                 ; Return from delay

END                     ; End of program

Circuit Components:

  • Current limiting resistors: 330Ω to limit LED current
  • LEDs: Connected in active HIGH configuration
  • Common ground: All LED cathodes connected to ground

Program Operation:

  1. Turn ON LEDs: Set P2.0-P2.3 high
  2. Delay: Wait for visible flash duration
  3. Turn OFF LEDs: Clear P2.0-P2.3
  4. Repeat: Continuous flashing loop

Mnemonic: “Resistor LED Ground Program” (RLGP)

Question 5(a) OR [3 marks]
#

Draw Interfacing of Push button switch and LED with 8051 Microcontroller.

Answer:

Interface Circuit:

P1.1S+wG5iNVtDc3h301Ω0KΩGND(LOEuDtPp1u.t0)(IGnNpDut)

Circuit Description:

  • Push Button: Connected to P1.0 with pull-up resistor
  • Pull-up Resistor: 10KΩ ensures logic HIGH when switch open
  • LED: Connected to P1.1 through current limiting resistor
  • Current Limiting: 330Ω resistor protects LED

Operation:

  • Switch Open: P1.0 = 1 (HIGH)
  • Switch Pressed: P1.0 = 0 (LOW)
  • LED Control: Through P1.1 pin

Mnemonic: “Pull-up Switch LED Current-limit” (PSLC)

Question 5(b) OR [4 marks]
#

Interface Relay with 8051 Microcontroller and Explain in brief.

Answer:

Interface Circuit:

8P015.10GNTDra1nKsΩF(il1syNtBEb4oama0rsic0etk7t)eDB(riRCNoe5Pdl4Nea7)yCGlNLlDoeacdtRoerlayCoilLoNaOd+/1ND2CeVvice

Components:

  • Transistor BC547: Switching element for relay coil
  • Base Resistor: 1KΩ limits base current
  • Flyback Diode: 1N4007 protects against back EMF
  • Relay: 12V DC relay with NO/NC contacts

Operation:

  1. Logic HIGH on P1.0 → Transistor ON → Relay energized
  2. Logic LOW on P1.0 → Transistor OFF → Relay de-energized
  3. Relay contacts switch the load circuit

Protection:

  • Flyback diode prevents damage from relay coil’s back EMF
  • Current limiting through base resistor

Mnemonic: “Transistor Resistor Diode Relay” (TRDR)

Question 5(c) OR [7 marks]
#

Interface 7 segment LED with 8051 Microcontroller and write assembly language program to print 0 on it.

Answer:

Interface Circuit:

fe8PPPPPPPPC011111111o5........m101234567moCnoagdnCnaetc33333333ht33333333oi00000000doΩΩΩΩΩΩΩΩebcn:s:Allabcdefgdcpasssssssteeeeeee(hgggggggdommmmmmmedeeeeeeecennnnnnnistttttttmatlopGoNiDnt)

7-Segment Code Table:

DigitDisplaygfedcbaHex Code
0Display 001111113FH
1Display 1000011006H
2Display 210110115BH

Assembly Program to Display ‘0’:

ORG 0000H               ; Start address

MAIN:
    MOV P1,#3FH         ; Display '0' on 7-segment
                        ; a,b,c,d,e,f ON, g OFF
    SJMP MAIN           ; Keep displaying

END                     ; End of program

Segment Pattern for ‘0’:

  • Segments ON: a, b, c, d, e, f (bits 0-5 = 1)
  • Segment OFF: g (bit 6 = 0)
  • Binary: 00111111 = 3FH

Circuit Features:

  • Common Cathode: All segment cathodes connected to ground
  • Current Limiting: 330Ω resistors for each segment
  • Active HIGH: Logic 1 turns ON segment

Alternative Patterns:

; Other digits can be displayed using:
MOV P1,#06H         ; Display '1'
MOV P1,#5BH         ; Display '2'

Mnemonic: “Seven Segments Common Cathode Current-limit” (SSCCC)

Related

Microprocessor & Microcontroller Systems (1333202) - Summer 2024 Solution
23 mins
Study-Material Solutions Microprocessor Microcontroller 8085 8051 1333202 2024 Summer
Microprocessor & Microcontroller Systems (1333202) - Winter 2023 Solution
21 mins
Study-Material Solutions Microprocessor Microcontroller 1333202 2023 Winter
Microprocessor and Microcontroller (4341101) - Winter 2024 Solution
23 mins
Study-Material Solutions Microprocessor 4341101 2024 Winter
Electronic Measurements & Instruments (4331102) - Winter 2024 Solution
Study-Material Solutions Electronic-Measurements 4331102 2024 Winter
Linux Operating System (4331602) - Winter 2024 Solution
Study-Material Solutions Linux 4331602 2024 Winter
Data Structure with Python (4331601) - Winter 2024 Solution
Study-Material Solutions Data-Structure Python 4331601 2024 Winter