welcome@transmuton.space             TRANSMUTON             Programming Language

About Comments Range Syntax Detacher Merger Swaper Digipulation Comparons Logicons Bitwisons Conditons

Bitwisons


"Bitwisons" are functionalities used to perform BIT-BY-BIT (binary) operations on operands (vars, literals).


    ~&&~           ~<>~           ~><~                        ~>>~          ~<<~


   ~!&&~          ~!<>~          ~!><~          !~x




     andbit()       .andbit         ~&&~             ANDbit       a  ~&&~ b            a  ~&&~ b  ~&&~ c
    nandbit()       .nandbit       ~!&&~            NANDbit       a ~!&&~ b            a ~!&&~ b ~!&&~ c


      orbit()       .orbit          ~<>~              ORbit       a  ~<>~ b            a  ~<>~ b  ~<>~ c
     norbit()       .norbit        ~!<>~             NORbit       a ~!<>~ b            a ~!<>~ b ~!<>~ c


     xorbit()       .xorbit         ~><~             XORbit       a  ~><~ b            a  ~><~ b  ~><~ c
    nxorbit()       .nxorbit       ~!><~            NXORbit       a ~!><~ b            a ~!><~ b ~!><~ c


     notbit()       .notbit          !~a             NOTbit     !~a                 !~(a b c)


    righbit()       .righbit        ~>>~            RIGHbit       a  ~>>~ b            a ~>>~ b
     lefbit()       .lefbit         ~<<~             LEFbit       a  ~<<~ b            a ~<<~ b
          

Bitwisons: ANDbit, NANDbit, ORbit, NORbit, XORbit, NXORbit


vvvvv = 1_048_544    ==    0b11111111111111100000          #>   11111  11111  11111  00000
iiiii = 1_047_552    ==    0b11111111110000000000          #>   11111  11111  00000  00000
ooooo = 1_015_808    ==    0b11111000000000000000          #>   11111  00000  00000  00000



#<                                                         #<                                                         #<
  Bitwison "ANDbit":                                         Bitwison "ORbit":                                          Bitwison "XORbit":
                    return new VAL:                                            return new VAL:                                            return new VAL:
  - with "BITs 1" on corresponding places where              - with "BITs 1" on corresponding places where              - with "BITs 1" on corresponding places where
    ALL comparing BITs of operands are 1,                      ONE or MORE or ALL comparing BITs of operands              only ONE comparing BIT of operands must be 1,
  - and otherwise "BITs 0".                                    are 1,                                                   - and otherwise "BITs 0".
                                                             - and otherwise "BITs 0".
                                                  >#                                                         >#                                                         >#
====================================================       ====================================================       ====================================================

 andbit()                 andbit(vvvvv iiiii ooooo)         orbit()                   orbit(vvvvv iiiii ooooo)         xorbit()                 xorbit(vvvvv iiiii ooooo)
  .andbit                 .andbit vvvvv iiiii ooooo          .orbit                   .orbit vvvvv iiiii ooooo          .xorbit                 .xorbit vvvvv iiiii ooooo
     ~&&~             vvvvv  ~&&~ iiiii  ~&&~ ooooo            ~<>~              vvvvv  ~<>~ iiiii  ~<>~ ooooo             ~><~             vvvvv  ~><~ iiiii  ~><~ ooooo

====================================================       ====================================================       ====================================================

  ~&&~        ~&&~        ~&&~   ~&&~   ~&&~   ~&&~          ~<>~        ~<>~        ~<>~   ~<>~   ~<>~   ~<>~          ~><~        ~><~        ~><~   ~><~   ~><~   ~><~ 

 vvvvv     1_048_544     11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000
 iiiii     1_047_552     11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000 
 ooooo     1_015_808     11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000 

           1_015_808     11111  00000  00000  00000                   1_048_544     11111  11111  11111  00000                         990     00000  00000  11111  00000 

====================================================       ====================================================       ====================================================







#<                                                         #<                                                         #<
  Bitwison "NANDbit":                                        Bitwison "NORbit":                                          Bitwison "NXORbit":
                     return new VAL:                                           return new VAL:                                              return new VAL:
  - with "BITs 1" on corresponding places where              - with "BITs 1" on corresponding places where              - with "BITs 1" on corresponding places where
    ALL comparing BITs of operands are 0,                      ONE or MORE or ALL comparing BITs of operands              only ONE comparing BIT of operands must be 0,
  - and otherwise "BITs 0".                                    are 0,                                                   - and otherwise "BITs 0".
                                                             - and otherwise "BITs 0".
                                                  >#                                                         >#                                                         >#
====================================================       ====================================================       ====================================================

 nandbit()               nandbit(vvvvv iiiii ooooo)         norbit()                 norbit(vvvvv iiiii ooooo)         nxorbit()               nxorbit(vvvvv iiiii ooooo)
  .nandbit               .nandbit vvvvv iiiii ooooo          .norbit                 .norbit vvvvv iiiii ooooo          .nxorbit               .nxorbit vvvvv iiiii ooooo
     ~!&&~            vvvvv ~!&&~ iiiii ~!&&~ ooooo            ~!<>~             vvvvv ~!<>~ iiiii ~!<>~ ooooo             ~!><~            vvvvv ~!><~ iiiii ~!><~ ooooo

====================================================       ====================================================       ====================================================

 ~!&&~       ~!&&~       ~!&&~  ~!&&~  ~!&&~  ~!&&~         ~!<>~       ~!<>~       ~!<>~  ~!<>~  ~!<>~  ~!<>~         ~!><~       ~!><~       ~!><~  ~!><~  ~!><~  ~!><~ 

 vvvvv     1_048_544     11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000
 iiiii     1_047_552     11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000 
 ooooo     1_015_808     11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000 

                  31     00000  00000  00000  11111                      32_767     00000  11111  11111  11111                      31_744     00000  11111  00000  00000 

====================================================       ====================================================       ====================================================

          

Bitwisons: LEFbit, RIGHbit, NOTbit


vvvvv = 1_048_544    ==    0b11111111111111100000          #>   11111  11111  11111  00000
iiiii = 1_047_552    ==    0b11111111110000000000          #>   11111  11111  00000  00000
ooooo = 1_015_808    ==    0b11111000000000000000          #>   11111  00000  00000  00000

ppppp = 2



#<                                                         #<                                                         #<
  Bitwison "LEFbit":                                         Bitwison "RIGHTbit":                                       Bitwison "NOTbit":
                    return new VAL:                                              return new VAL:                                          return new VAL:
  - with MOVING (shifting) the left operand BITs             - with MOVING (shifting) the left operand BITs             - with opposite BITs of operand/s.
    to the "LEFT" with ZEROS,                                  to the "RIGHT" with ZEROS,
    for the number of times of RIGHT operand val.              for the number of times of RIGHT operand val.
                                                  >#                                                         >#                                                         >#
====================================================       ====================================================       ====================================================

                                                                                                                       notbit()                 notbit(vvvvv iiiii ooooo)
 lefbit()                       lefbit(vvvvv ppppp)         righbit()                     righbit(vvvvv ppppp)                                              notbit(vvvvv)
                                lefbit(iiiii ppppp)                                       righbit(iiiii ppppp)                                              notbit(iiiii)
                                lefbit(ooooo ppppp)                                       righbit(ooooo ppppp)                                              notbit(ooooo)
                                                                                                              
                                                                                                                        .notbit                 .notbit vvvvv iiiii ooooo
  .lefbit                       .lefbit vvvvv ppppp          .righbit                     .righbit vvvvv ppppp                                              .notbit vvvvv
                                .lefbit iiiii ppppp                                       .righbit iiiii ppppp                                              .notbit iiiii
                                .lefbit ooooo ppppp                                       .righbit ooooo ppppp                                              .notbit ooooo

                                                                                                                             !~                     !~(vvvvv iiiii ooooo)
     ~<<~                          vvvvv ~<<~ ppppp              ~>>~                         vvvvv ~>>~ ppppp                                                    !~vvvvv
                                   iiiii ~<<~ ppppp                                           iiiii ~>>~ ppppp                                                    !~iiiii
                                   ooooo ~<<~ ppppp                                           ooooo ~>>~ ppppp                                                    !~ooooo

====================================================       ====================================================       ====================================================

  ~<<~     ~<<~            ~<<~   ~<<~   ~<<~   ~<<~          ~>>~        ~>>~        ~>>~   ~>>~   ~>>~   ~>>~          !~          !~          !~     !~     !~     !~ 

 vvvvv  1_048_544         11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000         vvvvv     1_048_544     11111  11111  11111  00000
 ppppp          2                                            ppppp             2                                        

        4_194_300  00011  11111  11111  11100  00000                     262_136     00111  11111  11111  11000                          31     00000  00000  00000  11111 

 --------------------------------------------------         --------------------------------------------------         --------------------------------------------------

 iiiii  1_047_552         11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000         iiiii     1_047_552     11111  11111  00000  00000 
 ppppp          2                                            ppppp             2                                        

        4_190_208  00011  11111  11100  00000  00000                     261_888     00111  11111  11000  00000                       1_023     00000  00000  11111  11111 

 --------------------------------------------------         --------------------------------------------------         --------------------------------------------------

 ooooo  1_015_808         11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000         ooooo     1_015_808     11111  00000  00000  00000 
 ppppp          2                                            ppppp             2                                        

        4_063_232  00011  11100  00000  00000  00000                     253_952     00111  11000  00000  00000                      32_767     00000  11111  11111  11111 

====================================================       ====================================================       ====================================================