Question

Multiplication and Division using PIC16F PIC16 is a very basic microcontroller with the capability of limited...

  1. Multiplication and Division using PIC16F

PIC16 is a very basic microcontroller with the capability of limited arithmetic and logical operations. It has dedicated arithmetic instructions for addition, subtraction, increment and decrement. If we want to perform a multiplication and division operations then we need to write a program for it. Multiplication is nothing but repeated addition. However, division can be implemented using repeated subtraction. This mini-project presents assembly or C language program for the multiplication and division of two 8-bits numbers with the illustration of 3 different cases.

The Multiplication can be illustrated using the following cases:

Case 1:02H x 03H = 06H

Case 2: A7H x F2H = 9DDEH

The Division can be illustrated using the following cases:

Case 1: 1Bh÷02h= 0Dh Remainder = 01h

Case 2: FFh÷05h= 33h Remainder=00h

Case 3: 07÷A2h= 00h Remainder=07h

0 0
Add a comment Improve this question Transcribed image text
Answer #1


#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;


cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

This could be easy in c++ then c language once check it out

The same will be you can use for division also

Add a comment
Know the answer?
Add Answer to:
Multiplication and Division using PIC16F PIC16 is a very basic microcontroller with the capability of limited...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT