Worksheet 5 Bitwise manipulation and masks
Task 1
1. Figure 1 shows a byte containing a signed integer. The value of the carry bit is unknown.
Figure 1
Show the result of performing the following shifts, starting each time with the byte given in
Figure 1.
(a) a logical right shift:
(b) a logical left shift:
(b) an arithmetic left shift:
(c) an arithmetic right shift:
2. Using a combination of shifts and addition, multiply 13 by 6
3. Figure 2 shows an 8-bit byte containing an integer.
Figure 2
Show the result of performing the following consecutive shifts on the byte.
(a) a circular right shift:
(b) a circular right shift:
(c) an arithmetic left shift:
(d) an arithmetic right shift:
1