# Homework Help: Shift LR in 4 bit ALU?

1. Apr 2, 2010

### sickkid

1. The problem statement, all variables and given/known data

HI

This 4 bit ALU requires 8 functions in a bit slice, and satisfies following criteria

Also, it can only be constructed via basic logic gate..and,or,not,xor....

No filp-flop...etc.

S1 S2 S3 OUTPUT
0 0 0 Shift A Through (X = A)
0 0 1 Shift input A Left (X = A Shifted right by 1 bit)
0 1 0 Shift Input A Right (X = A Shifted left by 1 bit)
0 1 1 Logical AND (X = A AND B)
1 0 0 Logical XOR (X = A XOR B)
1 0 1 Logical NOR (X = A NOR B)
1 1 0 Full adder (X = A + B)
1 1 1 Subtraction (using the Full Adder) (X = A - B)

2. Relevant equations

Designing a 4 bit ALU

3. The attempt at a solution

I've complete the other six tasks(but subtractors doesn't work properly?!)

However,shifting right&left really beat me up...

this is what i got in one bit ALU...and then got stuck

http://tinyurl.com/ybhqex2

unable to build a shifter to fill in the blank

0 0 1 Shift input A Left (X = A Shifted right by 1 bit) =D1
0 1 0 Shift Input A Right (X = A Shifted left by 1 bit) =D2

somehow i hav rough ideas to build a shifter but seems cant satisfy the requirement or not this case

2 bit shifter
http://tinyurl.com/yjvdx34

4 bit shifter
http://tinyurl.com/ye9enhd