The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> rookie question: simple model in simulink
https://designers-guide.org/forum/YaBB.pl?num=1186303198

Message started by LL on Aug 5th, 2007, 1:39am

Title: rookie question: simple model in simulink
Post by LL on Aug 5th, 2007, 1:39am

This is a rookie question because I'm rather new to simulink.  I'm anlyzing error sources in ADC architectures and want to start with building a simple flash ADC in simulink.  Off the back, I can't find a simple comparator block.  I suppose I can start modeling the compator myself but I'm rather suprise there isn't one in the library ... at least not one I was able to find.  Is there a compator block in the lib? If yes, where?

thank you!

Title: Re: rookie question: simple model in simulink
Post by ACWWong on Aug 5th, 2007, 4:17am

using basic simulink library blocks do a comparator you could use:

"Add" block for the input with rule (+-). A "Constant" block as the reference (-) input to the "Add" block
"Sign" block as the comparator decision
"Gain" block on the output to scale the comparator output

or something like the "Compare to Constant" block if you want a 0 or 1 output.

Title: Re: rookie question: simple model in simulink
Post by LL on Aug 5th, 2007, 9:17pm


ACWWong wrote on Aug 5th, 2007, 4:17am:
using basic simulink library blocks do a comparator you could use:

"Add" block for the input with rule (+-). A "Constant" block as the reference (-) input to the "Add" block
"Sign" block as the comparator decision
"Gain" block on the output to scale the comparator output

or something like the "Compare to Constant" block if you want a 0 or 1 output.



From your reply, I'm taking that a comparator block isn't part of any library in Matlab. Thank you for the reply.

Title: Re: rookie question: simple model in simulink
Post by Visjnoe on Aug 8th, 2007, 11:50pm

Hey LL,

when developing models in Simulink you're sometimes a bit limited by the functionality of the blockset. But this can be solved easily, because Simulink allows you to include blocks which execute MATLAB code, which can be as complex as you want.

So if you don't find a comparator in the Simulink blockset (although I think there is one), you can write some custom MATLAB code to perform the comparison.


Regards

Peter

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.