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:

1. What is Floating Point Notation?

Floating Point Notation is a method of representing and storing real numbers in a computer. It is a way of expressing numbers with a decimal point in scientific notation, where the decimal point can "float" to represent very large or very small numbers.

2. How is Floating Point Notation different from other number representations?

Floating Point Notation differs from other number representations, such as integer or fixed-point notation, in that it can represent a wider range of numbers with a greater precision. It also allows for easier mathematical operations and more efficient use of memory.

3. What are the advantages of using Floating Point Notation?

One advantage of using Floating Point Notation is its ability to represent a wide range of numbers, including very small and very large values. It also allows for more precise calculations, making it useful for scientific and engineering applications. Additionally, Floating Point Notation is a standardized format, making it easier to share and collaborate on data.

4. Are there any limitations to Floating Point Notation?

Yes, there are some limitations to Floating Point Notation. One limitation is that it cannot represent all real numbers exactly. This can lead to small rounding errors in calculations. Additionally, Floating Point Notation may not be suitable for certain types of calculations, such as financial calculations, where exact values are required.

5. How is Floating Point Notation used in computer programming?

Floating Point Notation is commonly used in computer programming for representing and manipulating real numbers. It is used in many programming languages, including Java, Python, and C++. Programmers must be aware of the limitations and potential errors of Floating Point Notation when using it in their code.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
9
Views
955
  • Computing and Technology
Replies
4
Views
764
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
Replies
4
Views
927
  • Programming and Computer Science
7
Replies
235
Views
9K
  • Calculus and Beyond Homework Help
Replies
14
Views
1K
Replies
5
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
Back
Top