1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Floating Point Notation Question

  1. Aug 28, 2013 #1
    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.

    1. The problem statement, all variables and given/known data

    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.

    2. Relevant equations

    Simple combinational logic gates I guess?

    3. 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!!!
  2. jcsd
  3. Aug 28, 2013 #2


    User Avatar
    2017 Award

    Staff: Mentor

    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?
  4. Aug 29, 2013 #3
    Thanks for your reply mfb!

    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
    + 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: Aug 29, 2013
  5. Aug 29, 2013 #4


    User Avatar
    2017 Award

    Staff: Mentor

    "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.
  6. Sep 2, 2015 #5


    User Avatar

    how do you get E1 and E0?
  7. Sep 3, 2015 #6


    User Avatar
    2017 Award

    Staff: Mentor

    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: Sep 3, 2015
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted