Model {
  Name			  "sldemo_adc_quantize"
  Version		  6.2
  MdlSubVersion		  0
  GraphicalInterface {
    NumRootInports	    0
    NumRootOutports	    3
    Outport {
      BusObject		      ""
      BusOutputAsStruct	      "off"
      Name		      "E_volts_in_bit_units"
    }
    Outport {
      BusObject		      ""
      BusOutputAsStruct	      "off"
      Name		      "E_bit_units"
    }
    Outport {
      BusObject		      ""
      BusOutputAsStruct	      "off"
      Name		      "bit_edges"
    }
    ParameterArgumentNames  ""
    ComputedModelVersion    "1.130"
    NumModelReferences	    0
    NumTestPointedSignals   0
  }
  Description		  "Analog-to-Digital Converter Quantization Algorithm"
"\n\nThe quantization algorithm in the model takes in a 0 to 5 volt signal and"
" outputs \na 12-bit digital word in a 16-bit signed integer. A value of 0 cor"
"responds to 0 Volts \nand a value of 4096 would correspond to 5 Volts. A chan"
"ge in the least \nsignificant bit (LSB) is about 1.2 mV. As 12 bits can only "
"reach the value of \n4095, the highest voltage that can be read by this devic"
"e is approximately \n4.9988 Volts. In order to have no more than 1/2 LSB erro"
"r, the quantizer changes \nvalues midway between each voltage point, resultin"
"g in a 1/2-width interval at \n0 Volts and a 3/2-width interval just below 5 "
"Volts.\n"
  SavedCharacterEncoding  "US-ASCII"
  SaveDefaultBlockParams  on
  SampleTimeColors	  off
  LibraryLinkDisplay	  "none"
  WideLines		  off
  ShowLineDimensions	  off
  ShowPortDataTypes	  on
  ShowLoopsOnError	  on
  IgnoreBidirectionalLines off
  ShowStorageClass	  off
  ShowTestPointIcons	  on
  ShowViewerIcons	  off
  SortedOrder		  off
  ExecutionContextIcon	  off
  ShowLinearizationAnnotations off
  RecordCoverage	  off
  CovPath		  "/"
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  covSaveCumulativeToWorkspaceVar on
  CovSaveSingleToWorkspaceVar on
  CovCumulativeVarName	  "covCumulativeData"
  CovCumulativeReport	  off
  CovReportOnPause	  on
  ScopeRefreshTime	  0.035000
  OverrideScopeRefreshTime on
  DisableAllScopes	  off
  DataTypeOverride	  "UseLocalSettings"
  MinMaxOverflowLogging	  "UseLocalSettings"
  MinMaxOverflowArchiveMode "Overwrite"
  BlockNameDataTip	  off
  BlockParametersDataTip  off
  BlockDescriptionStringDataTip	off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks on
  BrowserLookUnderMasks	  on
  CloseFcn		  "if exist('adc_ploth')\n  if ishandle(adc_ploth)\n  "
"  close(adc_ploth)\n  end\n  clear adc_ploth\n  if exist('tout'), clear tout;"
" end\n  if exist('yout'), clear yout; end\nend\n"
  InitFcn		  "\n"
  StartFcn		  "if exist('adc_ploth')\n  if ishandle(adc_ploth)\n  "
"  close(adc_ploth)\n  end\n  clear adc_ploth\nend\n"
  StopFcn		  "if exist('yout')\n if isstruct(yout)\n  adc_ploth ="
" figure;\n  plot(yout.signals(1).values,double(yout.signals(2).values),'bo-')"
", grid, hold on, plot([0,4096],[0,4096],'g'), hold off\n  title(sprintf('Idea"
"lized A/D converter quantization algorithm \\n (Zoom in close with the mouse "
"to see behavior details)'))\n  zoom on\n end\nend\n"
  Created		  "Fri Mar 12 10:05:04 2004"
  Creator		  "The MathWorks Inc."
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "batserve"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Sat Jan 22 19:08:50 2005"
  ModelVersionFormat	  "1.%<AutoIncrement:130>"
  ConfigurationManager	  "None"
  LinearizationMsg	  "none"
  Profile		  off
  ParamWorkspaceSource	  "MATLABWorkspace"
  AccelSystemTargetFile	  "accel.tlc"
  AccelTemplateMakefile	  "accel_default_tmf"
  AccelMakeCommand	  "make_rtw"
  TryForcingSFcnDF	  off
  ExtModeBatchMode	  off
  ExtModeEnableFloating	  on
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  1000
  ExtModeTrigDurationFloating "auto"
  ExtModeTrigHoldOff	  0
  ExtModeTrigDelay	  0
  ExtModeTrigDirection	  "rising"
  ExtModeTrigLevel	  0
  ExtModeArchiveMode	  "off"
  ExtModeAutoIncOneShot	  off
  ExtModeIncDirWhenArm	  off
  ExtModeAddSuffixToVar	  off
  ExtModeWriteAllDataToWs off
  ExtModeArmWhenConnect	  on
  ExtModeSkipDownloadWhenConnect off
  ExtModeLogAll		  on
  ExtModeAutoUpdateStatusClock off
  BufferReuse		  on
  StrictBusMsg		  "None"
  ProdHWDeviceType	  "32-bit Generic"
  ShowModelReferenceBlockVersion off
  ShowModelReferenceBlockIO off
  Array {
    Type		    "Handle"
    Dimension		    1
    Simulink.ConfigSet {
      $ObjectID		      1
      Version		      "1.1.0"
      Array {
	Type			"Handle"
	Dimension		7
	Simulink.SolverCC {
	  $ObjectID		  2
	  Version		  "1.1.0"
	  StartTime		  "0.0"
	  StopTime		  "6000"
	  AbsTol		  "auto"
	  FixedStep		  "0.1"
	  InitialStep		  "auto"
	  MaxNumMinSteps	  "-1"
	  MaxOrder		  5
	  ExtrapolationOrder	  4
	  NumberNewtonIterations  1
	  MaxStep		  "0.1"
	  MinStep		  "auto"
	  RelTol		  "1e-3"
	  SolverMode		  "Auto"
	  Solver		  "VariableStepDiscrete"
	  SolverName		  "VariableStepDiscrete"
	  ZeroCrossControl	  "UseLocalSettings"
	  AlgebraicLoopSolver	  "TrustRegion"
	  SolverResetMethod	  "Fast"
	  PositivePriorityOrder	  off
	  AutoInsertRateTranBlk	  off
	  SampleTimeConstraint	  "Unconstrained"
	  RateTranMode		  "Deterministic"
	}
	Simulink.DataIOCC {
	  $ObjectID		  3
	  Version		  "1.1.0"
	  Decimation		  "1"
	  ExternalInput		  "ustruct"
	  FinalStateName	  "xFinal"
	  InitialState		  "xInitial"
	  LimitDataPoints	  off
	  MaxDataPoints		  "5000"
	  LoadExternalInput	  off
	  LoadInitialState	  off
	  SaveFinalState	  off
	  SaveFormat		  "StructureWithTime"
	  SaveOutput		  on
	  SaveState		  off
	  SignalLogging		  on
	  SaveTime		  on
	  StateSaveName		  "xout"
	  TimeSaveName		  "tout"
	  OutputSaveName	  "yout"
	  SignalLoggingName	  "logsout"
	  OutputOption		  "RefineOutputTimes"
	  OutputTimes		  "[]"
	  Refine		  "1"
	}
	Simulink.OptimizationCC {
	  $ObjectID		  4
	  Version		  "1.1.0"
	  BlockReduction	  on
	  BooleanDataType	  off
	  ConditionallyExecuteInputs on
	  InlineParams		  on
	  InlineInvariantSignals  on
	  OptimizeBlockIOStorage  on
	  BufferReuse		  on
	  EnforceIntegerDowncast  on
	  ExpressionFolding	  on
	  FoldNonRolledExpr	  on
	  LocalBlockOutputs	  on
	  ParameterPooling	  on
	  RollThreshold		  5
	  SystemCodeInlineAuto	  off
	  StateBitsets		  off
	  DataBitsets		  off
	  UseTempVars		  off
	  ZeroExternalMemoryAtStartup off
	  ZeroInternalMemoryAtStartup on
	  InitFltsAndDblsToZero	  on
	  NoFixptDivByZeroProtection off
	  EfficientFloat2IntCast  off
	  OptimizeModelRefInitCode on
	  LifeSpan		  "1"
	  BufferReusableBoundary  off
	}
	Simulink.DebuggingCC {
	  $ObjectID		  5
	  Version		  "1.1.0"
	  RTPrefix		  "error"
	  ConsistencyChecking	  "none"
	  ArrayBoundsChecking	  "none"
	  SignalInfNanChecking	  "none"
	  AlgebraicLoopMsg	  "warning"
	  ArtificialAlgebraicLoopMsg "warning"
	  CheckSSInitialOutputMsg on
	  CheckExecutionContextPreStartOutputMsg on
	  CheckExecutionContextRuntimeOutputMsg	on
	  SignalResolutionControl "TryResolveAllWithWarning"
	  BlockPriorityViolationMsg "warning"
	  MinStepSizeMsg	  "warning"
	  SolverPrmCheckMsg	  "warning"
	  InheritedTsInSrcMsg	  "warning"
	  DiscreteInheritContinuousMsg "warning"
	  MultiTaskDSMMsg	  "warning"
	  MultiTaskRateTransMsg	  "error"
	  SingleTaskRateTransMsg  "none"
	  TasksWithSamePriorityMsg "warning"
	  CheckMatrixSingularityMsg "none"
	  IntegerOverflowMsg	  "warning"
	  Int32ToFloatConvMsg	  "warning"
	  ParameterDowncastMsg	  "error"
	  ParameterOverflowMsg	  "error"
	  ParameterPrecisionLossMsg "warning"
	  UnderSpecifiedDataTypeMsg "none"
	  UnnecessaryDatatypeConvMsg "none"
	  VectorMatrixConversionMsg "none"
	  InvalidFcnCallConnMsg	  "error"
	  FcnCallInpInsideContextMsg "Use local settings"
	  SignalLabelMismatchMsg  "none"
	  UnconnectedInputMsg	  "warning"
	  UnconnectedOutputMsg	  "warning"
	  UnconnectedLineMsg	  "warning"
	  SFcnCompatibilityMsg	  "none"
	  UniqueDataStoreMsg	  "none"
	  BusObjectLabelMismatch  "none"
	  RootOutportRequireBusObject "warning"
	  AssertControl		  "UseLocalSettings"
	  EnableOverflowDetection off
	  ModelReferenceIOMsg	  "none"
	  ModelReferenceVersionMismatchMessage "none"
	  ModelReferenceIOMismatchMessage "none"
	  ModelReferenceCSMismatchMessage "none"
	  ModelReferenceSimTargetVerbose off
	  UnknownTsInhSupMsg	  "warning"
	  ModelReferenceDataLoggingMessage "warning"
	  ModelReferenceSymbolNameMessage "warning"
	  ModelReferenceExtraNoncontSigs "error"
	}
	Simulink.HardwareCC {
	  $ObjectID		  6
	  Version		  "1.1.0"
	  ProdBitPerChar	  8
	  ProdBitPerShort	  16
	  ProdBitPerInt		  32
	  ProdBitPerLong	  32
	  ProdIntDivRoundTo	  "Undefined"
	  ProdEndianess		  "Unspecified"
	  ProdWordSize		  32
	  ProdShiftRightIntArith  on
	  ProdHWDeviceType	  "32-bit Generic"
	  TargetBitPerChar	  8
	  TargetBitPerShort	  16
	  TargetBitPerInt	  32
	  TargetBitPerLong	  32
	  TargetShiftRightIntArith on
	  TargetIntDivRoundTo	  "Undefined"
	  TargetEndianess	  "Unspecified"
	  TargetWordSize	  32
	  TargetTypeEmulationWarnSuppressLevel 0
	  TargetPreprocMaxBitsSint 32
	  TargetPreprocMaxBitsUint 32
	  TargetHWDeviceType	  "Specified"
	  TargetUnknown		  off
	  ProdEqTarget		  on
	}
	Simulink.ModelReferenceCC {
	  $ObjectID		  7
	  Version		  "1.1.0"
	  UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
	  CheckModelReferenceTargetMessage "error"
	  ModelReferenceNumInstancesAllowed "Multi"
	  ModelReferencePassRootInputsByReference on
	  ModelReferenceMinAlgLoopOccurrences off
	}
	Simulink.RTWCC {
	  $BackupClass		  "Simulink.RTWCC"
	  $ObjectID		  8
	  Version		  "1.1.0"
	  SystemTargetFile	  "ert.tlc"
	  GenCodeOnly		  off
	  MakeCommand		  "make_rtw"
	  TemplateMakefile	  "ert_default_tmf"
	  Description		  "RTW Embedded Coder (no auto configuration)"
	  GenerateReport	  off
	  SaveLog		  off
	  RTWVerbose		  on
	  RetainRTWFile		  off
	  ProfileTLC		  off
	  TLCDebug		  off
	  TLCCoverage		  off
	  TLCAssert		  off
	  ProcessScriptMode	  "Default"
	  ConfigurationMode	  "Optimized"
	  ProcessScript		  "ert_make_rtw_hook"
	  ConfigAtBuild		  off
	  IncludeHyperlinkInReport off
	  LaunchReport		  off
	  TargetLang		  "C"
	  Array {
	    Type		    "Handle"
	    Dimension		    2
	    Simulink.CodeAppCC {
	      $ObjectID		      9
	      Version		      "1.1.0"
	      ForceParamTrailComments off
	      GenerateComments	      on
	      IgnoreCustomStorageClasses on
	      IncHierarchyInIds	      off
	      MaxIdLength	      31
	      PreserveName	      off
	      PreserveNameWithParent  off
	      ShowEliminatedStatement off
	      IncAutoGenComments      off
	      SimulinkDataObjDesc     off
	      SFDataObjDesc	      off
	      IncDataTypeInIds	      off
	      PrefixModelToSubsysFcnNames on
	      CustomSymbolStr	      "$R$N$M"
	      MangleLength	      1
	      DefineNamingRule	      "UpperCase"
	      ParamNamingRule	      "None"
	      SignalNamingRule	      "None"
	      InsertBlockDesc	      off
	      SimulinkBlockComments   on
	      EnableCustomComments    off
	      InlinedPrmAccess	      "Macros"
	      ReqsInCode	      off
	    }
	    Simulink.ERTTargetCC {
	      $BackupClass	      "Simulink.TargetCC"
	      $ObjectID		      10
	      Version		      "1.1.0"
	      TargetFcnLib	      "iso_tfl_tmw.mat"
	      TargetLibSuffix	      ""
	      TargetPreCompLibLocation ""
	      GenFloatMathFcnCalls    "ISO_C"
	      UtilityFuncGeneration   "Shared location"
	      GenerateFullHeader      on
	      GenerateSampleERTMain   on
	      IsPILTarget	      off
	      ModelReferenceCompliant on
	      IncludeMdlTerminateFcn  on
	      CombineOutputUpdateFcns on
	      SuppressErrorStatus     on
	      IncludeFileDelimiter    "Auto"
	      ERTCustomFileBanners    on
	      SupportAbsoluteTime     off
	      LogVarNameModifier      "rt_"
	      MatFileLogging	      off
	      MultiInstanceERTCode    off
	      SupportNonFinite	      off
	      SupportComplex	      off
	      PurelyIntegerCode	      off
	      SupportContinuousTime   off
	      SupportNonInlinedSFcns  off
	      GenerateErtSFunction    off
	      GenerateASAP2	      off
	      ExtMode		      off
	      ExtModeTransport	      0
	      ExtModeStaticAlloc      off
	      ExtModeStaticAllocSize  1000000
	      ExtModeTesting	      off
	      ExtModeMexFile	      "ext_comm"
	      InlinedParameterPlacement	"NonHierarchical"
	      TargetOS		      "BareBoardExample"
	      MultiInstanceErrorCode  "Error"
	      RateGroupingCode	      on
	      RootIOFormat	      "Individual arguments"
	      RTWCAPISignals	      off
	      RTWCAPIParams	      off
	      RTWCAPIStates	      off
	      ERTSrcFileBannerTemplate "ert_code_template.cgt"
	      ERTHdrFileBannerTemplate "ert_code_template.cgt"
	      ERTDataSrcFileTemplate  "ert_code_template.cgt"
	      ERTDataHdrFileTemplate  "ert_code_template.cgt"
	      ERTCustomFileTemplate   "example_file_process.tlc"
	      InitialValueSource      "Model"
	      ModuleNamingRule	      "Unspecified"
	      SignalDisplayLevel      10
	      ParamTuneLevel	      10
	      GlobalDataDefinition    "Auto"
	      GlobalDataReference     "Auto"
	      GRTInterface	      off
	    }
	    PropName		    "Components"
	  }
	}
	PropName		"Components"
      }
      Name		      "Configuration"
      SimulationMode	      "normal"
      ExtraOptions	      "-aInitFltsAndDblsToZero=1 "
      CurrentDlgPage	      "Solver"
    }
    PropName		    "ConfigurationSets"
  }
  Simulink.ConfigSet {
    $PropName		    "ActiveConfigurationSet"
    $ObjectID		    1
  }
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Default"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Bias
      Bias		      "0"
      SaturateOnIntegerOverflow	on
    }
    Block {
      BlockType		      Clock
      DisplayTime	      off
    }
    Block {
      BlockType		      DataTypeConversion
      OutDataTypeMode	      "Inherit via back propagation"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      ConvertRealWorld	      "Real World Value (RWV)"
      RndMeth		      "Zero"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Fcn
      Expr		      "sin(u[1])"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ParameterDataTypeMode   "Same as input"
      ParameterDataType	      "sfix(16)"
      ParameterScalingMode    "Best Precision: Matrix-wise"
      ParameterScaling	      "2^0"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      SignalConversion
      OverrideOpt	      off
    }
    Block {
      BlockType		      HitCross
      HitCrossingOffset	      "0"
      HitCrossingDirection    "either"
      ShowOutputPort	      on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Inport
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      Interpolate	      on
    }
    Block {
      BlockType		      Lookup
      InputValues	      "[-4:5]"
      OutputValues	      " rand(1,10)-0.5"
      LookUpMeth	      "Interpolation-Extrapolation"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
      LUTDesignTableMode      "Redesign Table"
      LUTDesignDataSource     "Block Dialog"
      LUTDesignFunctionName   "sqrt(x)"
      LUTDesignUseExistingBP  on
      LUTDesignRelError	      "0.01"
      LUTDesignAbsError	      "1e-6"
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      Reference
    }
    Block {
      BlockType		      Rounding
      Operator		      "floor"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Saturate
      UpperLimit	      "0.5"
      LowerLimit	      "-0.5"
      LinearizeAsGain	      on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      SFunctionModules	      "''"
      PortCounts	      "[]"
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      PermitHierarchicalResolution "All"
      SystemSampleTime	      "-1"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      Sum
      IconShape		      "rectangular"
      Inputs		      "++"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Courier New"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Courier New"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "sldemo_adc_quantize"
    Location		    [120, 128, 797, 655]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    186
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Find edges of \nbit transitions in time"
      Ports		      [1, 1]
      Position		      [420, 305, 465, 335]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"Find edges of \nbit transitions in time"
	Location		[712, 313, 1132, 451]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "v"
	  Position		  [45, 66, 80, 84]
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  HitCross
	  Name			  "Hit \nCrossing"
	  Ports			  [1, 1]
	  Position		  [450, 60, 480, 90]
	  HitCrossingDirection	  "either"
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1]
	  Position		  [380, 65, 400, 85]
	  ShowName		  off
	  IconShape		  "round"
	  Inputs		  "|+-"
	  InputSameDT		  off
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Bias
	  Name			  "setround"
	  Position		  [165, 62, 210, 88]
	  Bias			  "0.5"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Rounding
	  Name			  "transition"
	  Position		  [280, 62, 320, 88]
	}
	Block {
	  BlockType		  Outport
	  Name			  "hits"
	  Position		  [540, 68, 570, 82]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "Sum"
	  SrcPort		  1
	  DstBlock		  "Hit \nCrossing"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "setround"
	  SrcPort		  1
	  DstBlock		  "transition"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "transition"
	  SrcPort		  1
	  DstBlock		  "Sum"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Hit \nCrossing"
	  SrcPort		  1
	  DstBlock		  "hits"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "v"
	  SrcPort		  1
	  Points		  [0, 0; 30, 0]
	  Branch {
	    Points		    [10, 0]
	    DstBlock		    "setround"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 60; 275, 0]
	    DstBlock		    "Sum"
	    DstPort		    2
	  }
	}
      }
    }
    Block {
      BlockType		      Reference
      Name		      "Idealized ADC quantizer"
      Ports		      [1, 1]
      Position		      [245, 105, 305, 155]
      AttributesFormatString  "(settings: %<NumberOfConverterBits>-bit convert"
"er\\nVmin: %<Vmin>, Vmax: %<Vmax>)"
      SourceBlock	      "simulink_extras/Additional\nDiscrete/Idealized "
"ADC quantizer"
      SourceType	      "IdealADC"
      ShowPortLabels	      on
      NumberOfConverterBits   "12"
      Vmin		      "0"
      Vmax		      "5"
      OutputDataType	      "int16"
      OutputNegativeValues    off
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info"
      Ports		      []
      Position		      [15, 15, 39, 38]
      DropShadow	      on
      ShowName		      off
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      MaskDisplay	      "disp('?')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"More Info"
	Location		[74, 70, 720, 494]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Reference
	  Name			  "Model Info"
	  Ports			  []
	  Position		  [15, 19, 610, 408]
	  ShowName		  off
	  FontName		  "Arial"
	  SourceBlock		  "simulink/Model-Wide\nUtilities/Model Info"
	  SourceType		  "CMBlock"
	  ShowPortLabels	  "on"
	  InitialBlockCM	  "None"
	  BlockCM		  "None"
	  Frame			  "on"
	  DisplayStringWithTags	  "Model Description:\n-------------------\n\n"
"%<Description>"
	  MaskDisplayString	  "Model Description:\\n-------------------\\n"
"\\nAnalog-to-Digital Converter Quantization Algorithm\\n\\nThe quantization a"
"lgorithm in the model takes in a 0 to 5 volt signal and outputs \\na 12-bit d"
"igital word in a 16-bit signed integer. A value of 0 corresponds to 0 Volts "
"\\nand a value of 4096 would correspond to 5 Volts. A change in the least \\n"
"significant bit (LSB) is about 1.2 mV. As 12 bits can only reach the value of"
" \\n4095, the highest voltage that can be read by this device is approximatel"
"y \\n4.9988 Volts. In order to have no more than 1/2 LSB error, the quantizer"
" changes \\nvalues midway between each voltage point, resulting in a 1/2-widt"
"h interval at \\n0 Volts and a 3/2-width interval just below 5 Volts.\\n"
	  HorizontalTextAlignment "Left"
	  LeftAlignmentValue	  "0.02"
	  SourceBlockDiagram	  "sldemo_adc_quantize"
	  TagMaxNumber		  "20"
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Rescale volts to\nmatch ADC signal"
      Ports		      [1, 1]
      Position		      [245, 247, 305, 283]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"Rescale volts to\nmatch ADC signal"
	Location		[722, 289, 1062, 387]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "V"
	  Position		  [65, 83, 95, 97]
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  Bias
	  Name			  "Bias"
	  Position		  [170, 75, 225, 105]
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Gain
	  Name			  "Re-Scale"
	  Position		  [290, 67, 355, 113]
	  Gain			  "4096/5"
	  ParameterDataTypeMode	  "Inherit via internal rule"
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Outport
	  Name			  "bit_units"
	  Position		  [500, 83, 530, 97]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "Bias"
	  SrcPort		  1
	  DstBlock		  "Re-Scale"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "V"
	  SrcPort		  1
	  DstBlock		  "Bias"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Re-Scale"
	  SrcPort		  1
	  DstBlock		  "bit_units"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Reference
      Name		      "Sweep Across\nVoltage Range\n(Reference signal)"
      Ports		      [0, 1]
      Position		      [75, 115, 120, 145]
      SourceBlock	      "simulink/Sources/Repeating\nSequence"
      SourceType	      "Repeating table"
      ShowPortLabels	      on
      rep_seq_t		      "[0 7000]"
      rep_seq_y		      "[-0.25, 7]"
      Port {
	PortNumber		1
	Name			"V"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
	ShowSigGenPortName	on
      }
    }
    Block {
      BlockType		      Outport
      Name		      "E_volts_in_bit_units"
      Position		      [575, 258, 605, 272]
      IconDisplay	      "Port number"
      BusOutputAsStruct	      off
    }
    Block {
      BlockType		      Outport
      Name		      "E_bit_units"
      Position		      [575, 123, 605, 137]
      Port		      "2"
      IconDisplay	      "Port number"
      BusOutputAsStruct	      off
    }
    Block {
      BlockType		      Outport
      Name		      "bit_edges"
      Position		      [575, 313, 605, 327]
      Port		      "3"
      IconDisplay	      "Port number"
      BusOutputAsStruct	      off
    }
    Line {
      Name		      "V"
      Labels		      [0, 0]
      SrcBlock		      "Sweep Across\nVoltage Range\n(Reference signal)"
      SrcPort		      1
      Points		      [60, 0]
      Branch {
	Points			[0, 135]
	DstBlock		"Rescale volts to\nmatch ADC signal"
	DstPort			1
      }
      Branch {
	DstBlock		"Idealized ADC quantizer"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Idealized ADC quantizer"
      SrcPort		      1
      DstBlock		      "E_bit_units"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Rescale volts to\nmatch ADC signal"
      SrcPort		      1
      Points		      [0, 0; 60, 0]
      Branch {
	DstBlock		"E_volts_in_bit_units"
	DstPort			1
      }
      Branch {
	Points			[0, 55]
	DstBlock		"Find edges of \nbit transitions in time"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Find edges of \nbit transitions in time"
      SrcPort		      1
      DstBlock		      "bit_edges"
      DstPort		      1
    }
    Annotation {
      Name		      "Analog to Digital Converter (ADC)\nquanization "
"algorithm\n(zero conversion time)"
      Position		      [279, 54]
      FontName		      "Arial"
      FontSize		      16
      FontWeight	      "bold"
    }
    Annotation {
      Name		      "The blocks driving outports 1 and 3 convert the"
" \ncontinuous reference signal into equivalent \"bit units\" \nto capture bit"
" transitions in time so the plot \nshows the transitions clearly.\n\n\n"
      Position		      [389, 439]
      ForegroundColor	      "blue"
      FontName		      "Arial"
      FontSize		      16
      FontWeight	      "bold"
    }
    Annotation {
      Name		      "Run the simulation.\nVisualize quantization eff"
"ects \nwith the plot created after the run."
      Position		      [479, 194]
      ForegroundColor	      "blue"
      FontName		      "Arial"
      FontSize		      16
      FontWeight	      "bold"
    }
  }
}

# Finite State Machines
#
#    Stateflow Version 6.2 (R14SP2) dated Jan 21 2005, 03:46:19
#
#

Stateflow {

	machine {
		id                   		1
		name                 		"sldemo_adc_quantize"
		created              		"13-Mar-2004 07:06:42"
		isLibrary            		0
		firstTarget          		2
		sfVersion            		62014000
		sfDemoChecksum       		[3672735947 3125208993 1359995613 3788578574]
	}

	target {
		id                        		2
		name                      		"sfun"
		description               		"Default Simulink S-Function Target."
		machine                   		1
		linkNode                  		[1 0 3]
	}

	target {
		id                        		3
		name                      		"rtw"
		codeFlags                 		" comments=1 statebitsets=1 databitsets=1 emitlogicalops=1 el"
						"seifdetection=1 constantfolding=1 redundantloadelimination=0"
						" preserveconstantnames=0 preservenames=0 preservenameswithpa"
						"rent=0 exportcharts=0"
		machine                   		1
		linkNode                  		[1 2 0]
	}
}
