# 3. Explain what happens when the following C code is executed (independent execution,not combined with the previous line).a.PORTA |= 0X40b.PTP = PTP&OXbdc.if (!(ADCTL & OX80))STATEMENT;d.if( i>0 && i

Question
7 views
check_circle

Step 1

To be able to understand the working of the execution of the given codes, knowledge about bit-parallel logical operators and Boolean operators is important.

• Bit-parallel logical operators:
1. & (AND)
2. | ( OR)

& (AND) : This operator performs bit-wise AND. It means the values will be manipulated with each bit of the value.

Example A and B are two values. A is a binary value 0 1 1 0 0 1 1 0, B is a binary value 1 0 1 1 0 0 1 1 and bit-wise & operation has to be performed.

Suppose C = A & B. Then every bit of A will be & with the corresponding bit of B.

The following representation shows the operation clearly:

A  0 1 1 0 0 1 1 0

(AND)    B  1 0 1 1 0 0 1 1

C  0 0 1 0 0 0 1 0

| (OR) :

This operator performs bit-wise OR. It means the values will be manipulated with each bit of the value.

Example:

A and B are two values. A is a binary value 0 1 1 0 0 1 1 0 and B is a binary value 1 0 1 1 0 0 1 1...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in