rssymbolmul.m

来自「该程序是RS编译码器的MATLAB仿真程序」· M 代码 · 共 28 行

M
28
字号
%*************************************************************************
%   Copyright (C) 2008 Circuit and System Lab of PKU
%
%   Created     :   2008-5
%   Author      :   houdong(houdong@pku.edu.cn)
%
%   File Name   :   RsSymboMul.m
%
%   Abstract    :  realize Product = LOperand * ROperand  in the GF(2^4)
%                   
%   Version     :   1.0     2008-5   All Right Reserved.
%*************************************************************************

function [Product]=RsSymbolMul(LOperand,ROperand)

T=[1,2,4,8,3,6,12,11,5,10,7,14,15,13,9];            %create a table for GF(2^4)
if LOperand*ROperand==0                             % if 'LOperand' or 'ROperand' is 0, output 'Product' is 0
    Product=0;
% by check the table, represent the decimal numbers as powers of primitive root
% so multiplication turn to addition of the power of primitive root
% then check the table again to get the result of multiplication as a
% decimal number
else 
     a1=find(T==LOperand)-1;
     b1=find(T==ROperand)-1;
     c=mod((a1+b1),15);
     Product=T(c+1);
end

⌨️ 快捷键说明

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