How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLProg Your Own Question
ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9151
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
44910485
Type Your Homework Question Here...
ATLProg is online now
A new question is answered every 9 seconds

RegistersA small computer has two registers, R1 and R2,

This answer was rated:

Registers

A small computer has two registers, R1 and R2, and the following instructions: LOAD, SUBTRACT, MULTIPLY, BNZ, PRINT and STOP. The format of the instructions is the following:


Operation Code First Operand Second Operand



The LOAD instruction loads data from memory to a register. The LOAD, SUBTRACT, and MULTIPLY instructions expect a register in the first operand. They expect a data location or a direct value in the second operand. The data location in the second operand can be a Register or a Memory Address. A direct value (denoted by =) is the actual data value (as opposed to the data location). The LOAD, SUBTRACT, and MULTIPLY use the second operand to operate on the data in the first operand. They leave the result in the first operand.


For example, if the value stored in register R1 is 10 and the instruction MULTIPLY R1, = 4 were executed, the new value stored in register R1 will be 40.

As another example, assume the value stored in register R1 is 10 and the value stored in data location 500 is 35. If instruction MULTIPLY R1, 500 were executed, the new value stored in register R1 will be 350.

BNZ tests the first operand and branches to the address specified in the second operand.
PRINT has one operand. It prints the content of the first operand on the screen.
STOP does not have any operand. It halts the program.


Address

Instruction


0 LOAD R1, = 5


1 LOAD R2, = 1


2 MULTIPLY R2, R1


3 SUBTRACT R1, = 1


4 BNZ R1, 2


5 PRINT R2


6 STOP


What does the program compute and what is the printed result?



Strings

Suppose f is a function that returns the result of reversing the string of symbols given as its input, and g is a function that returns the concatenation of the two strings given as its input. If x is the string abcd, what is returned by g(f(x),x)? Explain your answer.
Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.
Customer: replied 4 years ago.


Hi sorry but I see no answer

Here it is

http://wikisend.com/download/419986/Q.docx

Please start question with "for ATLProg" to request me next time

I hope i was able to assist you. If you are happy with my service please rate my service . If your are not 100% satisfied, please reply to me so that i can help you better. Please start your question with "For ATLProg only" to request me again

Did you have any other question?
Customer: replied 4 years ago.


Hi I do have a request , can you do a little step by step on this question and answer please


 






































Address



Instruction



0



LOAD R1, = 5



1



LOAD R2, = 1



2



MULTIPLY R2, R1



3



SUBTRACT R1, = 1



4



BNZ R1, 2



5



PRINT R2



6



STOP



Program calculates the factorial of initial
value stored in R1. So in this case it calculates the factorial of 5 which is
120. At the end it stores 120 in R2 and prints that.



Please download detailed answer from

http://wikisend.com/download/135998/Q.docx
ATLProg and 4 other Homework Specialists are ready to help you
Customer: replied 4 years ago.

Prolog


Prolog is a programming language that belongs to the logic programming paradigm as explained in Section 6.7 of the Brookshear textbook.

Compute the output of the following program:

Parent(dad_tough_guy, babe_ruth).
Parent(dad_tough guy, little_kid).
Parent(john_oldman, dad_tough_guy).
Parent(mary_oldwoman, dad_tough_guy).
Grandparent(X, Y) :- parent(X, Z), parent(Z, Y).

What is the following following Prolog query trying to ask? What are the values of X?
?- Grandparent(X, babe_ruth).
I would need more details for this question Please provide what is on section 6.7

Can you please go to www.wikisend.com and upload your file ? Once you do that you will get a page that has the "File ID" and "Download Link". Copy the "Download Link" or "File ID" and please paste it in your reply here.

Customer: replied 4 years ago.

http://wikisend.com/download/543796/Prolog.docx


is the link

Can you please create a separate question for this Chris as its a new question
Please visti http://www.justanswer.com/computer/expert-atlprog/ to post a new question Please start your question with "For ATLProg only" to request me again
Customer: replied 4 years ago.

okay will do of course

I have the solution ready let me know when you create the question
Customer: replied 4 years ago.

Describe a data structure suitable for representing a board configuration during a chess game.


A chess board has 8 x 8 squares alternating between black and white. These are the standard pieces in a game of chess:


2 Kings (Black & White)
2 Queens (Black & White)
4 Rooks (2 Blacks & 2 Whites)
4 Bishops (2 Blacks & 2 Whites)
4 Knights (2 Blacks & 2 Whites)
16 Pawns (8 Blacks & 8 Whites)

Can you please create a new question requesting me
Customer: replied 4 years ago.
I did try to generate a new question staring with foratlprog only but the system still offers me someone else to answer
Is there a more direct route?
Please use this

http://www.justanswer.com/homework/expert-atlprog/
Customer: replied 4 years ago.

I have tried that link but no matter what I do I am directed to another person but not you

give me 2 mins i will give answer here and you can rate it here
Customer: replied 4 years ago.

perfect but how do I contact you in the future?

Please download solution from

http://wikisend.com/download/124238/Solution.docx

I hope i was able to assist you. If you are happy with my service please rate my service . If your are not 100% satisfied, please reply to me so that i can help you better. Please start your question with "For ATLProg only" to request me again

For future just create question in Homework Category and start question wtih "For ATLProg" even thought it suggest other expert dont worry about it. If you get someone else after posting your question you may mention you want to work with ATLProg
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
ATLProg and 4 other Homework Specialists are ready to help you