Floating Point Notation Question

Click For Summary

Discussion Overview

The discussion revolves around a combinational logic design assignment involving the conversion of a binary integer into a floating-point representation. Participants are exploring how to derive the mantissa (M) and exponent (E) values from a given 7-bit binary integer, focusing on the logic needed to implement this in a circuit design context.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant expresses uncertainty about how to derive the mantissa values after finding the exponent values.
  • Another participant suggests using rules and multiplexers to define the mantissa based on the binary input, proposing a structure for the logic expressions.
  • A participant shares a detailed approach for determining M3 based on the values of B6, B5, B4, and B3, indicating a method for combining conditions into a Sum-of-Products expression.
  • There is a discussion about how to translate conditional statements into Boolean logic, with one participant providing a formula for expressing "A if C, otherwise B" in logical terms.
  • Questions arise regarding the derivation of the exponent values E1 and E0, with suggestions to check conditions for the exponent based on the binary input.

Areas of Agreement / Disagreement

Participants are generally exploring the problem collaboratively, with some agreement on the approach to defining the mantissa using conditional logic. However, there is no consensus on the final expressions or methods for deriving the mantissa and exponent values, indicating ongoing uncertainty and exploration.

Contextual Notes

Participants mention the need to ignore leading zeroes and the truncation of bit sequences, which may affect the derivation of the mantissa. There are also references to the complexity of combining conditions into a coherent Boolean expression, suggesting potential challenges in the logic design process.

fazer2014
Messages
8
Reaction score
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
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?
 
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:
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.
 
how do you get E1 and E0?
 
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:

Similar threads

Replies
9
Views
2K
Replies
10
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
4
Views
2K
Replies
235
Views
15K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
8K