Cyber Command: Help double check the work of some new recruits by doing some binary math. Provide your answer in base 10.
Q1 (10 pts) - 0xC6 | 0x2F
239
Q2 (10 pts) - 0xB8 & 0xB8
184
Q3 (10 pts) - 0x9 ^ 0xF4
253
Q4 (10 pts) - 0xA6 » 1
83
Q5 (10 pts) - 0x1F « 2
124
Had no clue what this was at first. Looked up how binary/hex operations work.
Q1 — OR operation (|)
0xC6 = 11000110, 0x2F = 00101111. OR combines them: 11101111 = 239
Q2 — AND operation (&)
0xB8 & 0xB8 — since both operands are identical, every bit is the same so AND returns the same value. 0xB8 = 184
Q3 — XOR operation (^)
0x09 = 00001001, 0xF4 = 11110100. XOR outputs 1 when bits differ: 11111101 = 253
Q4 — Right Shift (>>)
0xA6 = 10100110. Shift all bits one place right (divide by 2, drop remainder): 01010011 = 83
Q5 — Left Shift (<<)
0x1F = 00011111. Shift all bits two places left (multiply by 4): 01111100 = 124