+ Post New Thread
Results 1 to 11 of 11
  1. #1
    Newbie level 6
    Points: 75, Level: 1

    Join Date
    Jun 2018
    Posts
    13
    Helped
    0 / 0
    Points
    75
    Level
    1

    Build an Adder using VHDL

    My project is 16 bits ALU using VHDL

    I am requested to build an adder but not using built-in function, I have to use my own functions and library

    How can I start up with codes

  2. #2
    Super Moderator
    Points: 60,116, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,277
    Helped
    2840 / 2840
    Points
    60,116
    Level
    59

    Re: Build an Adder using VHDL

    Hi,

    start with the theory.
    * are the input values signed or unsigned?
    * how does a 1+1 bit adder work?
    * do you need to generate carry flag and satus flags?
    * then use a pencil and paper and draw a circuit for your 16 bit adder.
    * maybe do some optimizations on your circuit
    * write code
    * test the code. Usual random values but additionally extreme values to thest the extreme situations. Always first write down the expected results, then do the test.

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   Alt12th June 2018, 12:48

      advertising

        
       

  3. #3
    Newbie level 6
    Points: 75, Level: 1

    Join Date
    Jun 2018
    Posts
    13
    Helped
    0 / 0
    Points
    75
    Level
    1

    Re: Build an Adder using VHDL

    can you help me with that if you have a time, please? Actually, I am run of time

    Thanks in Advance



  4. #4
    Super Moderator
    Points: 60,116, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,277
    Helped
    2840 / 2840
    Points
    60,116
    Level
    59

    Re: Build an Adder using VHDL

    Hi,

    not "I", but "we", the forum.

    And "help" means: You do the job, and we "help" to find mistakes.
    A forum can not replace school and your own will to read documents.
    --> show what you have done and learned so far.

    "time": We will help you to solve the technical problems, but the "time" probelm is yours. Remember: you get the informations for free.

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   Alt12th June 2018, 13:12

      advertising

        
       

  5. #5
    Advanced Member level 5
    Points: 36,062, Level: 46
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,589
    Helped
    1924 / 1924
    Points
    36,062
    Level
    46

    Re: Build an Adder using VHDL

    This code looks like an ALU, and it's your own post:
    https://www.edaboard.com/showthread....quot-quot-quot



    •   Alt12th June 2018, 13:13

      advertising

        
       

  6. #6
    Super Moderator
    Points: 244,634, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,495
    Helped
    12948 / 12948
    Points
    244,634
    Level
    100

    Re: Build an Adder using VHDL

    You can find some hints in the Altera Advanced Synthesis Cookbook https://www.altera.com/content/dam/a...x_cookbook.pdf



  7. #7
    Newbie level 6
    Points: 75, Level: 1

    Join Date
    Jun 2018
    Posts
    13
    Helped
    0 / 0
    Points
    75
    Level
    1

    Re: Build an Adder using VHDL

    yes it is mine, but I want to built an adder



  8. #8
    Member level 2
    Points: 332, Level: 3

    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    42
    Helped
    8 / 8
    Points
    332
    Level
    3

    Re: Build an Adder using VHDL

    Quote Originally Posted by B21hasni View Post
    yes it is mine, but I want to built an adder
    Hi,

    try to use XOR and AND logic function to buil 1-bit numbers adder with carry.

    So you are trying to add: 0+0, 0+1, 1+0, 1+1

    You have two outputs: bit position - after adding
    carry bit - after adding

    So now think how to use xor and and bool function for this purpose.

    If yo have one bit adder with carry - you can build N bit adder to join 1-bit adders (with carry) N times.

    It is easy

    Regards



  9. #9
    Newbie level 3
    Points: 37, Level: 1

    Join Date
    May 2018
    Posts
    4
    Helped
    0 / 0
    Points
    37
    Level
    1

    Re: Build an Adder using VHDL

    Hi B21hasni, that may help you https://www.slideshare.net/zbhavyai/...alu-using-vhdl

    Best Regards



    •   Alt13th June 2018, 14:24

      advertising

        
       

  10. #10
    Advanced Member level 4
    Points: 7,451, Level: 20
    Achievements:
    7 years registered Created Blog entry
    dpaul's Avatar
    Join Date
    Jan 2008
    Location
    Germay
    Posts
    1,094
    Helped
    244 / 244
    Points
    7,451
    Level
    20
    Blog Entries
    1

    Re: Build an Adder using VHDL

    How can I start up with codes
    Any undergraduate digital design text-book teaches you how to build an adder using logic gates.

    Study that and then apply that concept in VHDL to model the adder (you have to use the structural coding style rather than behavioral style).
    In the text book the eg might be a 4 bits adder example, but the concept can easily be extended to 16 bits. If you are a beginner, just build a 4bits adder first and completely understand how it works.

    So write you code, show us what you have done and for sure further help will be available thereafter.
    .....yes, I do this for fun!



  11. #11
    Super Moderator
    Points: 29,067, Level: 41
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,682
    Helped
    1604 / 1604
    Points
    29,067
    Level
    41

    Re: Build an Adder using VHDL

    Quote Originally Posted by dpaul View Post
    Any undergraduate digital design text-book teaches you how to build an adder using logic gates.
    According to their other post, this is their graduation project.

    FYI, they currently have 3 threads on various aspects of the same project.

    At this point I'll assuming they focused on something else (Analog/RF?) and this is the first time they've done a digital design, makes me wonder why they would chose or be directed to work on a graduation project they know nothing about (digital design, VHDL, ALUs, etc). Why aren't they designing a RF power amplifier or an Analog notch filter or something equally more suited to their course work/speciality.



--[[ ]]--