# Lecture4 - Computer Programming TA C162 Agenda Operations...

This preview shows pages 1–7. Sign up to view the full content.

1 Computer Programming TA C162 1/16/06 Agenda Operations on Bits Arithmetic Addition Subtraction Logical

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Computer Programming TA C162 1/16/06 Logical Operations Logical operations operate on logical variables . Logical variable can have values either 0 or 1 Basic logical functions: AND OR NOT X-OR( Exclusive OR)
3 Computer Programming TA C162 1/16/06 Logical Operations Operations on logical TRUE or FALSE Two states -- takes one bit to represent: TRUE=1, FALSE=0 View n -bit number as a collection of n logical values Operation applied to each bit independently

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Computer Programming TA C162 1/16/06 Logical AND Operation Binary logical operation Needs two operands Truth Table A B A AND B 0 0 0 0 1 0 1 0 0 1 1 1 The output is 1 only if both the operands have value 1
5 Computer Programming TA C162 1/16/06 Example: Let A =10011001 B = 00110011 We form the AND of A and B by bit-wise ANDing two values 10011001 AND 00110011 00010001

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Computer Programming TA C162 1/16/06 Application of AND operation
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 12

Lecture4 - Computer Programming TA C162 Agenda Operations...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online