Continue to Site

Welcome to EDAboard.com

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.

how to use 2's complement arihmetic in Verliog?

Status
Not open for further replies.

H.Hachem

Junior Member level 3
Joined
May 29, 2012
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,520
Hi,
I am looking for a way to force verilog to use 2's complement arithmetic. I'm not sure if it does it automatically. I heard somewhere that declaring the inputs as 'signed' would do the job. Can someone help me out?
 

As far as I know, Verilog 2001 has built-in support for this, just using signed nets and variables!

Cheers
 
true. I tested it and you are right. The thing that puzzles me though, if I can declare inputs as unsigned in the module but signed in the testbench, or if I have to declare them as signed inputs in both.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top