Link to home
Start Free TrialLog in
Avatar of mack123
mack123

asked on

4-bit ALU

hi
     i have searching the net for a good 4-bit alu design.i wanted a little help in this regard.
                              thanks
Avatar of JR2003
JR2003

What are you looking for?
Is a circuit that will take four 4-bit numbers a, b, c and d and will evaluate: a+ b + (c * d) what you are looking for?
you could use half the capabilities of a Z80 chip.
also look at the Basic Stamp series of chips
Could you use a 74LS181 or 74F382 ?
Avatar of mack123

ASKER

any ic's could be used except the ALU ic.it has to be implemented.
so 74LS181 certainly cannot be used
Avatar of mack123

ASKER

please if u find it on a website ,please do tell me.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This has the logical gate layout of 74LS181 which you could implement useing ICs with just ANDs, ORs and NOTs
http://www.visc.vt.edu/~mhsiao/ece4504/project/proj0/181_datasheet.pdf

Another simple solution is to use a programmable EPROM as a lookup taable. If you get one with 16 inputs and 16 outputs you can have a circuit that will do an operation on 4 4-bit numbers and produce a 16 bit result. The maximum result of the operation A + B + (C * D) where A, B, C and D are  4-bit numbers is exactly (2^16)-1 - the maximum 16-bit number which would fit in nicely with your requirement.
oops, I meant to say that you could get an EPROM with 16 inputs and 8 outputs!


Another simple solution is to use a programmable EPROM as a lookup taable. If you get one with 16 inputs and 8 outputs you can have a circuit that will do an operation on 4 4-bit numbers and produce a 16 bit result. The maximum result of the operation A + B + (C * D) where A, B, C and D are  4-bit numbers is exactly (2^8)-1 - the maximum 8-bit number which would fit in nicely with your requirement.
"an ALU" is a pretty broad description...

A 4-bit ALU is just like a 1-bit ALU, only 4 times wider and with some carry wires added.

A 1-bit ALU probably takes in TWO 1-bit inputs and generates a 1-bit output and a carry.  Since it's a "ALU" it probably should do at least add, subtract, and, and or.


For the add part, you need a 1-bit adder with carry.  That's a XOR gate for the output, an AND gate for the carry.

For subtract, you just need a way to negate the second input bit. That's another XOR gate.

For the AND and OR parts, you need an AND gate and an OR gate.

To make the function selectable, let's say you have a 2-bit op-code coming in:

00 ADD
01 SUB
10 AND
11 OR

You use the FIRST bit to select enable either the arithmetic section or the logical section.

You use the second bit to enable the add/and versus the sub/or.

Pretty easy, jsut a few gates, with the outputs either gated together, or tri-stated to the output.