|
Fei Xu, Ph.D |
Fei Xu
TA job :Spring 2005: CDA 3101: Introduction to
Computer Organization
|
|
FAQ
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.