Assignment 10, Solutions
Part of
the homework for 22C:60 (CS:2630), Fall 2011
|
In fixed point binary, rounded to 32 places after the point,
π = 11.0010 0100 0011 1111 0110 1010 1000 1001IEEE format uses a 24-bit mantissa (including the hidden bit), so the mantissa needs to be rounded to that size and normalized:
π = 1.100 1001 0000 1111 1101 1011 × 2Now, the exponent 21 is represented as 1000 0000, and this is a positive number, so we can assemble all the parts to get:
π = 0100 0000 0100 1001 0000 1111 1101 1011 = 40490FDB
A problem: Give a table of the decimal equivalents of every floating point number in this system from 0000 to 1111, in order. (1 point)
0000 = 0 00 0 = +1.0 × 2-2 = +0.25 0001 = 0 00 1 = +1.5 × 2-2 = +0.375 0010 = 0 01 0 = +1.0 × 2-1 = +0.5 0011 = 0 01 1 = +1.5 × 2-1 = +0.75 0100 = 0 10 0 = +1.0 × 2+0 = +1 0101 = 0 10 1 = +1.5 × 2+0 = +1.5 0110 = 0 11 0 = +1.0 × 2 1 = +2 0111 = 0 11 1 = +1.5 × 2 1 = +3 1000 = 1 00 0 = -1.0 × 2-2 = -0.25 1001 = 1 00 1 = -1.5 × 2-2 = -0.375 1010 = 1 01 0 = -1.0 × 2-1 = -0.5 1011 = 1 01 1 = -1.5 × 2-1 = -0.75 1100 = 1 10 0 = -1.0 × 2 0 = -1 1101 = 1 10 1 = -1.5 × 2 0 = -1.5 1110 = 1 11 0 = -1.0 × 2+1 = -2 1111 = 1 11 1 = -1.5 × 2+1 = -3
a)
Draw this in the schematic notation for a logic circuit.
(0.3 points)
b) What values of the inputs to this circuit permit it to store one bit of information? (In doing part a, you will have identified the inputs.) (0.3 points)
If [a,b] = [1,0] the outputs [c,d] will be either [1,1] or [0,0], which is to say, the circuit will be storing a bit. Under these circumstances, the outputs are always identical, so we can label them both Q.
c) How do you make this circuit store the value one? (0.2 points)
If [a,b] = [1,1] the outputs [c,d] will be forced to [1,1].
In other words, if we start and end with [a,b] = [1,0] and apply a brief positive pulse to the b input, so [a,b] are briefly [1,1], we will set the flipflop. As such, the b input should be labeled S because it sets the flipflop on a positive pulse.
d) How do you make this circuit store the value zero? (0.2 points)
If [a,b] = [0,0] the outputs [c,d] will be forced to [0,0].
In other words, if we start and end with [a,b] = [1,0] and apply a brief negative pulse to the a input, so [a,b] are briefly [0,0], we will reset the flipflop. As such, the a input should be labeled R because it resets the flipflop on a negative pulse.