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

[SOLVED] Feedback loops in synchronous processes - VHDL schematics

Status
Not open for further replies.

fmaximovic

Junior Member level 2
Joined
Aug 14, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
Hi,

I've seen that feeding back an output to a block requires a delay element between the output and the input linked to it; is the delay element necessary for clocked blocks too or only for combinatorial blocks?

Thanks guys
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,023
Helped
2,058
Reputation
4,133
Reaction score
2,010
Trophy points
1,393
Activity points
38,575
What are you refering to when you say "delay elements"? Combinatorial logic should never feedback on itself.
 

fmaximovic

Junior Member level 2
Joined
Aug 14, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
What are you refering to when you say "delay elements"? Combinatorial logic should never feedback on itself.
let's say i have to compute a+b, where b is the output of the block that performs the sum. my point is: if the adder has 3 ports (a,b, clock), can I just feed b back as input without a one-clock delay?

or do I need a register that holds for one clock cycle the output of the adder before feeding it back?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,280
Helped
13,995
Reputation
28,243
Reaction score
12,646
Trophy points
1,393
Location
Bochum, Germany
Activity points
275,239
if the adder has 3 ports (a,b, clock), can I just feed b back as input without a one-clock delay?
An adder as such doesn't utilize a clock. If the "adder" has a clock input it's most likely an adder with in- or output register. Then the output can be of course feed back to the input, forming an accumulator respectively integrator.
 

fmaximovic

Junior Member level 2
Joined
Aug 14, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
An adder as such doesn't utilize a clock. If the "adder" has a clock input it's most likely an adder with in- or output register. Then the output can be of course feed back to the input, forming an accumulator respectively integrator.
and there is no need to delay the input I feed back to it, right?
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,023
Helped
2,058
Reputation
4,133
Reaction score
2,010
Trophy points
1,393
Activity points
38,575
there is no need, but it wont work as you expect. Use a clock and make life simple.
 

fmaximovic

Junior Member level 2
Joined
Aug 14, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
there is no need, but it wont work as you expect. Use a clock and make life simple.
I will. Actually, maybe I am already : the "adder" has two inputs besides the clock; the output is fed back as one of the inputs without being delayed. Is this what you suggest?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,280
Helped
13,995
Reputation
28,243
Reaction score
12,646
Trophy points
1,393
Location
Bochum, Germany
Activity points
275,239
It shouldn't be too difficult to find out what the clock actually does. Either it feeds registers or it's simply unconnected.
 

stacksmith

Banned
Joined
Sep 14, 2012
Messages
29
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Location
USA
Activity points
0
There are two kinds of logic - combinational and synchronous.

The idea is to use combinational logic to do something, like add from a few sets of inputs. The result is available as soon as possible, with some gate delays. If there is too much going on, the differences in the delays through different paths will make your life hell. So we keep it as simple as possible, and register the results on a clock transition. That's synchronous logic.

It is really an organizational issue. With a small combinational circuit, we can guarantee (or at least measure) the worst-case delays. Now as long as the clock cycle is a little more than the worst case, our circuit is guaranteed to work.

So in your case, add, whatever. Register the result. Now you can connect the registered result to one of the inputs. Any other way of thinking (feedback loops or whatever) is just confusing to everyone.
 

fmaximovic

Junior Member level 2
Joined
Aug 14, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
So in your case, add, whatever. Register the result. Now you can connect the registered result to one of the inputs. Any other way of thinking (feedback loops or whatever) is just confusing to everyone.
That's what I did, as anticipated; apparently it's working. Thank you.

Thank you all guys for answering, it helped.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top