## Problem 1

- 8G × 512 = 2
^{33}× 2^{9}= 2^{42}= 4T - 16G / 256 = 2
^{34}/ 2^{8}= 2^{26}= 64M - 4k × 2M = 2
^{12}× 2^{21}= 2^{33}= 8G - log
_{2}(64M) = log_{2}(2^{26}) = 26

## Problem 2

- An 2 GB memory has a 32-bit word size. How many words are contained in this memory?
- 2 GB = 2
^{31}bytes = 2^{31}× 2^{3}bits = 2^{34}bits - 2
^{34}bits / (2^{5}bits/word) = 2^{29}words = 512M words

- 2 GB = 2
- A memory has 8 G words.
Each word contains 64 bits. How many bytes are
contained in this memory?
- 8 G words = 2
^{23}words - 64 bits = 2
^{6}bits - 2
^{23}words × (2^{6}bits/word) = 2^{29}bits - 2
^{29}bits = 2^{26}bytes = 64 GB

- 8 G words = 2
- How many bits are required to address the 8 G words of this memory?
- 8 G = 2
^{33} - log
_{2}(2^{33}) = 33

- 8 G = 2

## Problem 3

Express the following base 10 numbers in 16-bit fixed-point twos-complement representation with 8 integer bits and 8 fraction bits. Some of the numbers can not be expressed exactly, so give the nearest fixed-point representaion.

- 13.5 is 00001101.10000000 or 0000110110000000 in fixed-point
- 100.05 is approximately 01100100.00001100 or 0110010000001100 in fixed-point
- 0000110110000001 in fixed-point is 100.046875

- 100.05 is approximated by 01100100.00001101 or 0110010000001101 in fixed-point
- 0000110110000000 in fixed-point is 100.05078125
- 0.3333333333333333333333333333333333333333333333333 is approximately 00000000.01010101 or 0000000001010101 in fixed-point
- 14 is 00001110.00000000 or 0000111000000000 in fixed-point

## Problem 4

Express the following 16-bit fixed-point twos-complement numbers with 8 integer bits and 8 fraction bits as base 10 decimal numbers.

## Problem 5

What is the 32-bit IEEE 754 representation for 3.5?

- In binary fixed point, 3.5 is 11.1
- Normalized, 11.1 is 1.11 × 2
^{1} - IEEE 754 sign field is 0 (for positive)
- IEEE 754 exponent field is 127+1 or 10000000 in binary
- IEEE 754 fraction field is 127+1 or 11000000000000000000000
- IEEE 754 representation is 01000000011000000000000000000000 or
`0b01000000011000000000000000000000`

(Java SE 7) or`0b0100_0000_0110_0000_0000_0000_0000_0000`

(Java SE 7) or`0x40600000`

(C and Java) or 40600000 (hex)

## Problem 6

If `0x42510000`

is the 32-bit IEEE 754 representation
of a floating point number, what is the floating point number?

`0x42510000`

is 01000010010100010000000000000000- For IEEE 754, can be divided into
0.10000100.10100010000000000000000
- 0 means number is positive
- 10000100 means exponent field is 132 and binary exponent
is 132-127 or 5 so exponent multiplier is 2
^{5}or 32 - 10100010000000000000000 means fraction is 1.10100010000000000000000 or 1+1/2+1/8+1/128 or 1+64/128+16/128+1/128 or 1+81/128 or 1.6328125

- Result is +32×1.6328125 or 52.25