Click to See Complete Forum and Search --> : Computer programmers/Math guru's --help!
A friend of mine has this problem:
I am taking a computer architecture class in college. My graduation is pending that I pass this class. I have to develop a program consisting of primitive CPU instructions, such as NOT, AND, OR, XOR, ADD and shift.
My problem is that I don't understand what the procedure is asking to do. If I could just put the logic in plain words then Maybe I can develop the couple of lines of instructions to implement the procedure.....
integer i, a;
i = 0;
While (i<10) do
a = i*2;
i = i +1;
endwhile
-Thanks
knute
04-29-2003, 12:24 PM
All that it's doing is counting by ones with i and counting by twos with a (as a is twice i's value).
It will do this 10 times, starting with 0 and ending with 9 as the while loop terminates when i reaches 10.
HTH
bs_texas
04-29-2003, 12:52 PM
Originally posted by shon
A friend of mine has this problem:
I am taking a computer architecture class in college. My graduation is pending that I pass this class. I have to develop a program consisting of primitive CPU instructions, such as NOT, AND, OR, XOR, ADD and shift.
My problem is that I don't understand what the procedure is asking to do. If I could just put the logic in plain words then Maybe I can develop the couple of lines of instructions to implement the procedure.....
integer i, a;
i = 0;
While (i<10) do
a = i*2;
i = i +1;
endwhile
-Thanks
Well, I hate to say it, but if your 'friend' can't come up with a simple logic program using AND, OR, etc, then he has no business passing a computer architecture class. I don't think anybody here wants to do his thinking for him or write his program for him.
Are you, I mean, is he, a freshman just starting out?
Is he close to graduation? If so, please tell us he's not a Computer Science major.
Incidentally, your little code snippet has nothing to do with the problem before you, uh, him.
Sorry.
irlandes
04-29-2003, 01:22 PM
This posting above sounds harsh, but it's not. Speaking as a parent and a grandparent, Lord deliver us from "experts" who lied and cheated their way through professional training then enter the work places as qualified experts who aren't expert at anything, while truly qualified people can't find work.
Worse yet, often these losers b.s. their way into management postions where they do real damage.
As a person, a human, I feel for anyone who is trying to get somewhere in life and runs into obstacles, but at times, reality is of first importance. If you can't do a simple programming exercise, change fields. There is a big need for capable hamburger floppers and long distance truck drivers.
bs_texas
04-29-2003, 01:33 PM
Originally posted by irlandes
Worse yet, often these losers b.s. their way into management postions where they do real damage.
Hey, careful with them initials!! :p ;)
Reality is harsh. It seems that computer achitecture at one time involved the use of Karnaugh maps and such, if that's still the case, then it is imperative to know logic of the AND, OR, XOR, ilk. (ilk - n. - of the same kind, sort, class...)
But, there also could be some extenuating circumstance that we aren't aware of.
(Pardon my colloquialism and dangling preposition, for those of you who know what those mean. :D )
(Dang, I need to get out more!)
LrngTheHardWay
04-29-2003, 03:26 PM
Originally posted by bs_2003
But, there also could be some extenuating circumstance that we aren't aware of.
AH! The good-ol' days of k-mapping! :D
If, by "extenuating circumstance," you mean 'the last kegger party,' yeah...ok.
However, if you mean 'a valid reason;' it's possible, but not probable. (We've already had a few such postings...have you noticed?)
It's the second month of Spring!
Once again, it's time for the lazier students to panic, like they do every year; at which time the incidence of postings like this increase by several orders of magnitude. (You should see the usenet traffic!)
Why is it always a friend, BTW? Nobody ever cops to the truth: "I'm a lazy slug. I don't deserve to graduate, and I'm looking for a free ride...I want you to do my homework for me."
We're looking at the most elementary form of a while loop, with variable decs and initializations--pretty much a text-book example--during the fourth quarter of the academic year. Anyone who's been paying attention in a computer architecture class can reduce the problem example to a sequence of opcodes that will accomplish the task...in something like 10 or 15 minutes.
Frankly, if even a high school kid can't figure out the loop implementation and make the translation, that person has no business in a hardware class, and deserves the 'F' they'll--hopefully--earn.
irlandes is right on target. Postings like this just piss me off. :rolleyes:
irlandes
04-29-2003, 05:05 PM
Even worse than what I said, is someone who has affirmative action rights, and gets jobs they can't handle, and it costs millions of bucks to fire them. I mean like Dearies or real minorities.
And, I am NOT saying there are no great programmers in those categories. I am talking about the ones who are lying and cheating their way through.
I remember a programmer on the B-2 program. Her name was Brenda. She not only was one of the best programmers we had. She looked KOWABUNGA in a short skirt. When she worked at my station, there was no way to have her sit down without causing a riot in the area.
First time, I gave her the highest stool, and sat in the lowest one. I realized instantly that was a mistake.
Next time, I gave her the lowest stool and I took the highest one. That was even worse.
She was such a sweet woman, and such a great programmer -- she was the only one who could even give us link maps for the assembly listings -- there was no way I could tell her what the problem was. So, us guys simply had to sit there with sweat running off us and our mouths shut until she went away.
And, the obvious cool-down was for us to go home and molest THE HECK out of our wives. And, of course, women not being stupid, when we ran in the door and did what we did, they always know instantly it was someone at work that sent us home in that state. :-)
LrngTheHardWay
04-29-2003, 07:01 PM
Originally posted by irlandes
Even worse than what I said, is someone who has affirmative action rights, and gets jobs they can't handle, and it costs millions of bucks to fire them.
Gee, and the CAO in LA County wonders where the HR budget is going. ;)
To the rest of your comment, I'm gonna just sit here and grin. (There's always one in everyones' career.)
bwkaz
04-29-2003, 07:15 PM
Umm... yeah... this thread is getting way off topic.
That, plus the fact that the original topic was the poster asking for help doing someone's homework, plus the page-widening effect (;)), adds up to a closed thread.