VHDL adder/subtractor Help

OP #2563222
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
Attached files:
Moderator (Company: Titel) #2563261
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
Attached files:
OP #2563350
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
Attached files:
Moderator (Company: Titel) #2563999
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...
This topic is locked and can not be replied to.