Download A desktop laser printer has a 300-pixel-per

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Q- A desktop laser printer has a 300-pixel-per-inch resolution. If each pixel is
stored in one bit of memory how many bytes of memory are required to store
the complete image of one 8.5 X 11 inch of paper?
A. About 8 KB
B. About .5 MB
C. About 1 MB
D. About 4 MB
E. About 8 MB
SOLUTION:
8.5 x 11inch paper = (8.5 x 300) x (11 x 300) pixels on paper
stated in the question.
... 300pixel-per-inch resolution is
=2550 x 3300 pixels
Total pixels on the sheet = 2550 x 3300 =
8415000
Each pixel is stored in one bit of memory, so 8415000 pixels are stored in 8415000 bits of
memory
8bits make 1 byte
So 8415000 bits = 8415000 / 8 byte = 1051875 bytes
1024 bytes make 1 kilobyte(1KB)
Therefore, 1051875 bytes = 1051875/1024 = 1027.222 KB
1024 KB make up 1 MegaByte (MB)
Therefore, 1027.22 / 1024 = 1.003MB
OUR ANSWER IS OPTION C - ABOUT 1 MB.
Q-Assuming nine-bit two's complement binary representation, convert 1B4 from
hexadecimal to decimal. Remember to check the sign bit:
SOLUTION:
In 9-bit 2's-complement system you use 9 x 1's and 0's to represent the numbers from -256
to +255, with 0 in the middle. The left-most bit (the highest bit) is reserved to represent the
sign of the number 0 means positive and 1 means negative. Which leaves you with only
7-bits left to represent the actual value of the number.
Direct conversion of Hexadecimal 1B4 to binary4-bit Binary of 1 - 0001
4-bit Binary of B - 1011
4-bit Binary of 4 - 0100
I.e. 0001 1011 0100 - truncating the first three 0 bits, we get
110110100 .. This is our 9-bit 2’s complement form. First bit is 1, which indicates negative.
Computing rest of the 8-bits from binary to decimal:
10110100 = [1 x (2^7)] + [1 x (2^5)] + [1 x (2^4)] + [1 x (2^2)]
= 128 + 32 + 16 + 4 = 180
First bit indicated negative, so our value in decimal is: -180
Q- For IEEE 754 single precision floating point, what is the number, as written in ,
whose hexadecimal representation is: 0061 0000
Let us write our hexadecimal in the binary notation.
0061 0000 = 0000 0000 0110 0001 0000 0000 0000 0000
Sign bit : 0
Exponent: 0000 0000
Significand: 110 0001 0000 0000 0000 0000 to the base 2 = 610000 to base 16
We then add the implicit 24th bit to the significand
1110 0001 0000 0000 0000 0000 = E10000 base16
and decode the exponent value by subtracting 127
0 base 16 = 0
0 - 127 = -127
... I AM SOLVING AFTER THIS.
Example LINK: http://en.wikipedia.org/wiki/Single-precision_floating-point_format
Q- For IEEE 754 single precision floating point, write the hexadecimal representation for
-1.0.
SOLUTION:
We have -1.0
(1.0) base 10 = 1 base 10 + 0.0 base 10
=(0001) base 2 + (000) base 2
=(0001.000) base 2
=1.0 x 2^0
Exponent is 0 (and in the biased form it is therefore 127)
Biased form > 0000 0000 (For 0)
Reverse : 1111 1111 <- this is the biased form
The fraction is 0 (looking to the right of the binary point in 1.0 is all 0 = 000...0)
From these we can form the resulting 32 bit IEEE 754 binary32 format representation of
real number 0
as: 1-01111111-00000000000000000000000 = bf800000 [TAKING bits
4 by 4]
Our answer: bf800000