logo

Crowdly

Browser

Add to Chrome

A PIC16F8877 Programmer has written three different routine(s) to multiply an un...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

A PIC16F8877 Programmer has written three different routine(s) to multiply an unsigned 3-bit number stored in a register labelled RegA by 8, and return with the product in the working register. 

In the particular application 

  • there is no guarantee that the upper 5 bits of RegA are clear
  • the routine must complete within 10 instruction cycles regardless of the value in RegA

Which routine should be chosen?

Mul8I

movf RegA,W

btfsc STATUS,Z

return

addwf RegA,W

addwf RegA,W

addwf RegA,W

addwf RegA,W

addwf RegA,W

addwf RegA,W

addwf RegA,W

return

Mul8II

movf RegA,W

andlw 0x07

addwf PCL,F

retlw 0x00

retlw 0x08

retlw 0x10

retlw 0x18

retlw 0x20

retlw 0x28

retlw 0x30

retlw 0x38

Mul8III

bcf STATUS,C

rlf RegA,W

bcf STATUS,C

rlf RegA,W

bcf STATUS,C

rlf RegA,W

return

0%
0%
0%
More questions like this

Want instant access to all verified answers on myelearning.sta.uwi.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome