Floating Point Notation Question

In summary, the student is trying to find the M values for a floating-point number, but is stuck. They have found expressions for the E1 and E0 values, but do not know how to approach the M values. They have found a way to combine some of the statements into shorter expressions, but they are not sure how to use them in a boolean logic way.
  • #1
fazer2014
8
0
Hi everyone! I'm very new to combinational logic design and this is a question on an assignment that we've been given. This particular situation wasn't covered in lecture material so I've been Googling and trying to think abstractly about it but I'm pretty stuck for an approach. And I'm not looking for an answer - just some guidance as to how to approach it.
I HAVE found the Boolean expression for the exponent (E) but cannot find an approach that works for finding the M values.

Homework Statement



A binary integer B in the range 0 ≤ B < 27 can be represented by 7 bits in “fixed-point” format, B = B6 B5 B4 B3 B2 B1 B0. We can represent numbers in the same range with less precision using 6 bits in a floating-point notation, F = M·2E, where M is a 4-bit mantissa M = M3 M2 M1 M0 and E is a 2-bit exponent E = E1 E0. In this system, the smallest integer is 0·20 and the largest is 15·23. We can write B = M ·2E +T where the truncation error T satisfies 0 ≤ T < 2E .

Design a combinational circuit which takes as input the 7-bit unsigned binary integer B = B6 B5 B4 B3 B2 B1 B0 and which outputs the 4-bit mantissa M = M3 M2 M1 M0 and the 2-bit exponent E = E1 E0 of the floating-point representation of the number. You do not need to sketch the circuit, rather you should write down a sum-of-products expression for each of the six ouput variables in terms of the input variables. As always, you should explain the reasoning behind your design.

Homework Equations



Simple combinational logic gates I guess?

The Attempt at a Solution



As mentioned earlier, I have found expressions for the E1 and E0 values. But I do not know how to approach the M values. We have to start at the first '1' (ignore leading zeroes) and then take the next 4 bits, and ignore the rest ie. truncate the bit sequence.
I honestly have no idea and have been exploring the use of single bit comparator circuits; A > B, A=B, A<B to even just try to get the first value (M4) but it doesn't seem to be going anywhere.

Thanks for any guidance!
 
Physics news on Phys.org
  • #2
You can start with writing down rules like "M3=B6 if ..., otherwise { M3=... if ..., otherwise { ... } }
Those "if/otherwise" are basically multiplexers and can be realized with AND and OR gates.

I have found expressions for the E1 and E0 values
What did you get?
 
  • #3
Thanks for your reply mfb!

mfb said:
You can start with writing down rules like "M3=B6 if ..., otherwise { M3=... if ..., otherwise { ... } }
Those "if/otherwise" are basically multiplexers and can be realized with AND and OR gates.

What did you get?

So I have a bunch of statements that look like this:

M3 = B6 IF B6=1, OR B5 IF B6=0 AND B5=1, OR B4 IF B6=0 AND B5=0 AND B4=1, OR B3 IF B6=0 AND B5=0 and B4=0

I can combine some parts of it into shorter expressions that could be a part of a Sum-of-Products... ie...
OR B3 IF B6=0 AND B5=0 and B4=0
becomes
+ B3 (IF?) 'B6'B5'B4

(where ' indicates NOT)...

Am I on the right track? How do I use the 'IF' parts in a boolean logic way?

Would the above statement become:

M3 = B6 + B5 'B6 + B4 'B5 'B6 + B3 'B4 'B5 'B6 ?
 
Last edited:
  • #4
How do I use the 'IF' parts in a boolean logic way?
"A if C, otherwise B" is just (A and C) OR (B and NOT C). One of the brackets is always wrong, and the other one reduces to A or C respectively.
 
  • #5
how do you get E1 and E0?
 
  • #6
fazer's last post here was one two years ago, it is unlikely that he sees your post.
As intermediate results, you can check if the exponent should be "at least 1", "at least 2", ..., and find E0 and E1 based on that.

Mark44 edit: changed the time since the thread was started.
 
Last edited by a moderator:
Back
Top