# Topic 1.2 - Logical Operations Flashcards

1
Q

What is the truth table for OR?

A
• 0 0 = 0
• 1 0 = 1
• 0 1 = 1
• 1 1 = 1
2
Q

What is the truth table for AND?

A
• 0 0 = 0
• 1 0 = 0
• 0 1 = 0
• 1 1 = 1
3
Q

What is the truth table for XOR?

A
• 0 0 = 0
• 1 0 = 1
• 0 1 = 1
• 1 1 = 0
4
Q

How does XOR encryption work?

A

The data is XOR’ed with a key to produce encrypted data. To retrieve the data, the the encrypted data is XOR’ed with the key again

5
Q

What is the process of bit masking?

A

This is where the AND operation is used to mask part of a binary number to return only the relevant parts

• 01011101
• 00000111 AND
• 00000101 (Returns last 3 digits
6
Q

What is the purpose of a subnet mask?

A

A mask is used to check that one computer is on the same segment of network as another computing by only comparing the relevant bits from their IP addresses.

7
Q

How would you go about setting the 4 least significant bits to 1 in the byte 01010101?

A

You would ‘OR’ it with another bit which would leave the value of the first 4 bits and changing the value of the last 4 bits to 1

• 01010101
• 00001111 OR
• 01011111
8
Q

What does A.A simply to?

A

A

9
Q

What does A.<a> simply to?</a>

A

0

10
Q

What does 1 + A simply to?

A

1

11
Q

What does 0 + A simply to?

A

A

12
Q

What does A + A simply to?

A

A

13
Q

What does A + <a> simply to?</a>

A

1

14
Q

What does 0.A simplify to?

A

0

15
Q

What does 1.A simply to?

A

A

16
Q

What does A + A.B simply to?

A

A

17
Q

What does A + <a>.B simply to?</a>

A

A + B

18
Q

What does > simply to?

A

<a> + B</a>