⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hamming.mdl

📁 汉明码的仿真实现以及调试
💻 MDL
📖 第 1 页 / 共 2 页
字号:
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      CombinatorialLogic
      TruthTable	      "[0 0;0 1;0 1;1 0;0 1;1 0;1 0;1 1]"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Constant
      Value		      "1"
      VectorParams1D	      on
      OutDataTypeMode	      "Inherit from 'Constant value'"
      OutDataType	      "sfix(16)"
      ConRadixGroup	      "Use specified scaling"
      OutScaling	      "2^0"
      SampleTime	      "inf"
    }
    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		      Demux
      Outputs		      "4"
      DisplayOption	      "none"
      BusSelectionMode	      off
    }
    Block {
      BlockType		      FrameConversion
      OutFrame		      "Frame based"
    }
    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		      Inport
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      Interpolate	      on
    }
    Block {
      BlockType		      Logic
      Operator		      "AND"
      Inputs		      "2"
      AllPortsSameDT	      on
      OutDataTypeMode	      "Logical (see Configuration Parameters: Optimiza"
"tion)"
      LogicDataType	      "uint(8)"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Math
      Operator		      "exp"
      OutputSignalType	      "auto"
      SampleTime	      "-1"
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
      BusObject		      "BusObject"
      NonVirtualBus	      off
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      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		      RelationalOperator
      Operator		      ">="
      InputSameDT	      on
      LogicOutDataTypeMode    "Logical (see Configuration Parameters: Optimiza"
"tion)"
      LogicDataType	      "uint(8)"
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Scope
      Floating		      off
      ModelBased	      off
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      Grid		      "on"
      TimeRange		      "auto"
      YMin		      "-5"
      YMax		      "5"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      LimitDataPoints	      on
      MaxDataPoints	      "5000"
      Decimation	      "1"
      SampleInput	      off
      SampleTime	      "0"
    }
    Block {
      BlockType		      Selector
      InputType		      "Vector"
      IndexMode		      "One-based"
      ElementSrc	      "Internal"
      Elements		      "1"
      RowSrc		      "Internal"
      Rows		      "1"
      ColumnSrc		      "Internal"
      Columns		      "1"
      InputPortWidth	      "-1"
      IndexIsStartValue	      off
      OutputPortSize	      "1"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      PortCounts	      "[]"
      SFunctionModules	      "''"
    }
    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"
    }
    Block {
      BlockType		      Terminator
    }
    Block {
      BlockType		      ToWorkspace
      VariableName	      "simulink_output"
      MaxDataPoints	      "1000"
      Decimation	      "1"
      SampleTime	      "0"
      FixptAsFi		      off
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "Hamming"
    Location		    [2, 70, 1022, 717]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "A4"
    PaperUnits		    "centimeters"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      Reference
      Name		      "Bernoulli Binary\nGenerator1"
      Ports		      [0, 1]
      Position		      [100, 273, 180, 317]
      FontName		      "Arial"
      SourceBlock	      "commrandsrc2/Bernoulli Binary\nGenerator"
      SourceType	      "Bernoulli Binary Generator"
      ShowPortLabels	      on
      P			      "0.5"
      seed		      "14523"
      Ts		      "1"
      frameBased	      on
      sampPerFrame	      "4"
      orient		      off
    }
    Block {
      BlockType		      Reference
      Name		      "Binary Symmetric\nChannel1"
      Ports		      [1, 1]
      Position		      [390, 274, 470, 316]
      SourceBlock	      "commchan2/Binary Symmetric\nChannel"
      SourceType	      "Binary Symmetric Channel"
      ShowPortLabels	      on
      P			      "0.05"
      s			      "14523"
      E			      off
    }
    Block {
      BlockType		      Demux
      Name		      "Demux1"
      Ports		      [1, 3]
      Position		      [390, 141, 395, 179]
      BackgroundColor	      "black"
      ShowName		      off
      Outputs		      "3"
      DisplayOption	      "bar"
    }
    Block {
      BlockType		      Reference
      Name		      "Error Rate\nCalculation1"
      Ports		      [2, 1]
      Position		      [260, 132, 335, 183]
      SourceBlock	      "commsink2/Error Rate\nCalculation"
      SourceType	      "Error Rate Calculation"
      N			      "0"
      st_delay		      "0"
      cp_mode		      "Entire frame"
      subframe		      "[]"
      PMode		      "Port"
      WsName		      "ErrorVec"
      RsMode2		      off
      stop		      off
      numErr		      "100"
      maxBits		      "1e6"
    }
    Block {
      BlockType		      Reference
      Name		      "Hamming Decoder1"
      Ports		      [1, 1]
      Position		      [550, 273, 630, 317]
      SourceBlock	      "commblkcod2/Hamming Decoder"
      SourceType	      "Hamming Decoder"
      ShowPortLabels	      on
      n			      "7"
      k			      "gfprimfd(3,'min')"
    }
    Block {
      BlockType		      Reference
      Name		      "Hamming Encoder1"
      Ports		      [1, 1]
      Position		      [245, 273, 325, 317]
      SourceBlock	      "commblkcod2/Hamming Encoder"
      SourceType	      "Hamming Encoder"
      ShowPortLabels	      on
      n			      "7"
      k			      "gfprimfd(3,'min')"
    }
    Block {
      BlockType		      Mux
      Name		      "Mux1"
      Ports		      [3, 1]
      Position		      [465, 141, 470, 179]
      ShowName		      off
      Inputs		      "3"
      DisplayOption	      "bar"
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [1]
      Position		      [545, 144, 575, 176]
      Location		      [196, 389, 520, 628]
      Open		      off
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace1"
      Position		      [430, 60, 490, 90]
      VariableName	      "simout"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Structure"
    }
    Line {
      SrcBlock		      "Bernoulli Binary\nGenerator1"
      SrcPort		      1
      Points		      [20, 0]
      Branch {
	DstBlock		"Hamming Encoder1"
	DstPort			1
      }
      Branch {
	Points			[0, -150]
	DstBlock		"Error Rate\nCalculation1"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Hamming Encoder1"
      SrcPort		      1
      DstBlock		      "Binary Symmetric\nChannel1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Binary Symmetric\nChannel1"
      SrcPort		      1
      DstBlock		      "Hamming Decoder1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Error Rate\nCalculation1"
      SrcPort		      1
      DstBlock		      "Demux1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Demux1"
      SrcPort		      1
      Points		      [0, 0; 15, 0]
      Branch {
	DstBlock		"Mux1"
	DstPort			1
      }
      Branch {
	DstBlock		"To Workspace1"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Demux1"
      SrcPort		      2
      DstBlock		      "Mux1"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Demux1"
      SrcPort		      3
      DstBlock		      "Mux1"
      DstPort		      3
    }
    Line {
      SrcBlock		      "Mux1"
      SrcPort		      1
      DstBlock		      "Scope"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Hamming Decoder1"
      SrcPort		      1
      Points		      [20, 0; 0, -60; -410, 0]
      DstBlock		      "Error Rate\nCalculation1"
      DstPort		      2
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -