Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

VHDL - Nbit multiplier test bench

Status
Not open for further replies.

S S Rayudu

Newbie level 4
Joined
Sep 24, 2014
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
58
in my test bench im supposed not to give any test vectors for my 2 bit multiplier but test should be done for all 4 possible combinations by using for loops
can some one help me with this
 

mrflibble

Advanced Member level 5
Joined
Apr 19, 2010
Messages
2,724
Helped
679
Reputation
1,360
Reaction score
651
Trophy points
1,393
Activity points
19,551
Damn. Doctor Habibi (my usual voodoo go-to guy) just went on vacation. As soon as he's back I will post an answer to your problem. Personally I have no clue wtf you are on about, but Dr Hababi is a champ at divining the full answer based on haphazard partial clues.
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,701
Helped
1,783
Reputation
3,574
Reaction score
1,734
Trophy points
1,393
Location
USA
Activity points
58,168
in my test bench im supposed not to give any test vectors for my 2 bit multiplier but test should be done for all 4 possible combinations by using for loops
can some one help me with this
assuming Verilog (as my Dr Habibi died from overusing their "powers" interpreting edaboard posts) use a for loop in a initial block that assigns the for loop index to the signal that is connected to the multiplier input. You would also have a time control statement like #10 to schedule the next time through the loop, otherwise everything will be done in 0 ns.

Seems to me a 2-bit multiplier should have 16 possible input combinations (i.e. four input values for each A/B input) and would have a 4-bit output.

- - - Updated - - -

Something like this should work.
Code:
reg [1:0] a,b;
integer i;
initial begin
  for (i=0;i<16;i=i+1) begin
    {a,b} = i;
    #10;
  end
end
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top