JimmTheDog
|
Posted: Sat Nov 21, 2009 2:33 am Post subject: Trouble with bitwise operations |
|
|
I'm having some trouble with logical operations on bit patterns, especially when it comes to writing "procedures." It's hard for my mind to get that close to computer architecture. Does anyone have a sort of process for this? I'll use an example from my textbook (I already know the answer... just how to get there screwed me up)
"If n and m are both 4-bit 2's complement numbers, and s is the 4-bit result of adding them together, how can we determine, using only the operations AND, OR, NOT, and XOR, if an overflow occurred during the addition? Develop a "procedure" for doing so. The inputs to the procedure are n, m, and s, and the output will be a bit pattern of all zeros (0000) if no overflow occurred and 1000 if an overflow did occur."
Any help would be much appreciated. |
|
|