4-bit ALU using VHDL

Thread Starter

albertz

Joined Oct 21, 2007
1
I'm having a problem on designing a 4-bit ALU that should take two Twos-complement numbers as input(A and B) with a 2 bit selector.

It should perform like this:

OUTPUT selector
add A and B 00
subtract A and B 01
negate A 10
AND (A anded to B) 11

and aside the 4-bit output, there is also 2 1-bit output. Overflow, which outputs 1 if the result of an addition exceeds the output's capability. Underflow, which outputs 1 if the result of a subtraction is smaller than the output can handle.

I'm still having a problem understanding VHDL. :confused:
 

beenthere

Joined Apr 20, 2004
15,819
You might try working up to it. See if you can get the operation of something more fundamental to operate, like an AND gate. Work up to a 2 bit adder, and then go for the full device.
 

Robin Mitchell

Joined Oct 25, 2009
819
hahahah, thats dead funny, I have just designed one.

It can do:
Add
Subtract
Ex-Or
And
Or
Not
Compare (greater, less, equal to)

I cant give you the schematics just yet but in the future (about a week) I can.

:)
 
Top