CISE Department

Fei Xu, Ph.D
University of Florida
Gainesville, FL 32611-6120
email: feixu@cise.ufl.edu


Fei  Xu

TA job :Spring 2005: CDA 3101: Introduction to Computer Organization                                                                                                                            

 

FAQ

  1. How to understand the operations to keep some bits while removes other bits (into 0/1)?

Think about the operations “and” and “or” in another way. Below gives the and operation’s result.

Please figure out the or operation’s result yourself.

Original      mask    result

 0               0          0

 1               0          0

 0               1          0

 1              1          1

If the mask is 0, the result is always 0 regardless what the original input is. If the mask bit is 1, the original input will be kept.

For example: 1101. If you want to keep the 2nd and 3rd bits and let the first and last bits to be 0

Built mask 0110, and 1101,0110. The final result is 0100. That is what you need.