CaseyJackman_HW2

advertisement
Casey Jackman
Forensics
Computer Forensics
Winter 2008
Number Systems Problems
There are eight problems. Values are unsigned unless otherwise indicated.
1.
If a number is represented as a byte, what is the decimal value of the
following bit pattern?
11010010
210
2.
What are the minimum and maximum decimal values for unsigned numbers
that can be expressed in a byte? Explain your answers.
+/- 127 The eighth bit is reserved for sign, so with 7 bits the maximum
number is 127, positive or negative.
3.
Suppose now that a hexadecimal number is expressed in a word (2 bytes). We
might then find that number represented like this:
01101001 01101110
address 10 address 11
696E
a.
What is the hex number if Little Endian formatting is used?
6E
b.
69
What is the hex number if Big Endian formatting is used?
69
6E
2
1.
Using signed number representation, subtract 3 from 4 and show that your
result is correct. Do the same subtracting 4 from 3.
4 00000100
- 3 00000011
00000100
-11111101
00000001
3 00000011
- 4 00000100
00000011
11111011
00000010
2.
Fixed point representation allows expression of fractions (and mixed
numbers). This is done by considering the binary point (like a decimal point)
to be at some position other than at the extreme right-hand side of the digit
sequence. What then is the decimal value of the following binary pattern,
with the binary point as indicated:
00000011.10000000
3.128
3.
Suppose that the pattern below is encoded in binary coded decimal (format).
What is the decimal value? Why is this wasteful representation? How would
this decimal number be represented in packed BCD? Why would BCD ever
be used?
00000001
00000000 00000101
105
Yes, because all 8 are required for each individual number
BCD Format: 00010000 01010000
3
4.
Interpret the pairs of binary byte patterns that follow as
a. Two signed decimal integers
b. A packed binary coded decimal number
c. A hexadecimal number
d. A Big Endian unsigned decimal integer
e. A Little Endian unsigned decimal integer
(1) 01010111 01110110
(2) 01000110 01011001
a. (1) 87 118 (2) 70 89
b. (1) 5776 (2) 4659
c. (1) 5776 (2) 4659
d. (1) 22390 (2) 18009
e. (1) 30295 (2) 22854
Download