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.

addition problem in Modelsim

Status
Not open for further replies.

zxy499495828

Newbie level 2
Joined
Jul 4, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
the simple code of 2*2 matrix addition is as following:
Capture.JPGCapture1.JPG

in this second figure, the result of MSB is reversed in the first period. However, it becomes correct in the second period.
as seen in the first figure, it is a simple code.

Anyone can give me help on this?
 

Well, of course it is. This is synchronous logic, so you apply inputs "a" and "b", and the sum of those will appear on "c" the very next clock cycle.

Put another way, you have your a and b inputs ... then follows the actual combinational logic that does the addition. You don't see that in simulation, but should you synthesize it to real hardware this combinational logic will be there. And the outputs of that combinational logic is going to the input of a bunch of flip-flops aka registers aka that output logic. And then on the next posedge of your clock this result is clocked into the registers, and that is the result you see here in your sim with the 1 cycle delay.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top