summaryrefslogtreecommitdiff
path: root/js/IntegerOp/BITSET.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-19 23:23:04 +0530
committerSunil Shetye2018-06-21 18:33:20 +0530
commit8cf65fe92b28b8809abcb0eb59f951d26f30792f (patch)
treed9509c35b6a4c3096d4be449935f88af5568276a /js/IntegerOp/BITSET.js
parent3f563b9e29d42266d6680229da5c29f847804834 (diff)
downloadsci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.gz
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.bz2
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.zip
distinguish between functions and arrays
maintain a list of functions
Diffstat (limited to 'js/IntegerOp/BITSET.js')
-rw-r--r--js/IntegerOp/BITSET.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js
index e3318fbe..c530967f 100644
--- a/js/IntegerOp/BITSET.js
+++ b/js/IntegerOp/BITSET.js
@@ -9,7 +9,7 @@ model.out=1;
model.out2=1;
model.intyp=3;
model.outtyp=3;
-model.opar=list(uint32(0));
+model.opar=list(uint32[0-1]);
model.blocktype="c";
model.dep_ut=[true,false];
exprs=[[sci2exp(3)],[sci2exp(0)]];
@@ -31,7 +31,7 @@ if (!ok) {
break;
}
in1=[model.in1,model.in2];
-if (floor(bit)!=bit) {
+if (floor[bit-1]!=bit) {
block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter: %5.1f."),gettext("Index of Bit"),bit),gettext("Must be integer."));
ok=false;
}
@@ -40,27 +40,27 @@ if (bit>31||bit<0) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 31]"));
ok=false;
}
-bit=uint32(bit);
+bit=uint32[bit-1];
n=2^bit;
-n=uint32(n);
+n=uint32[n-1];
model.sim=list("bit_set_32",4);
} else if ((Datatype==4)||(Datatype==7)) {
if (bit>15||bit<0) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 15]"));
ok=false;
}
-bit=uint16(bit);
+bit=uint16[bit-1];
n=2^bit;
-n=uint16(n);
+n=uint16[n-1];
model.sim=list("bit_set_16",4);
} else if ((Datatype==5)||(Datatype==8)) {
if (bit>7||bit<0) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 7]"));
ok=false;
}
-bit=uint8(bit);
+bit=uint8[bit-1];
n=2^bit;
-n=uint8(n);
+n=uint8[n-1];
model.sim=list("bit_set_8",4);
} else {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));