EmbDev.net

Forum: FPGA, VHDL & Verilog VHDL adder/subtractor Help


Author: Parsons Blake (blueblack)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hi

I need to create a VHDL adder/subtractor structually using ripple carry.
I'm fairly new to this and it is for a university course.

The problem is that I don't know how to do the subtracting mechanism.
I was provided with a testbench, so I can't change that.

I added the files to attachment.

Thank You

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:
Attached files:

Rate this post
0 useful
not useful
> The problem is that I don't know how to do the subtracting mechanism.
Good news: you already implemented the subtractor.
You just have to remove the lousy faults and syntax errors reported to 
you (in numbers around 15-20) and then the thing is working...
A little hint: all of the errrors are in the  adder_subtracter.vhd

Author: Parsons Blake (blueblack)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Haha, there were many errors, I don't know how when I first compiled it, 
I didn't notice them or how it even got to the simulation.
It now doesn't give me any errors at compiling.
But it doesn't work still, I don't know what to make of these characters 
in a_tb and b_tb ( c, d, f etc.).

I attached the corrected versions in to the attachment.

And thank you for your fast reply

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
> But it doesn't work still,
No, its ok. All is fine. Your waveform is exactly like mine!
The only remaining problem ist this:
> I don't know what to make of these characters ( c, d, f etc.).
To understand the waveform have a look for hexadecimal numbers and their 
binary representation, and then how a adder of 4 bits width reacts when 
there is an overflow, and also how a subtractor reacts when there is an 
underflow...

Author: Parsons Blake (blueblack)
Posted on:

Rate this post
0 useful
not useful
Ok, I read about those things.
After analyzing the graph I do too realize that it is working.
Anyways, I really appreciate that You took the time to help me.

Author: programmm (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
I have problem with test bench . He doesn't work . What is problem?
I also have full addder file but i didn't attach

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
> He doesn't work . What is problem?
The major problem is, that you don't tell us, what the problem is.
So: what is going wrong? What does the simulator say?

The second most problem is that you hijacked a thread...  :-/

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.