From 199ca3ece1f8b82dcc29ed0d9873c358886cbf3b Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Tue, 17 Apr 2018 14:14:38 +0200 Subject: [PATCH] Praktikum 2: Testat --- 02_MENT/Testat/a.out | Bin 0 -> 19568 bytes 02_MENT/Testat/main_02_MENT.cpp | 49 +++++++-- 02_MENT/Testat2/a.out | Bin 0 -> 19576 bytes 02_MENT/Testat2/build.sh | 7 ++ 02_MENT/Testat2/main_02_MENT.cpp | 51 ++++++++++ 02_MENT/a.out | Bin 0 -> 31640 bytes 02_MENT/limits.out | Bin 0 -> 27728 bytes 02_MENT/main_02_MENT.cpp | 42 +++++--- 02_MENT/main_02_MENT.cpp.save | 164 +++++++++++++++++++++++++++++++ 02_MENT/println.out | Bin 0 -> 20336 bytes 10 files changed, 291 insertions(+), 22 deletions(-) create mode 100755 02_MENT/Testat/a.out create mode 100755 02_MENT/Testat2/a.out create mode 100755 02_MENT/Testat2/build.sh create mode 100644 02_MENT/Testat2/main_02_MENT.cpp create mode 100755 02_MENT/a.out create mode 100755 02_MENT/limits.out create mode 100644 02_MENT/main_02_MENT.cpp.save create mode 100755 02_MENT/println.out diff --git a/02_MENT/Testat/a.out b/02_MENT/Testat/a.out new file mode 100755 index 0000000000000000000000000000000000000000..6eb0bf47ec370a83315ce6ad1c9da8d1fa48e598 GIT binary patch literal 19568 zcmeHPe{ft!eP2obAt#EY{D7$Wc>$Z+4L;w=vaR6KoNS%*lQ2(UKxs@OsEPXd zes}lXyI&Mcr+;~8-hKD`bHDrDefxG-yZTtTaa(awk~hC07Et1W#?TB-9p%IHTcBl8h2$(jF3|^3o}! zvJ!rMr9?Fp!p8*CBVW(0WfZW3Ga4=^KYZjACm;V3ne^tB-n`P&P$)eOb^XW;J*|r0 zS{wpKc!+@VDh+k9&95aoDPQX&DT1L4c$zUGG}L;32|e=j_f3^baF;5tP+V3k|23pI zQd-y3y=P<1x}MIpJ>7jn!)u3YH?G}SK!F1V!gxH|UZC2x$Ryw8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4O)y#}%PnK`iUIo?5?3S=kDRrLU{6_bp3F0ZH%UOHA6(d4hN2 zp*?h6zTV#~!@QnSwFGXxwVa0S;M1PG#`QjENa>F&eR7BV)cz~7*oO?oRO{>g(ix?1 zC_x=}t*`6aE?@75>;I3W1EbqP+tYr{LYM0A>aXhnhI4FcV?)a^5kFdA!`DFb>bv{v0jV)5 zf%~iVH2eiPUVXg}GpY0om9Gt6K!$8-|7X?y=8V#(bCBNT^CHOq8V`vmahI$02VIKH zXmeiZ_C1fRK?6I|q7`)=i}}up_O?dI5F0l1qDC`SsV= b.length ? a : b; + PascalString shortString = a.length >= b.length ? b : a; + + + PascalString result = {longString.length}; + + /* + for(int i = longString.length; i >= 0; --i) { + if(i >= shortString.length) result.characters[i] = '0'; + else result.characters[i] = shortString.characters[i]; + } + */ + for(int i = 0; i < longString.length; i++) { + if(i <= shortString.length) { + result.characters[i] = longString.characters[i]; + //println("lang ", longString.characters[i]); + } + else{ + result.characters[i] = longString.characters[i] | shortString.characters[i]; + //println("beides ", shortString.characters[i] | longString.characters[i]); + } + } + return result; + +} + +int main(int argc, char** argv, char** envp) { + printPascalString(dualOr({2, '0', '1'}, {2, '1', '0'})); + printPascalString(dualOr({2, '0', '1'}, {3, '1', '1', '1'})); + printPascalString(dualOr({3, '1', '1', '1'}, {4, '1', '1', '0', '1'})); + printPascalString(dualOr({3, '0', '0', '0'}, {5, '1', '1', '0', '1', '0'})); + printPascalString(dualOr({3, '0', '1', '1'}, {6, '1', '1', '0', '1', '0', '1'})); + printPascalString(dualOr({2, '0', '1'}, {6, '1', '1', '0', '1', '0', '1'})); + printPascalString(dualOr({2, '1', '1'}, {6, '1', '0', '0', '1', '0', '0'})); + + return 0; +} diff --git a/02_MENT/Testat2/a.out b/02_MENT/Testat2/a.out new file mode 100755 index 0000000000000000000000000000000000000000..2060c680f908375191eefede8d1f53e7a65cc330 GIT binary patch literal 19576 zcmeHPeQ;b?b-$8qM@ei+`GBY)X*R?Gr-?VavTQ53G%H){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Cl-{4O1u;t7|D}azl3s|uTJ8azZ(aXaFzuJyzD(a{ktMP_FkMUlho*7BAyt+XWUWI z85@l4>5eC2ICR!)M|=AFVsU77_8XW+KM)ujUzQo`@v3oGm8?!rydV6`Y#)C;$azt%=>-PHQupQpkz%y|+4tLsNOB1bz z?ZR&Oz_$A4#x3Bn9~tG&T!K7Rmx)M@Od05 zgEiQxsZI22L-qsRi7q>Ha0{oi&d+MMJmU2GoR$iOoixT3QT8uz2nYBQV}?cSUfRkSEt#6aCwZb}1Xw-}3O9J~x=- z7>{wC*C9k6WGi5)H4*L4oWV0WU{`SrE!$O`Hp^}FcRNH^=$zkDUocOY<8axQWsr-W zW>km#3LH@VT@RTq^~QUXp6|`Xp#8q5RSS5Qy*qf=GeZk&Sx^=31K-+oyWoA{7$tdB7IASshleG$;^C(^KclW)SR@< zu_kXho0FD0kcmjbl|Ve&jmJy(?(QhYU*;$%Lbxl=*&U~=ZeA-qxSa8_7H3U&XV2c6`yS_5;m*<%zoC%ld@07!x?SCg2fE|2hM`E$ z-GjMfh)Kyg@d`im*;P&<=G<_;cbGW`3nn-l9X{7hwA86}&iL9;WLVrip0Bw zzjI$7lod=2DvsWX%Ry}Lu+0{sg02npB!r*q3gO4GVEoEH`v?2wBhw%2(yN!QPUsp8 zMseEMyN**f)Y?SZFm*H)>Ftg}r61PuW?z#ZUoZ{FZ$KQyHE$F)A)p`XToO%{7lVQh@P**Bfh`j!^V zkDuxPN45TDEob&utMwl=%-52C^@8vX45*-;WFjG%@lkB0pBsCf0wzH{JuB~i^m<0&S8 zhV&Iwy!vK;+FGq7o-l$M=C}V0=oPq3GiKk<{2w2aCu7F6Z{WAUsPyQY{cd-y(lBzx z^nVBj$DV25?2DWKlVk#`Z|BVTHGa)Pm;KM^-`W8T->2z~4V`HYu^|=iwbQS|INP8jMnG(jo#w(BB;NKiy~S)!!`PY z8H%bHb6#l1u2 + +#include "../../helpers/println.hpp" + +struct PascalString{ + int length; // number of chars used + char characters[256]; // chars of some character string +}; + +void printPascalString(PascalString s) { + for(int i = 0; i <= s.length; ++i) { + print(s.characters[i]); + } + println(""); + +} + +PascalString bitwiseDualOr(PascalString a, PascalString b) { + PascalString shortString = a.length <= b.length ? a : b; + PascalString longString = a.length <= b.length ? b : a; + + PascalString result = {longString.length}; + + for(int i = 1; i <= shortString.length; ++i) { + result.characters[result.length -i] = longString.characters[longString.length -i] | shortString.characters[shortString.length -i]; + //println(result.length -i, ": ",result.characters[result.length -i]," l=",longString.length -i, ":",longString.characters[longString.length -i]," s=",shortString.length -i,":", shortString.characters[shortString.length -i]); + } + for(int i = (longString.length - shortString.length)-1; i >= 0 ; --i) { + result.characters[i] = longString.characters[i]; + //println(i, ": ", result.characters[i]); + } + + return result; +} + + +int main(int argc, char** argv, char** envp) { + + printPascalString(bitwiseDualOr({2, '0', '1'}, {2, '1', '0'})); + printPascalString(bitwiseDualOr({2, '0', '1'}, {3, '1', '1', '1'})); + printPascalString(bitwiseDualOr({3, '1', '1', '1'}, {4, '1', '1', '0', '1'})); + printPascalString(bitwiseDualOr({3, '0', '0', '0'}, {5, '1', '1', '0', '1', '0'})); + printPascalString(bitwiseDualOr({3, '0', '1', '1'}, {6, '1', '1', '0', '1', '0', '1'})); + printPascalString(bitwiseDualOr({2, '0', '1'}, {6, '1', '1', '0', '1', '0', '1'})); + printPascalString(bitwiseDualOr({2, '1', '1'}, {6, '1', '0', '0', '1', '0', '0'})); + + return 0; +} diff --git a/02_MENT/a.out b/02_MENT/a.out new file mode 100755 index 0000000000000000000000000000000000000000..0ba37c62ee60ac362ed21c85081f9ce5910ee06a GIT binary patch literal 31640 zcmeHwe|%h3weQIfph9WVQlR{jfQ8rcBg~{}n}S{@ZKg~lp`mHDA}~oO(n?GwJh67JY(Q>Ko3Y&+A$2xh{+Sf0IT2+gbE^FpC`a-y&S;;Z+ba)%O9Ed#N?s z8uJH)rA;$l3H?bQDN*#RfHT~z?HrgN5ZwH1)B5zL(bvO1bFBqd-OY89wNT4>PSpPnw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^iGq{wY^JuE6y{#E6osf<{ zC89|w9c~j$qS*B z{(nS*qLlulzu(iCGGy@c)lS`hZ(c}{dKIEvl=z*lO!#`pldeGtUp2Vx59ftY!tXK_ z|B!SR zs-Av7Dxvs8N-*nOgij{_7lGrPz}KK6>Gv#$@x2Pu0twu|dK@)kCo(3#e&1?L@r&R7 z>dJsP4i`zo`%yCa8`XJoqdMUJ?!}5h0nMkezn{Uc-`|?A4)WD7=<2Q=HDW;VYy0c> zyn>2fpV#a9+J3tHhZ+3(|IN|=pALUpZ>CK9{aFUTes65(O2w7YU`EmU%S`^2A;CDL zevy$>exRgf_5TnEG&ScYlYTEk|NlIh_SWrd_z&R0S2Qlae$Uq7uQ!l%Jy}YZHU1S4 zIQMk>`n@*&{~u|`(B05{TCWN4a{jpd>l#tQ_f+cyaOayWWw-wt2qwRNPuB`bj&aSX zpl)BoH-R_#_4kV7A<3ZiRP0&yH~|7>Y5nzkcTPxh@OR{93YrDve}fOJlxE;He^&-x zi!))y6crqem6EYvb%5*4CVX_ib^M`!xw=ah@ps~8S-4Vv!K7%qU0t;p89)B>T4as9 K42F!N_5T3JPNakY literal 0 HcmV?d00001 diff --git a/02_MENT/main_02_MENT.cpp b/02_MENT/main_02_MENT.cpp index 194f4a0..6ec3665 100644 --- a/02_MENT/main_02_MENT.cpp +++ b/02_MENT/main_02_MENT.cpp @@ -92,26 +92,30 @@ int getInt(char character) { } PascalString bitwiseDualAnd(PascalString a, PascalString b) { - PascalString result = {a.length, '0'}; + PascalString result = {b.length}; - for(int i = b.length; i >= 0; --i) { - if(a.length < i) result.characters[i] = a.characters[i]; - println("i: ", i, " ", intToHexChar(getInt(a.characters[i]) & getInt(b.characters[i]))); - result.characters[i] = intToHexChar(getInt(a.characters[i]) & getInt(b.characters[i])); + for(int i = 0; i <= b.length; ++i) { + result.characters[i] = a.characters[i] & b.characters[i]; } - return result; } -PascalString bitwiseHexAnd(PascalString a, PascalString b) { - PascalString result = {a.length, '0'}; +PascalString bitwiseOctalAnd(PascalString a, PascalString b) { + PascalString result = {b.length, '0'}; - for(int i = b.length; i >= 0; --i) { - if(a.length < i) result.characters[i] = a.characters[i]; - println("i: ", i, " ", a.characters[i] & b.characters[i]); + for(int i = 0; i <= b.length; ++i) { result.characters[i] = a.characters[i] & b.characters[i]; } + return result; +} + + +PascalString bitwiseHexAnd(PascalString a, PascalString b) { + a = intToDual(hexStringToInt(a)); + b = intToDual(hexStringToInt(b)); + PascalString result = bitwiseDualAnd(a, b); + return result; } @@ -124,7 +128,7 @@ println("==================================="); } int main(int argc, char** argv, char** envp) { - + PascalString s = {3, '1', '0', '0'}; PascalString s2 = {4, 'f', 'f', 'f', 'f'}; println(hexStringToInt(s)); @@ -159,13 +163,19 @@ int main(int argc, char** argv, char** envp) { printPascalString(intToHex(1956)); line(); - printPascalString(bitwiseDualAnd({3, '1', '1', '0'}, {4, '1', '1', '1', '0'})); + printPascalString(bitwiseDualAnd({3, '1', '1', '0'}, {3, '1', '1', '1'})); line(); - printPascalString(bitwiseDualAnd({3, '1', '1', '1'}, {4, '1', '1', '1', '0'})); + printPascalString(bitwiseDualAnd({3, '1', '1', '1'}, {3, '1', '1', '1'})); line(); - printPascalString(bitwiseDualAnd({3, '1', '1', '0'}, {4, '1', '1', '1', '1'})); + printPascalString(bitwiseDualAnd({3, '0', '1', '0'}, {3, '1', '0', '1'})); line(); - printPascalString(bitwiseDualAnd({3, '0', '1', '0'}, {4, '1', '0', '1', '1'})); + printPascalString(bitwiseDualAnd({3, '1', '0', '0'}, {3, '1', '1', '1'})); + line(); + printPascalString(bitwiseOctalAnd({2, '6', '3'}, {2, '1', '2'})); + + + line(); + printPascalString(bitwiseHexAnd({2, 'A', '1'}, {2, 'C', '2'})); return 0; } diff --git a/02_MENT/main_02_MENT.cpp.save b/02_MENT/main_02_MENT.cpp.save new file mode 100644 index 0000000..3a1f59d --- /dev/null +++ b/02_MENT/main_02_MENT.cpp.save @@ -0,0 +1,164 @@ +// file: main_02_MENT.cpp +// THIS IS C++, use clang++ + +#include + +#include "../helpers/println.hpp" + +struct PascalString{ + int length; // number of chars used + char characters[256]; // chars of some character string +}; + +char cStringArea[1024]; + +int hexDigitToInt(char hexDigit) { +int value = 0; + +if(hexDigit > 47 && hexDigit < 58) + value = hexDigit - 48; + +if(hexDigit > 96 && hexDigit < 103) + value = hexDigit - 97 + 10; + +return value; +} + +int hexStringToInt(PascalString binaryDigits) { + int returnValue = 0; + + for(int i = 0; i <= binaryDigits.length; ++i) { + returnValue += binaryDigits.characters[i]; + } + + return returnValue; +} + +void printPascalString(PascalString s) { + for(int i = 0; i <= s.length; i++) { + print(s.characters[i]); + } + println("" +); +} + +PascalString intToDual(int n) { + + int i = std::to_string(n).length() * 4; + PascalString string = {i}; + while(n >= 1) { + string.characters[i] = (n % 2) + '0'; + n = n / 2; + i--; + } + return string; +} + +char intToHexChar(int n) { + if(n > 9) { + switch(n) { + case 10: return 'A'; + case 11: return 'B'; + case 12: return 'C'; + case 13: return 'D'; + case 14: return 'E'; + case 15: return 'F'; + default: return 'X'; + } + } + else return n + '0'; +} + +PascalString intToHex(int n) { + int i = std::to_string(n).length(); + PascalString string = {i}; + while(n >= 1) { + string.characters[i] = intToHexChar(n % 16); + n = n / 16; + i--; + } + return string; + +} + +PascalString bitwiseDualAnd(PascalString a, PascalString b) { + PascalString shortString = a.length < b.length ? a : b; + PascalString longString = a.length > b.length ? a : b; + PascalString result = {longString.length, '0'}; + + for(int i = longString.length; i >= 0; --i) { + if(shortString.length < i) result.characters[i] = longString.characters[i]; + result.characters[i] = longString.characters[i] & shortString.characters[i]; + } + + return result; +} + +PascalString bitwiseHexAnd(PascalString a, PascalString b) { + PascalString shortString = a.length < b.length ? a : b; + PascalString longString = a.length > b.length ? a : b; + PascalString result = {longString.length, '0'}; + + for(int i = longString.length; i >= 0; --i) { + if(shortString.length < i) result.characters[i] = longString.characters[i]; + result.characters[i] = longString.characters[i] & shortString.characters[i]; + } + + return result; +} + +int to_c_string(PascalString s) { + +} + +void line() { +println("==================================="); +} + +int main(int argc, char** argv, char** envp) { + + PascalString s = {3, '1', '0', '0'}; + PascalString s2 = {4, 'f', 'f', 'f', 'f'}; + println(hexStringToInt(s)); + line(); + println(hexStringToInt(s2)); + line(); + println(hexDigitToInt('d')); + line(); + println(hexDigitToInt('9')); + line(); + println(hexDigitToInt('2')); + + printPascalString(s2); + line(); + + int controlRegister = 128; + controlRegister |= 64+32; + controlRegister ^=16; + controlRegister &= 128+64; + controlRegister <<= 1; + + println(controlRegister); + line(); + println(intToHexChar(6)); + line(); + println(intToHexChar(10)); + line(); + printPascalString(intToDual(4106)); + line(); + printPascalString(intToHex(965)); + line(); + printPascalString(intToHex(1956)); + + line(); + printPascalString(bitwiseDualAnd({3, '1', '1', '0'}, {4, '1', '1', '1', '0'})); + line(); + printPascalString(bitwiseDualAnd({3, '1', '1', '1'}, {4, '1', '1', '1', '0'})); + line(); + printPascalString(bitwiseDualAnd({3, '1', '1', '0'}, {4, '1', '1', '1', '1'})); + line(); + printPascalString(bitwiseDualAnd({3, '0', '1', '0'}, {4, '1', '0', '1', '1'})); + + return 0; +} + diff --git a/02_MENT/println.out b/02_MENT/println.out new file mode 100755 index 0000000000000000000000000000000000000000..9a4b5b83199c84dbad321ff3ef736123def6c475 GIT binary patch literal 20336 zcmeHPe{fvIeP8KhEMr?gY`}^`;KGl@4)*y@mTeJmc#?JI2_&Of7ID%z@6LB;>xy)z z=-wHbAR}T-`sProNhu+jOvg>q*3FcuCX=KJ#aP6y?Iv`hq$D^gohl44Pt=eD9HS(T z)z5d|?%m$II|iJ#e`z)EefRrgzx&@rXm;LISH94C!uT~ zsiA9!;P0r^fDx_{5LV@(thVcAGfMfo_i-^mjb|jRqJ|*lpo6lHqa4}!Zd08Q+%D=X z=a*H&ehEeOY+YY`_r|7mebKdj@kDxP?NIZ^wHup!sid!wx102n?Cslncumyb(p5wt z{0dwohk z=zmp4&xSJeWEuU}!j@9{zgdR<{WA7^xr}_MjQqo8?EGOF`Oz}^?=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