The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 12th, 2024, 9:52pm
Pages: 1
Send Topic Print
rookie question: simple model in simulink (Read 4794 times)
LL
Junior Member
**
Offline



Posts: 18
California
rookie question: simple model in simulink
Aug 05th, 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!
Back to top
 
 
View Profile   IP Logged
ACWWong
Community Fellow
*****
Offline



Posts: 539
Oxford, UK
Re: rookie question: simple model in simulink
Reply #1 - 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.
Back to top
 
 
View Profile   IP Logged
LL
Junior Member
**
Offline



Posts: 18
California
Re: rookie question: simple model in simulink
Reply #2 - 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.
Back to top
 
 
View Profile   IP Logged
Visjnoe
Senior Member
****
Offline



Posts: 233

Re: rookie question: simple model in simulink
Reply #3 - 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
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.