Anno 2021 – 12
Considera la seguente operazione:
(x ^ (62 & 31)) | 12
Dove ^, & e | sono rispettivamente le operazioni di xor, and e or bit a bit.
Quali dei seguenti numeri devo sostituire a x per ottenere come risultato 29?
15 | 16 | 6 | 4
SOLUZIONE
Il risultato atteso è 29 = 011101
Risolvi l’equazione
(x ^ (111110 & 011111)) | 001100
= 011101
(x ^ 011110) | 001100
= 011101
z | 001100
= 011101
z = 01..01
Risolvi l’equazione
x ^ 011110 = 01..01
x = 00..11
x = 000011 (3)
x = 000111 (7)
x = 001011 (11)
x = 001111 (15)