Name: __________________________

PRACTICE QUIZ – BOOLEAN LOGIC REVIEW & BITWISE OPERATIONS

SOLUTIONS

 

 

 

QUESTION 1

What is the circuit diagram symbol for NOR?


              

QUESTION 2
What is the truth table for the XOR gate?

A

B

Q

0

0

0

0

1

1

1

0

1

1

1

0

 

QUESTION 3
Draw the circuit diagram for (A AND B) OR C = Q.

              

QUESTION 4

Give the truth table for NOT(A XOR B) = Q.

A

B

A XOR B

Q

0

0

0

1

0

1

1

0

1

0

1

0

1

1

0

1

 

Note: One could easily skip the third column in the truth table above.

 

QUESTION 5

Are the following two circuits equivalent?  Show some work.

 

               NOT(A OR B) = Q

               NOT(A) AND NOT(B) = Q

 

               We create the truth table for each circuit.

 

A

B

A OR B

Q

0

0

0

1

0

1

1

0

1

0

1

0

1

1

1

0

 

A

B

NOT(A)

NOT(B)

Q

0

0

1

1

1

0

1

1

0

0

1

0

0

1

0

1

1

0

0

0

 

               The Q column for both truth tables are identical.  Therefore, the two circuits are equivalent.

 

QUESTION 6

Apply a Bitwise AND to 1011 1000 and 1101 0011.

               1011 1000

AND       1101 0011

               1001 0000

 

QUESTION 7

Apply a Bitwise NOT to 1001 0010.

 

NOT       1001 0010

               0110 1101

 

QUESTION 8

Evaluate 73 >> 2 using logical shifting.

 

STEP 1

We convert 73 to binary.

0100 1001

 

STEP 2

We now shift right by two.

0001 0010

 

STEP 3

We now convert back to decimal.

16+2 = 18

 

QUESTION 9

Evaluate -34 >> 2 using arithmetic shifting

 

STEP 1

We convert 34 to binary.

0010 0010

 

STEP 2

We apply 1’s complement.

1101 1101

 

STEP 3

We apply 2’s complement.

1101 1110

 

STEP 4

We apply the shift.

1111 0111

 

STEP 5

We undo 2’s complement.

1111 0110

 

STEP 6

We undo 1’s complement.

0000 1001

 

STEP 7

We convert to decimal

8+1 = 9

 

Therefore, the answer is -9.

 

QUESTION 10

Evaluate 17 >> 3 using circular shifting. 

 

STEP 1

We convert 17 to binary.

0001 0001

 

STEP 2

We apply the circular shift.

0010 0010

 

STEP 3

We now convert back to decimal.

32+2 = 34

 

The answer is 34.

 

BONUS

Which logic gate makes noise when it sleeps?

 

XNOR (very very funny stuff here)