BME303 Intro. to Computing
1
Logical Op on bit vectors
“7” = segments: a, b, c
Microprocessor
0
0
0
0
0
1
1
1
Register (0x0D)

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
BME303 Intro. to Computing
2
Logical Operations
•
TRUE=1, FALSE=0
•
Bitwise operation
A
B
A
AND
B
0
0
0
0
1
0
1
0
0
1
1
1
A
B
A
OR
B
0
0
0
0
1
1
1
0
1
1
1
1
A
NOT
A
0
1
1
0
AND
OR
NOT

BME303 Intro. to Computing
3
Examples of Logical Operations
•
AND
–
useful for clearing bits
•
AND with zero = 0
•
AND with one = no change
•
OR
–
useful for setting bits
•
OR with zero = no change
•
OR with one = 1
•
NOT
–
unary operation -- one argument
–
flips every bit
11000101
AND
00001111
00000101
11000101
OR
00001111
11001111
NOT
11000101
00111010

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*