Lab 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

NAMES: SIMON IQBAL (FA20-EPE-026)

WAQAR KHALID (FA19-EPE-140)


SUBJECT: MSI
SECTION: 5A
TEACHER: SIR MUHAMMAD NAVEED SHEIKH
EXPERIMENT: 05
Implementation of Bit Manipulation Branch Instructions
Lab Tasks:
Implement the PIC18F452 in PROTEUS to perform the various tasks. Use Switches to Provide
the input and output must be displayed on LED in each task

1. Use PORTB and PORTC as input ports, which receive 8-bit information. Information received
from PORTB and PORTC are added, and the results should be displayed on PORTD. Connect 8
LEDs with PORTD to visualize the result present on PORTD. Repeat this addition process for the
indefinite time interval
CODE SCREENSHOT:
PROTEUS SCREENSHOT:

2. Receive two 8-bit numbers from PORTB and PORTD and Check if the numbers are equal or
not. If numbers are equal, turn on the LED connected with RC0; otherwise, turn on the LED
connected with RC4. Repeat this checking mechanism for an indefinite time interval.
CODE SCREENSHOT:
PROTEUS SCREENSHOT:

3. Receive the number from PORTC and check it is zero or not. If it is zero, then keep checking
the PORTC content. If any result received from PORTC becomes non-zero, turn on the LED
connected with RB2 and stop the program and do not check the content coming from PORTC.
CODE SCREEENSHOT:
PROTEUS SCREENSHOT:

4. Connect Two LEDs with RB0 and RB1. Also Connect a switch with RB2. Turn on the LED
connected with RB0 if switch is on and Turn on the LED connected with RB1 if switch is off.
CODE SCREENSHOT:
PROTEUS SCREENSHOT:

You might also like