b. What if the operands are -1 and +1?
I hope that his supervisor is reading this ....
Regards,
Nick Maclaren.
oh..could you just help me out here..these are just
assignments...thats it...
...and to benefit from those you should figure out the answers yourself.
sure..iam trying..but in case if you folks could help, i would
appreciate it...
What was wrong with Nick's help:
> 1) Find someone else on the course who actually attended.
> 2) Ask them for a copy of the reading list.
> 3) Beg, buy, borrow or steal some of the books on that list.
> 4) Read the indices to find out one that has Booth's algorithm.
> 5) Read the book.
> 6) Answer the question.
--
The best form of nuclear energy
is indeed gravity contained fusion
with the reactor >150e09m away.
I cannot see any help from Nick....
That depends. Most computers do not have all those flags (Exercise: Find
one computer that actually has all of them.) so several of the flags will
not have any value at all.
And even for those computers that do have those flags it is not certain
that an addition will modify any of them.
>
> b. What if the operands are -1 and +1?
The same.
--
<Insert your favourite quote here.>
Erik Trulsson
ertr...@student.uu.se
>> ...and to benefit from those you should figure out the answers yourself.
>
> sure..iam trying..
Apparently not very hard (hint: the questions are trivial).
> but in case if you folks could help
You might get help if you ask less trivial questions, *and*
explain what your specific difficulty is, e.g. by following
advice from http://catb.org/~esr/faqs/smart-questions.html
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Why on earth would we want to do your homework for you? You've been
assigned these problems to help you learn the material, now go away
and do them.
Oh, for heavens sake. The answers are obviously 12, 3, 4, 1, 9, and
blue.
> b. What if the operands are -1 and +1?
Trick question, they'll cancel each other out and there won't be any
flag values.
Nothing, unless something actually depends on them.
- bill
(jumping on the bandwagon ...)
A few weeks ago, you tried to get help with several maths problems in
sci.math; and folks explained to you back then that it is NOT appropriate to
ask for help with assignments in Usenet newsgroups. You should have got the
message by now: do your homework yourself. Do not ask newsgroups.
These are actually pretty straightforward assignment questions. They are
suitable for an introductory course in computer architecture. They are not
hard, difficult or tricky questions. If you can't solve these questions on
your own, unaided, then you probably don't have an aptitude for computer
architecture; possibly not for any aspect of computing. If you are really
struggling, and not just looking for easy ways out, maybe you should enroll
some other course?
You're in luck, we _really_ love assignments here! :-)
In fact, we have a competition to see who can come up with the best answer.
If you take a look in the archives from exactly one, two or three years
ago, you'll notice that comp.arch aways get a short burst of requests
like yours around this time of the academic year.
Terje
--
- <Terje.M...@hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"
This link may be the answer to your problems:
http://www.walmartstores.com/GlobalWMStoresWeb/navigate.do?catg=218
Best,
Thomas
--
Thomas Lindgren "It was all very mechanical -- but
that's the way planetside life is." -- RAW
> You're in luck, we _really_ love assignments here! :-)
> In fact, we have a competition to see who can come up with the best answer.
But honestly the quality of the entries in this competition have been
rather sub-par lately. I believe that real competition-quality responses
are likely to be much more instructive to the original questioner
than all the "go do your own homework" posts.
G.
True. I once managed to reply with a perfectly correct answer to a
first-year statistics question, using a technique that isn't covered
in undergraduate courses. If the questioner had looked it up, he would
have learnt something; if he had just quoted it, his examiner would.
But I did give this idiot a perfectly good algorithm to solve his
problem :-)
Regards,
Nick Maclaren.
These questions are quite simple. They are also the basics of any EE/
CS/CE program.
If you cant find it in you to dig out the answers by yourself, you
need to find something else that tickles you pink.
Dont waste your life. Go ahead, switch majors to Art History or
Political Science or whatever that gets *you* riled up. Or if you like
those organic chemistry reactions, genetics is a pretty neat area.
Also, it is not 1999 anymore. Hiring managers want "real candidates".
If they can sniff a coaster out, they probably will.
Why settle for a mediocre life?
-SK
OUCH!
For one thing, these questions are very obviously homework assignment
questions.
For another, they're very simple introductory questions. So, if the
answers aren't obvious to you from your textbook, or from what the
instructor did in class, just about any introductory book on
computers...
well, perhaps you need to choose the right *kind* of introductory
book.
The "small computer handbook" from Digital explained this kind of
stuff quite well.
John Savard
These are such simple questions that we can't just give you a little
help.
Oh, maybe I *can* help a *little*.
Have you ever seen an old-style mechanical adding machine?
Suppose it only had a display of four digits.
If it had 9995 in the window, and you tried to add 6, what do you
think would happen?
Of course, your homework assignment is about binary, not decimal.
If you had 131 nails, and you could put ten nails in a small box, and
ten small boxes in a big box, and you packed the nails up as much as
you could, how many boxes would you have (not counting boxes inside
other boxes) and of what kinds, and how many left-over nails would you
have?
The world of binary is like the world of decimal, except the small
boxes hold two nails, and the big boxes hold two small boxes. And so
on to bigger boxes.
Once you have thought hard about this, you may have the conceptual
framework you need to understand your lessons.
John Savard
> Joseph wrote:
>
>> What if the operands are -1 and +1?
>
> Trick question, they'll cancel each other out and there won't be any
> flag values.
Like when a electron meets a positron?
More like when a hole meets an electron, or perhaps when hole meets
offspring.
Ok, everyone, fun's over, it's time to have pity on the poor kid
(besides, his homework is probably well past due by now)
For the first question, we have to think about how this hypothetical 8-
bit computer will actually do the math and what the meanins of the
different flags are:
An 8-bit machine has words made up of two 4-bit digits, so the two
operands are 02 and 03 (first digit is 0 and the second digit is 2 or
3). When we add these two together we get 05, but we can't put a 5 in
a 4-bit field, so we carry the 2 to the second field and we get 23 (in
twos complement notation, of course) as the result (you can easily
convert this back to decimal notation from twos complement).
Since we performed a carry we set the carry flag to 2
Since the resulting value is not zero we set the zero flag also to 1
(by standard convention)
No overflow occured, so overflow is 0
The sign of the result is positive so we set sign to 1 (by standard
convention)
Even parity is calculated by multiplying the upper and lower fields
(1*4) and setting the parity flag if the result is even, so even
parity is 1
The half carry flag is set when a value of 1/2 is carried from the
upper field, which didn't happen in this case, so we set the half-
carry flag to 0.
Now, as for the second problem: Here we need to understand how to
represent negative values in a twos complement 8-bit machine. Twos
complement indicates a negative value by subtracting the absolute
value from a maximum value in all fields (33). So, we now have two
operands -1 (32) and 1 (01). Again we add the two values together to
get 33 (wich translates to decimal 0). Here are the flag values:
carry: 0 (no carry occurred)
zero: 1 (the twos complement value is NOT zero)
overflow: 0 (no overflow occurred)
sign: 1 (the value of zero is positive by standard convention)
even parity: 0 (3*3 = 9, which is odd)
half carry: 0
I hope that helps.
> The half carry flag is set when a value of 1/2 is carried from the
> upper field, which didn't happen in this case, so we set the half-
> carry flag to 0.
I'd set the half-carry flag to 0.5
2 + 3 is 5.
Which is odd, all right...
but it's 00000101
so an even number of 1 bits are set. Even parity, therefore, is
present. (Parity as in parity checking, not as in number theory... let
alone particle physics.)
John Savard
> An 8-bit machine has words made up of two 4-bit digits,
Not the ones I remember like the Video Genie unless you were using BCD.
That used a Z80 with an 8 bit data bus.
Ken Young
The Z-80 has a half-carry flag, inherited from the 8080, along with the
"decimal adjust" instructions intended for handling BCD data.
My advice to the OP would have been: "Drop the course. If you're in over
your head this early, you haven't got a snowball's chance of passing." In
fact, if his Clue Level is that low, he probably needs to change majors to
something like Art History Education.
So, you need to learn to use search engines and fast lookups in
textbooks if you don't want your classes to interfere with your
fraternity activities.
Or, you could, study ..
-- mrr