1. Convert 0b00110011 to Decimal

numerical value of position1286432168421
Bits00110011

Ans → 51

2. Convert 0o7654 to Hexadecimal

Step 1: Convert to binary

Octal (0o)7654
Binary (0b)111110101100

Step 2: Regroup into fours, starting from the least significant bit

From this → 111 110 101 100

To this → {111 1} {10 10} {1 100}

Step 3: Convert to Hexadecimal

Binary (0b)111110101100
Hex (0x)FAC

Ans → 0xFAC

3. Convert -5 to 2’s Complement. Express the answer as an 8 bit binary

5 expressed as an 8-bit binary → 0b00000101

Now, we convert it to -5 expressed as a 2’s Complement binary:

  1. Invert: 0b00000101 → 0b11111010
  2. Add 1: 0b11111010 + 1 = 0b11111011
  3. Yuhhhhhh

4. Convert 0x8F00 to Decimal

Step 1: Break into Binary

Hex (0x)8F00
Binary (0b)1000111100000000

Step 2: Count! just like in qn 1!

You should b able to get this:

BUT WAITTT, there’s a trick for this. Getting “32,768” should be fairly straight forward (u should have this memorised). But the addition of the rest is very tedious. So, what you could do instead, is:

Original Binary (0b)1000111100000000
“Added” Binary0000000100000000
“Rounded Up” Binary1001000000000000
So, we’ve added another binary number to the equation to round up the original number.

This is rounded up binary is MUCH easier to calculate!

But we have to remove our rounding errors… We added 0b 0001 0000 0000 to round up our original binary, so we have to subtract it from !

So the full equation is →

Multiplication Method

Hex (0x)8F00
Decimal Value00000000

ANS →

This might b faster since ya’ll are allowed scrap paper to do multiplication! Whichever floats ur boat

5. Solve NOT((7 OR 5) XOR 10)

Also can be expressed as → ~((7 | 5)^10)

Step 1: Convert to binary

~((0b111 | 0b101) ^ 0b1010)

Step 2: solve inner statement (0b111 | 0b101)

Bitwise OR
0b111 →111
0b101 →101
Output111

(0b111 | 0b101) = 0b111

Step 3: solve remaining statement ~(0b111 ^ 0b1010)

Bitwise XOR
0b111 →0111
0b1010 →1010
Output1101

~(0b111 ^ 0b1010) = ~0b1101

= 0b0010

= 2 ← ANS