BME303_lecture5

# BME303_lecture5 - BME303 Intro to Computing Addition •As...

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

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: BME303 Intro. to Computing Addition •As we’ve discussed, 2’s comp. addition is just binary addition. – assume all integers have the same number of bits – ignore carry out – for now, assume that sum fits in n-bit 2’s comp. representation 1 01101000 01101000 01101000 01101000 (104) 11110110 11110110 11110110 11110110 (-10) + 11110000 11110000 11110000 11110000 (-16) + (-9) 01011000 01011000 01011000 01011000 (88) (-19) Assuming 8-bit 2’s complement numbers. BME303 Intro. to Computing Data Type: bit vector “7” = segments: a, c, d Microprocessor 2 1 1 1 Register (0x0D) BME303 Intro. to Computing Logical Operations •Operations on logical TRUE or FALSE – two states -- takes one bit to represent: TRUE=1, FALSE=0 3 A B A AND B 1 1 1 1 1 A B A OR B 1 1 1 1 1 1 1 A NOT A 1 1 AND OR NOT BME303 Intro. to Computing Examples of Logical Operations •AND – useful for clearing bits • AND with zero = 0 • AND with one = no change •OR 11000101 11000101 11000101 11000101 AND 00001111 00001111 00001111 00001111 00000101 00000101 00000101 00000101 4 – useful for setting bits • OR with zero = no change • OR with one = 1 •NOT – unary operation -- one argument – flips every bit...
View Full Document

{[ snackBarMessage ]}

### Page1 / 20

BME303_lecture5 - BME303 Intro to Computing Addition •As...

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

View Full Document
Ask a homework question - tutors are online