Lecture4 - Computer Programming TA C162 Agenda Operations...

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

View Full Document Right Arrow Icon
1 Computer Programming TA C162 1/16/06 Agenda Operations on Bits Arithmetic Addition Subtraction Logical
Background image of page 1

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

View Full DocumentRight Arrow Icon
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)
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Computer Programming TA C162 1/16/06 Application of AND operation
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online