CPSC 2310 - DAY 13 SEPTEMBER 28, 2016 ================================================================================ Masking ------- ANDing a bit with 0 produces a 0 at the output. OR a bit with 1 produces a 1 at the output, while or with 0 produces a 0 XOR shift left (same as multiplying by 2) shift right(same as dividing by 2) asr - sign bit replicated on left (ex if it starts negative, it ends negative) Field extraction with a bit mask - field already in rightmost bits bit mask - a word where bits are used to zero out or select portions of another word remove all other bits and work with only the low four bits AND ((1 << m) -1) << n; to create a mask