Problem 4 (20 points): Floating Point Numbers

advertisement

Name____________________________________________________________Quiz #2

Problem 1 (50 points): Short answer.

Answer the following questions with a very brief statement. Use the back of this page if you need more space.

1.

(15 points) Bits have no inherent meaning. Given the bit pattern:

1010 1100 0101 0000 0000 0000 0000 0000 what does it represent, assuming that it is a. a two’s complement integer? (It is enough to show how to compute the value.)

-2 31 + 2 29 + 2 27 + 2 26 + 2 22 + 2 20 c. a single precision floating-point number?

-1.625 × 2 -39 c. A MIPS instruction? sw $16, 0($2)

2.

(10 points) Compute the number of gate delays needed by CarryOut64 in a 64-bit adder using ripple carry, and three-levels of Carry Lookahead with four bit groups.

Ripple carry: 64 x 2 = 128

Three-level CLA: 1 + 2 + 2 + 2 = 7

3.

(15 points) Given a 32-bit ALU that supports logic AND, logic OR, addition, and subtraction, discuss how slt is implemented with minimum hardware. Note that you do not need to consider overflow.

1.

Expand the multiplexor of each bit of the ALU by adding one more input

(called LESS line, denoted by LESS0, LESS1, … LESS31) – to output 0 for all the 31 higher bits and 0/1 for the least significant bit.

2.

Hard wire the LESS lines of all the 31 higher bits of the ALU to 0

3.

Connect SUM31 to LESS0. (Set the control of the ALU to 111.)

4.

(10 points) Draw the diagram for the hardware implementation of multu , the MIPS instruction for unsigned multiplication.

Figure 3.7

Name: ___________________________________________________________Quiz #2

Problem 2 (50 points). In this question, you will be using an 8 -bit floating-point format with the following structure. The exponent is encoded in bias 3 . It has gradual underflow for denormalized numbers. There is an implicit 1 to the left of the binary point in the significand, just like IEEE 754 single precision floating-point format.

Sign Exp Significand

s 3 bits 4 bits

Part A (15 points).

Represent the decimal number –2.75

in this floating point notation.

1 1 0 0 0 1 1 0

Part B (15 points).

What decimal number does 01010011 represent?

4.75

Part C (20 points).

What is the smallest magnitude non-zero number representable in this format. Provide both the binary pattern and decimal value below.

Binary pattern: 0 0 0 0 0 0 0 1

Decimal value: 0.0001

two

x 2

–2

= 0.015625

2

Download