EmbDev.net

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


von Parsons B. (blueblack)


Attached files:

Rate this post
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

: Locked by Moderator
von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Attached files:

Rate this post
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

von Parsons B. (blueblack)


Attached files:

Rate this post
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

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
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...

von Parsons B. (blueblack)


Rate this post
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.

von programmm (Guest)



Rate this post
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

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
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...  :-/

This topic is locked and can not be replied to.