Subject Details
Dept     : ECE
Sem      : 4
Regul    : 2023
Faculty : Dr.Husna khouser
phone  : 6380232559
E-mail  : husna.g.cfc@snsgroups.com
227
Page views
21
Files
5
Videos
1
R.Links

Icon
Assignments

Due Date Is Over
Due Date: 03-03-2025
Programming Arithmetic and Logical Operations
Question 1: Arithmetic Operations Write an assembly or C program for a PIC microcontroller to: a. Add two 8-bit numbers in REG1 and REG2, store the result in RESULT. b. Subtract REG2 from REG1, store the result in RESULT. c. Multiply REG1 and REG2, store the lower 8 bits in RESULT. Handle carry and overflow flags. Explain the execution flow, ALU operations, and flag effects. Simulate the program (e.g., MPLAB X IDE or Proteus) and provide initial and final values screenshots. Question 2: Write the program using Logical Operations a. Bitwise AND, OR, and XOR between REG1 and REG2, store results in RESULT. b. Bitwise NOT on REG1, store the result in RESULT. Explain how the ALU processes each operation and affects flags (e.g., Zero flag). Simulate and include screenshots, verifying results and addressing discrepancies.