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.

question regarding execution of statement in verilog!!

Status
Not open for further replies.

Indrajit Ghosh

Junior Member level 2
Joined
Feb 17, 2015
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
170
suppose I have instantiated to ipcores c1,c2 in a module suppose called top module.now a control signal activates core c1 and a control signal from core c1 activates c2. Now suppose i include an always block for positive clock cycles and inside it I write some conditional logic where the signal activating core c1 turns off.Now my question is that will the core keep executing itself over and over again till the control signal is activated or will it run only once and the always block will run over and over again?


PS:- I am new in verilog
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,058
Helped
2,075
Reputation
4,167
Reaction score
2,028
Trophy points
1,393
Activity points
39,053
If you set the enable bit low, it will then halt at whatever state it's in.

- - - Updated - - -

PS. This is not a verilog question - this is a digital logic question, which is nothing to do with verilog. You need to go and do a bit more learning about how digital systems work before you write ANY verilog. Verilog is an HDL (hardware description language), so you need to understand the circuit before you write any code. The usualy approach is to draw a diagram of the circuit before you write the HDL.
 

Indrajit Ghosh

Junior Member level 2
Joined
Feb 17, 2015
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
170
well I am trying to implement the "DIGITAL LOGIC QUESTION" using verilog...:smile:
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,237
Helped
1,151
Reputation
2,321
Reaction score
1,127
Trophy points
1,403
Location
Brazil
Activity points
53,767
I´m not too familiar with HDL designs, but sounds like related to FSM scope, due each state represents an enable condition to execute each core.
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,058
Helped
2,075
Reputation
4,167
Reaction score
2,028
Trophy points
1,393
Activity points
39,053
well I am trying to implement the "DIGITAL LOGIC QUESTION" using verilog...:smile:

Yes - but before you write ANY verilog, you need to know what the digital logic is. Have you drawn a diagram of the circuit? (you dont need verilog for this).
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,805
Helped
1,809
Reputation
3,628
Reaction score
1,768
Trophy points
1,393
Location
USA
Activity points
58,915
Now suppose i include an always block for positive clock cycles and inside it I write some conditional logic where the signal activating core c1 turns off.
This looks like a Verilog question on how an edge triggered always block behaves.

Now my question is that will the core keep executing itself over and over again till the control signal is activated or will it run only once and the always block will run over and over again?
but then you come back with this confusing question. which core are you talking about? the one that sends or the one that receives the turn off signal.

The always block will continually be activated (scheduled) each time the positive edge of the clock arrives.

Code Verilog - [expand]
1
always @ (posedge clock) begin /*...some code to execute...*/ end

so whatever outputs that always block generates will continue to be updated every clock edge.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top