-1
\$\begingroup\$

In PIC16F84A, numbers are represented as 8-bit binary sequences. Assume that you would to develop a language that represents both positive and negative numbers. So, your language should contain the following statements:

  • int i to declare an integer in memory location i.
  • i = k to store constant value k (positive or negative) in location i.
  • i + j to perform addition.
  • i - j to perfom subtraction.

    1. For each statement, show how you will implement in assembly code.
    2. What is the maximum and minimum values for k?

Any one check that please! i mini=-10. ,i max =+10. enter image description here

New contributor
Mohammed Azab is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
  • 2
    \$\begingroup\$ Looks like you just put your homework here. Is there a question? \$\endgroup\$ – Justme Mar 26 at 5:42
  • 4
    \$\begingroup\$ I'm voting to close this question as off-topic because homework questions without demonstrated effort or explaining what has been attempted are not accepted. \$\endgroup\$ – JYelton Mar 26 at 6:21
  • 1
    \$\begingroup\$ This question lacks at least in two points: it is not about electrical engineering, and it does not show any effort. Vote to close. \$\endgroup\$ – the busybee Mar 26 at 7:40
1
\$\begingroup\$

You would represent your numbers using 2's complement, which is what is built in to the microcontroller. For an 8 bit 2's complement value, the range is -128 to 127.

The PIC 16F instruction set documentation provides all the information you need to write the assembler code (this smells like a homework problem with no work attempted so you get a partial answer).

http://ww1.microchip.com/downloads/en/devicedoc/31029a.pdf

\$\endgroup\$
  • \$\begingroup\$ No doubt this is course work. The instructor is trying to be tricky by using the PIC16F84A controller as the architecture model. But then the instructor could have picked something really odd like the FACOM 128B. \$\endgroup\$ – Dan1138 Mar 26 at 6:33
  • \$\begingroup\$ @Dan1138 i think like that \$\endgroup\$ – Mohammed Azab Mar 26 at 16:14

Your Answer

Mohammed Azab is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.