HomeArticlesProjectsBlogContact
Articles
PIC LAB-1 Test 3 Page 16
Colin Mitchell
Colin Mitchell
Make sure to subscribe to our newsletter and be the first to know the news.
   PIC LAB-1 Test 3   <!-- Begin var ans = new Array; var done = new Array; var score = 0; ans\[1\] = "a"; ans\[2\] = "MOVLW 4Ch"; ans\[3\] = "MOVWF 1Bh"; ans\[4\] = "MOVF 1Bh,0"; ans\[5\] = "CLRF 1Bh"; ans\[6\] = "no instruction exists"; ans\[7\] = "DECF 1B,1 - - DECF 1B,0 puts the decremented value in W"; ans\[8\] = "0101 0000"; ans\[9\] = "0000 0010 and 0000 0100"; ans\[10\] = "RB0, RB1, RB3, RB4, RB5"; ans\[11\] = "BSF 06,2"; ans\[12\] = "0100 1100"; ans\[13\] = "MOVLW 08 MOVWF 06"; ans\[14\] = "FF"; ans\[15\] = "BSF 06,3"; ans\[16\] = "unknown"; ans\[17\] = "MOVLW 8Eh and MOVWF 1Ch"; ans\[18\] = "0000 1000"; ans\[19\] = "BSF 06,5"; ans\[20\] = "1010 0000"; ans\[21\] = "03,2"; ans\[22\] = "20h"; ans\[23\] = "00"; ans\[24\] = "0000 0000"; ans\[25\] = "a"; function Try(question, answer) { if (answer != ans\[question\]) { if (!done\[question\]) { done\[question\] = -1; window1=window.open("", "NewWindow1", "toolbar=no,directories=no,menubar=no,scrollbars=no,top=475,left=25,width=320,height=20"); window1.document.writeln("<title>Answers to: 25 QUESTIONS . . . . </title>"); window1.document.writeln("<font face=Arial size=2 color=#FF00cc><center>Wrong!\\n\\nYour score is now: " + score + "<font face=Arial size=2 color=#cc0000><center>The correct answer is: <font face=Arial size=2 color=#000000>" + ans\[question\]); } else { alert("You have already answered that question"); } } else { if (!done\[question\]) { done\[question\] = -1; score++; alert("Correct!\\n\\nYour score is now: " + score); } else { alert("You have already answered that question"); } } } function Assessment () { if (score >= 25) { alert("Perfect Score!"); } if (score >= 20 && score <= 29) { alert("Excellent Work - but not Perfect!") } if (score >= 0 && score <= 19) { alert("You need to do the BASIC ELECTRONICS COURSE. \\nYou will be amazed at how much you will learn.") } } // End -->

Answer the following questions … JavaScript is required!
This test finds out how much you know about basic programming.

1. What does the word “literal” mean?

  • A number
  • A value such as 0C3h
  • A hexadecimal value
  • A number loaded into W

2. Write the instruction to put 4Ch into W:

  • MOVWF 4Ch
  • MOVLW 4Ch
  • MOLVW 4Ch
  • MOVWL 4Ch

3. Write the instruction to move 4Ch from W to file 1B:

  • MOVLW 1Bh
  • MOLVW 4Ch,1
  • MOVLW 4Ch
  • MOVWF 1Bh

4. Write the instruction to move 4Ch from file 1B to W:

  • MOVF 1Bh,0
  • MOVWF 4Ch,1
  • MOVWF 1Bh,1
  • MOVF 1B,1

5. Write the instruction to clear the value 4Ch in file 1B:

  • CLRF 4Ch
  • CLRF 1Bh,0
  • CLRF 4Ch,0
  • CLRF 1Bh

6. Write the instruction to move 4Ch from file 1A to file 1B:

  • MOVF 1B,1
  • MOVF 1C,0
  • MOVWF 1B,1
  • no instruction exists

7. Write the instruction to decrement file 1B:

  • DECFSZ 1B,0
  • DECF 1B,0
  • DECFSZ 1B,1
  • DECF 1B,1

8. After the instruction: BCF 06,3 the file will contain:

  • 0101 0000
  • 1111 1010
  • 1111 1000
  • 1010 1010

9. What is the difference between:
MOVLW 02
MOVWF 1B
and:
BSF 1B,2

  • 0000 0010 and 0000 0010
  • 0000 0011 and 0000 0010
  • 0000 0010 and 0000 0100

10. The TRIS file is loaded with 0011 1011. Name the output line(s) created by this value.

  • RB0, RB1, RB3, RB4, RB5
  • RB1, RB2, RB4, RB5, RB6.
  • None of the above

11. A LED is connected to the 3rd lowest output. Write the instruction to activate the LED:

  • BSF 06,3
  • BSF 06,2
  • BSF 06,4

12. File 1B holds the value 0000 1100. After the following instruction: BSF 1B,6 the file will contain:

  • 0010 0011
  • 0010 1100
  • 0100 1100
  • 0010 0000

13. Write the instructions to make bit 3 of TRIS 06 an INPUT:

  • MOVLW 03 and MOVWF 06
  • MOVLW 04 and MOVWF 06
  • MOVLW 08 and MOVWF 06

14. For any file, what is the maximum hex value it can contain?

  • 128
  • FF
  • 256h
  • 255h

15. Write the instructions to make bit 3 of the input/output file HIGH:

  • MOVLW 03 MOVWF 06
  • BSF 06,3
  • MOVLW 11 MOVWF 06

16. What value will be contained in file 1B after the instruction: BSF 1B,4:

  • 0000 1000
  • 0000 1111
  • 0000 0100
  • unknown

17. Write the two instructions to carry out the following: Put 8E into file 1C

  • MOVWF 8Eh and MOVWF 1Ch
  • MOVLW 8Eh and MOVWF 1Ch
  • MOVLW 8Eh and MOVLW 1Ch
  • MOVWF 8Eh and MOVLW 1Ch

18. A file containing 0000 1001 is ANDed with 1100 1010. The result is:

  • 0000 1001
  • 1000 1000
  • 0000 1000
  • 1100 1000

19. Write the “bit set file” instruction for bit 5 of file 06:

  • BSF 05,6
  • BSF 06,5
  • BSF 05
  • BSF 06

20. A file containing 0110 1001 is XORed with 1100 1001. The result is:

  • 0110 1001
  • 1001 0110
  • 1010 0000
  • 0001 1111

21. The zero bit in the Status file is:

  • 03,0
  • 03,1
  • 03,2

22. Name the file after 1F:

  • 1G
  • 20
  • 20h
  • 2A

23. A file contains FF. After an increment operation, it will contain:

  • 00
  • FE
  • F0

24. The result of BCF 1B,3 is:

  • 0000 0000
  • 1111 1100
  • 1111 1111
  • none of the above

25. Write the value needed to make RA1, RA3 and RA4 inputs:

  • 1010 1111
  • 0001 1010
  • 0101 1101
  • 0000 1101

These are the types of questions you should be able to answer fairly quickly, if you want to design and build microcontroller projects. If you get less than 20, now’s the time to do the PIC Programming Course. Try the test again after the course, I’m sure you will “fly” through the answers and be amazed at how much you have learnt.
You should also build our first PIC project to teach programming: PIC LAB-1.


Colin Mitchell

Colin Mitchell

Expertise

electronics
writing
PIC-Chips

Social Media

instagramtwitterwebsite

Related Posts

TODO
Transistor Test
© 2021, All Rights Reserved.

Quick Links

Advertise with usAbout UsContact Us

Social Media