Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Dave_59 am using XILINX... n the code goes as follows ..
Pls helpme..
module adder(result,operand1,operand2);
input signed [31:0]operand1;
input [15:0]operand2;
output signed [31:0]result;
reg signed [31:0] result;
always @(operand1,operand2)
begin
result = operand2 + operand1;
end
endmodule
I tried the code given.. It is just adding the two giving a negative sign.. Can u pls solve this?? It has been so many days and u people couldn't solve 1 problem!!
---------- Post added at 17:21 ---------- Previous post was at 17:20 ----------
It should add or subtract depending upon the sign...
our unsigned number is 16 bits in range (it is nvr never going to have a negative value) while the other number is signed n of 30 bits in length.. we want to add or subtract depending on the sign of the signed number.. Can u please write a code on how to do it?? thanx fr d help :)
actually I on't want the output in the form of 32758 for -10 as output , I want it as -10 if I have done 20-30. How to implement this??
thanx fr ur responses.. plz hlp me solve this problms. I will attach test bench if u want.
I meant I hv to add a signe number with an unsigned..
for example 20 + 10, 20 + (-10), 20 + (-30)
Basically an adder subtractor block where 1 input is signed and the othe unsigned. How do I do it??
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.