...
Code Block |
---|
1. esimerkki, a = 255 & 15 = 1111 1111b11111111b & 0000 1111b00001111b = 0000 1111b00001111b = 15 = 0xE = 017 2. esimerkki, a = 255 & 1 = 1111 1111b11111111b & 0000 0001b00000001b = 000000000001b 0001b = 1 = 0x1 = 01 3. esimerkki, a = 2 & 1 = 000000000010b 0010b & 0000 0001b00000001b = 0000 0000b00000000b = 0 = 0x1 = 00 4. esimerkki, a = 3 & 1 = 000000000011b 0011b & 000000000001b 0001b = 0000 0001b00000001b = 1 5. esimerkki, a = 3 & 2 = 0000 0011b00000011b & 0000 0010b00000010b = 0000 0010b00000010b = 2 |
TAI , OR, operaattori |
1. esimerkki, a = 0 | 1 = 0000 0000b | 0000 0001b = 0000 0001b = 1
2. esimerkki, a = 2 | 1 = 0000 0010b | 0000 0001b = 0000 0011b = 3
3. esimerkki, a = 4 | 8 = 0000 0100b | 0000 1000b = 0000 1100b = 12 =0 xC = 014
4. esimerkki, a = 4 | 12 = 0000 0100b | 0000 1100b = 0000 1100b = 12
...