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.

Can we make this huge verilog code(32 bit multiplier) into small one?

Status
Not open for further replies.

rokyslash

Newbie level 1
Joined
Apr 1, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
I am a beginner when it comes to verilog and i have found this 32 bit multiplier code(using CSLA logic:it seems, thats what a friend of mine said). Is there a way to reduce the code: i mean by using for loops or any other method. I am doing this for my academic project and i need some expert help if there is a way i can reduce this.

P.S I am new to such forums and stuff, so please forgive me if i am posting things in a wrong way or anything.

Here is the code attached and it has simple AND gate,half and full adder modules in this.
 

Attachments

  • multiplier.txt
    52.2 KB · Views: 10

vGoodtimes

Advanced Member level 4
Joined
Feb 16, 2015
Messages
1,089
Helped
307
Reputation
614
Reaction score
302
Trophy points
83
Activity points
8,730
For FPGAs, you can (and likely should) use "*" with the appropriate types. This is because there are multiply units already in the FPGA. These multiply units have dedicated logic and routing. As a result, it will be hard to make a better multiplier out of normal LUTs and normal routing resources.
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,807
Helped
1,810
Reputation
3,630
Reaction score
1,769
Trophy points
1,393
Location
USA
Activity points
58,934
As vGootimes said the FPGA equivalent to the huge, un-maintainable mess of structural Verilog, would be this:


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
module multiplier (
  input  [31:0] a,
  input  [31:0] b,
  output [63:0] p
);
 
  assign p = a * b;
 
endmodule



But if you want high performance you'll probably want to add a clock and include some pipeline registers.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top