[Instr] Albert Chae

2008-07-30 06:31:28 UTC

You can use multipliers and dividers from the Arithmetic library, with

a constant 2 fed in as input. This doesn't handle the sra case though

but don't worry too much about it.

Albert

easy

included in arithmetic to simulate shifting by multiplying by 2 each time,

and

variable number of times (*2^x) in a way that was less convoluted than my own

shifter already was.

a constant 2 fed in as input. This doesn't handle the sra case though

but don't worry too much about it.

Albert

So, assuming we're building a test circuit using our ALU compared with

anotherALU built from library subcircuits, I have no idea what to test my shifters

against, other than building my own shifter circuits again. Is there an

against, other than building my own shifter circuits again. Is there an

way to build _input_*2^shamt and _input_/2^shamt that I'm not seeing? Any

otherideas?

This may not work for all cases, but you could use the multiplier circuitincluded in arithmetic to simulate shifting by multiplying by 2 each time,

dividing to shift in the opposite direction. You might get some weird results

though when digits start to drop off the ends...

I was thinking of doing that, but I couldn't figure out how to multiply by 2 athough when digits start to drop off the ends...

variable number of times (*2^x) in a way that was less convoluted than my own

shifter already was.