In: Computer Science
Calculate the following issues in bit-level (signed values, two complement arithmetics)
a) 13 + 9 (use word lengths of 5 and 6 bits including the sign bit)
b) 11 – 17 (8-bit word length)
c) 9 * 5 (8-bit word length)
d) a-task using saturative arithmetics
All operations performed in binary format is shown in below
(a) Operation13+9 using word length=5
13 + | 0 | 1 | 1 | 0 | 1 |
9 | 0 | 1 | 0 | 0 | 1 |
= -10 | 1 | 0 | 1 | 1 | 0 |
Operation13+9 using word length=6
13+ | 0 | 0 | 1 | 1 | 0 | 1 |
9 | 0 | 0 | 1 | 0 | 0 | 1 |
=22 | 0 | 1 | 0 | 1 | 1 | 0 |
(b)Operation11-7 using word length=8
11 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
-7 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
=4 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
(c)Operation9*5 using word length=8
9 * | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
5 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
=45 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
(d)Saturation arithmetic is a version of arithmetic in which all operations such as addition and multiplication are limited to a fixed range between a minimum and maximum value.If the result of an operation is greater than the maximum, it is set to the maximum; if it is below the minimum, it is set to the minimum.
Operation13+9 using word length=5 using saturation arithmetic
here maximum value is 24 -1=15 and minimum value is -24 = -16
13+ | 0 | 1 | 1 | 0 | 1 |
9 | 0 | 1 | 0 | 0 | 1 |
=15 | 0 | 1 | 1 | 1 | 1 |