Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am trying to code in VHDL a full 8-bit adder that can take into account twos c

ID: 1936156 • Letter: I

Question

I am trying to code in VHDL a full 8-bit adder that can take into account twos complement when necessary. Currently I have my full 8-bit adder working properly and was going to implement a twos complement but how do I know when it should take it or not? Two make my point more clear ill show an example below. A<= 0010 0000 B<= 1000 1000 How should my code discern from A+B equaling 1010 1000 = 168 or under twos complement since B's most significant bit is 1 A-B being 0010 0000 + 0111 0111 which is 1001 0111 = 0110 1000 = -104 Id appreciate any insight into this, please don't just link websites as I am very capable of going to Google for information like that and have tried but found them to not drive the point home with myself. Thank you in advance! Will rate 5 for help!

Explanation / Answer

you should add another one bit selection input to select it as adder or subtracter. if that selection input is 0 your output should be just A+B if that selection input is 1 your output should be just A-B

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote