4-bit ALU using VHDL

Discussion in 'The Projects Forum' started by albertz, Oct 21, 2007.

  1. albertz

    Thread Starter New Member

    Oct 21, 2007
    1
    0
    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:
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. Robin Mitchell

    Well-Known Member

    Oct 25, 2009
    734
    200
    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.

    :)
     
Loading...