Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hena

macrumors newbie
Original poster
Jun 26, 2008
1
0
hello can you helo i am hena please if you can help me to solve this project
project :
1. Consider the C-like code below. What values do the last three lines print out? If it’s printing an address, tell me what variable’s address it is printing. Assume that the “print” statement “does what you’d expect” - it prints out the value of the address or variable after it.


int p[20];
for (i=0; i<20; i++)
{p = i;}
int *mypointer = &p[0];
print *mypointer;
print p;
print p[3];


2. Processor P1 has a 1GHz clock, and processor P2 has a 2GHz clock. They have completely different instruction sets, but they both execute exactly 1 instruction per cycle. Which processor has better performance and why? You must explain your answer to get credit.




3. Write a MIPS assembly program that reads a string of integers and computes whether it (the number represented by the entire string) is prime or not. Assume the string of integers has no more than 5 digits.


4. Write a MIPS assembly program that sorts, in ascending order, all of the characters that are provided as inputs (sorting is done by ASCII code). Assume you won’t get more than 100 characters. Some inputs may repeat. The pseudo-code for your program is below.
 

Attachments

  • Arch Project.doc
    33.5 KB · Views: 73
1) Firsts prints prints 0, second the address of p, third prints 3.

2) With different instruction sets it's impossible to compare.
 
Do your own homework/course work. Seriously: if we answer this what will you have learnt? Nothing that's what. I'm reporting this in the hope that the thread gets closed.
 
This doesn't break any forum rules and it's probably best to just ignore it.

Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:
 
Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

Its worse than that, they go into management and end up being decision makers on how to implement projects. :D
 
Computer Architecture was one of the best courses I took in my undergrad CS program. I would never imagine trying to get around the work. If you don't like CS, there's always MIS or other such degrees that aren't as technically rigorous. If you really have no idea, and you have read the book (Sounds like Patterson and Hennessy) thoroughly, you should speak with the professor or a TA to get help with this. Asking us to do your homework is no better than just copying it from someone else.

Download spim here:
http://pages.cs.wisc.edu/~larus/spim.html

And build it for your OS X machine (I assume you have a mac since you're posting here). Then get to work writing the MIPS ASM.

As for the first two questions, I don't believe you even made an attempt.

-Lee
 
Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

Just give bad advice :p

To the op, your program prints "Do your own homework!" in an infinite loop :p
 
Do your own homework/course work. Seriously: if we answer this what will you have learnt? Nothing that's what. I'm reporting this in the hope that the thread gets closed.

While I agree with you completely and respect your presence in this forum, you seemed to have no real issues doing someone else's job for them. I commend you on insisting that the OP learn Cocoa 101, but you still provided a lot of code fixes...I don't really see the difference and try to avoid both situations.
 
you seemed to have no real issues doing someone else's job for them

Whilst I see your point entirely, I think that is a very different set of circumstances. In that case the individual has clearly made some effort, was asking for help with a specific part of their existing code, not for the whole thing to be done for them and has gone on to prove that I was right: they have solved further problems on their own and have put the effort in. In that case it appears that something has been dumped on them unasked and they are trying their hardest. In this case it appears that someone has signed up for this and is not trying at all.
 
Whilst I see your point entirely, I think that is a very different set of circumstances. In that case the individual has clearly made some effort, was asking for help with a specific part of their existing code, not for the whole thing to be done for them and has gone on to prove that I was right: they have solved further problems on their own and have put the effort in. In that case it appears that something has been dumped on them unasked and they are trying their hardest. In this case it appears that someone has signed up for this and is not trying at all.

I guess I looked at as students don't get paid $$$ as a result from our help, programmers do.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.