Discussion:
HW5: Shifter overkill question
(too old to reply)
Jeremy Cowles
2008-07-28 22:34:41 UTC
Permalink
Raw Message
I implemented the full 16 bit shamt shifter because I missed the line in the
spec that tells you to ignore bits > 4 in shamt. Is it ok to leave it like
this, or should I remove the additional logic so it ignores the bits greater
than the first 4?

Thanks,
Jeremy
[Instr] Albert Chae
2008-07-29 02:48:49 UTC
Permalink
Raw Message
It probably won't matter so much... What's the behavior if you shift
using more than 4 bits? Does everything 0 out?

Albert
Post by Jeremy Cowles
I implemented the full 16 bit shamt shifter because I missed the line in the
spec that tells you to ignore bits > 4 in shamt. Is it ok to leave it like
this, or should I remove the additional logic so it ignores the bits greater
than the first 4?
Thanks,
Jeremy
Jeremy Cowles
2008-07-30 04:08:38 UTC
Permalink
Raw Message
Yea, after shifting more than 15 bits, it all goes to zeros or 1's depending
on the operation.
Post by [Instr] Albert Chae
It probably won't matter so much... What's the behavior if you shift
using more than 4 bits? Does everything 0 out?
Albert
Post by Jeremy Cowles
I implemented the full 16 bit shamt shifter because I missed the line in
the spec that tells you to ignore bits > 4 in shamt. Is it ok to leave it
like this, or should I remove the additional logic so it ignores the bits
greater than the first 4?
Thanks,
Jeremy
[Instr] Albert Chae
2008-07-30 06:39:14 UTC
Permalink
Raw Message
We won't test inputs greater than 4 bits on the shifter, so this is fine.

Albert
Post by Jeremy Cowles
Yea, after shifting more than 15 bits, it all goes to zeros or 1's depending
on the operation.
Post by [Instr] Albert Chae
It probably won't matter so much... What's the behavior if you shift
using more than 4 bits? Does everything 0 out?
Albert
Post by Jeremy Cowles
I implemented the full 16 bit shamt shifter because I missed the line in
the spec that tells you to ignore bits > 4 in shamt. Is it ok to leave it
like this, or should I remove the additional logic so it ignores the bits
greater than the first 4?
Thanks,
Jeremy
[Instr] Albert Chae
2008-07-29 02:50:19 UTC
Permalink
Raw Message
Why would we care about having the shamt be negative when we can just
select the direction of the shift? Nobody wants to think about shifting
-5 bits left; that's too confusing.

Albert

P.S. Don't forget what we talked about today.
I was going to ask if shamt could be a negative value, but I guess the answer
is no, unless we go 8 one way and 8 the other. Since I probably shouldn't
have posted this, but as ever, I have OCD on fact checking, I will add the
thought that maybe this has something to do with the way the barrel shifter
works. OOps. nobody is supposed to pay attention to what a barrel shifter
http://inst.eecs.berkeley.edu/~cs150/fa05/HWs/HW10sol.doc
Post by Jeremy Cowles
I implemented the full 16 bit shamt shifter because I missed the line in the
spec that tells you to ignore bits > 4 in shamt. Is it ok to leave it like
this, or should I remove the additional logic so it ignores the bits greater
than the first 4?
Thanks,
Jeremy
Loading...