Shifting negative numbers, even with sign extensions, gives different results. Consider, for example, the one's complement number, -1. Left shifting one's complement negative numbers does not multiply by 2. Right shifting does simulate division correctly, however. 5.5.4 Comparisons and Conditional Branches Conditional branch instructions test some condition and branch to a particular memory address if the condition is met.
Many machines have condition code bits that are used to indicate specific conditions.
For example, there may be an overflow bit that is set to 1 whenever an arithmetic operation gives an incorrect result. On testing this bit, if an overflow did occur, we can branch to the error routine. Similarly, a carry bit can be set whenever an addition operation is carried out. Testing for zero is important for loops. If all conditional branches tested only 1 bit, to test a word for 0, one would need a separate test for each bit to ensure none was a 1.