PIC Homework
-
Upload
nizar-toujeni -
Category
Documents
-
view
12 -
download
3
description
Transcript of PIC Homework
![Page 1: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/1.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#1:
Addition of two numbers entered to portB and display the result
on portA.
Solution:
![Page 2: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/2.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#2:
Subtraction of two numbers entered to portB and display the
result on portA.
Solution:
![Page 3: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/3.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#3:
Check if the input number from PORTA is larger than 10 or not.
If the number is larger than 10 then a LED on RB0 will be on.
Solution:
Solution#1 solution#2
![Page 4: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/4.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#4:
Half Adder program.
Solution:
![Page 5: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/5.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#5:
Full Adder program.
Solution:
![Page 6: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/6.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#6:
Implement 4 bit XOR.
Solution:
![Page 7: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/7.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#7:
Move the content of RA0 TO RA3.
Solution:
![Page 8: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/8.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#8:
Move the content of RA0 TO RB3.
Solution:
![Page 9: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/9.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#9:
Multiplier to multiply two 3 digits numbers.
Solution:
![Page 10: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/10.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Example#10:
Implement square of PORTA.
Solution:
![Page 11: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/11.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Homework
1) Implement 8-bit decoder with two enable pins.
2) Implement 4-bit multiplixer with 2 enable pins.
3) Implement 4-bit buffer with two enable pins.
4) Implement 4-bit gray code.
5) Implement a single bit comparator.
6) Implement 4-bit divider.
7) Implement 4-bit XOR/XNOR device with select pin.
8) Implement 4-bit "AND-OR-NAND-NOR" device with
select pins.
9) Copy the input data from PORTB to all GPR.
10) Implement 4-bit L/R shift register.
Notes:
Delivery Date is 6/10/2010.
Any late homework will not be accepted.
All copy-paste homework will not be accepted and both will
take ZERO.
Each question implement the PROTUS simulation and you will
implement the code in MPLAB.
So I will receive CD that has all PROTUS and MAPLAB program
for each part.
![Page 12: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/12.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Hint list
Hint for question#1:
I7 I6 I5 I4 I3 I2 I1 I0 S1 S2 S3
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 1 1 0
0 0 0 1 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 0 1 1
1 0 0 0 0 0 0 0 1 1 1
Hint for question#2:
F I3 I2 I1 I0 S0 S1
1 0 0 0 1 0 0
1 0 0 1 0 1 0
1 0 1 0 0 0 1
1 1 0 0 0 1 1
![Page 13: PIC Homework](https://reader033.fdocuments.us/reader033/viewer/2022042822/5695d45b1a28ab9b02a12bd3/html5/thumbnails/13.jpg)
PIC Discussion | by Eng. Tamar Jomaa
Hint for question#3:
Hint for question#4:
Hint for question#5:
I2 I1 I1>I2 I1=I2 I1<I2
0 0 0 1 0
0 1 1 0 0
1 0 0 0 1
1 1 0 1 0