Help with some digital exam review?

Discussion in 'Homework Help' started by GRNDPNDR, Jan 6, 2013.

  1. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    I have an exam coming up tomorrow and I was looking over the review sheet provided for us and I'm having some issues on what should be some rather simple stuff.

    Converting binary address to hex and masking.

    Here are the questions and answers, but I'm overlooking some simple stuff in regards to getting to the answers.

    Im stuck here, I keep getting numbers like 24, and I'm not sure how to arrive at the answer of BACE. Which bit is the parity bit? Which 3 bits are the address and what bits are the data?

    I do not understand masking and we didn't cover that much of it....so I'm really lost here.
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    Which bits are which (address, parity, data) depends on the protocol for whatever a "smart MPI block" is.

    The reason that HEX is used is because it is easy to group a bit pattern into 4-bit groups and then translate each group between base-2 and base-16 (HEX) independent of all other groups. So take you 16-bit value and partition it into four 4-bit groups.

    Masking simply involves bitwise logic operations to force some bits to be set, some to be cleared, some to be toggled, and some to be left unchanged. What happens if you perform a bitwise AND operation between the value 1010 and the mask 1100?
     
  3. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    He didn't specify which bits were which. The question is as we would get it.

    I assume the parity bit is the LSB, the next 3 bits are address and the rest are data.
    I'm still lost because doing it that way I CANNOT arrive at the answer of BACE.
    I end up with something like this;
    101 1101 0110 0111 0

    Which doesn't convert to BACE.
    I get
    A 26 C E

    wtf am I doing wrong here?

    To answer your question, I get

    1000
     
  4. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    Well I arrived at BACE. I was using 16 8 4 2 as the bits instead of 8 4 2 0
    So that let me get to the correct answer.

    I'm still confused on the masking though.

    How does 1FFE mask everything but the data?
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,356
    Generally speaking, one would group the bits in groups of four bits starting from the right (if the number of bits is not a multiple of four).

    1011101011001110

    becomes

    1011 1010 1100 1110

    hence the hex value is BACE

    The instruction says three address bits, one parity bit and the rest is data. This information is incomplete since there is no information as to which bit is which. However, we make the assumption that the first three bits (AAA) are the address bits and the last bit is the parity bit (P).

    AAAD DDDD DDDD DDDP

    The word "mask" can have two meanings that give opposite results.
    A "mask" can be used to hide a portion of the information or a mask can reveal the desired data. In this case, the word "mask" means to reveal the data of interest.

    Hence the data mask is

    0001 1111 1111 1110

    When you logically AND the mask with the information you extract the DATA bits.

    Similarly a mask of

    1110 0000 0000 0000

    will extract the ADDRESS bits

    and a mask of

    0000 0000 0000 0001

    will extract the PARITY bit.
     
  6. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    That makes a lot of sense, thanks.
    I think I get it now, at least enough to pass that part of my exam.
     
  7. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    THE BASTARD DIDN'T EVEN PUT THIS ON THE EXAM :mad:

    he did have a bunch of other stuff that I was totally screwed for. I could be repeating this class over folks
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,356
    Now, now. Not a nice thing to call your teacher.
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    In most cases a review sheet is intended to cover a good fraction of the topics and concepts that have been covered by the course, not that will be on the exam.

    If you do have to repeat the class, take it as an opportunity to learn the material that you did not get down this time -- it could end up being one of the best things that ever happened to you. If you were to go on to the next courses with a weak understanding of this material, you would likely find yourself even more lost in material more advanced than you are prepared for.
     
    Last edited: Jan 7, 2013
  10. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675

    Whose fault is it that you didn't know the information on the test? Your professor, regardless of how ineffective you think s/he is, took the time to try to teach you something. Show your instructor a little more respect than calling him names. Your frustration should be with yourself for not learning the subject matter better outside of class.

    WBahn is right, though. Even if you do retake the class, don't worry. It will give you a firmer understanding of the material. This is really important stuff and to move on without understanding it would be doing you more harm than good. I had to retake a single class during college, and I am glad I did. I knew people that passed the class with little understanding and it came back to bite them in the butt. I retook the class and did much better in later classes because of it.

    So, think of it as a learning experience, not as a race to complete the most classes in the shortest amount of time.
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,356
    When I was in high school I got decent grades in my Math and Physics courses, B or C. I redid my year and finished with A's. I am thankful that I took the effort to get a solid foundation in Math and Physics.
     
  12. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    Sorry guys I think this was taken out of context and with good reason, I didn't mean that in a hateful or angry way, This teacher is a great guy and gets my utmost respect. We've gotten along very well in his classes and have a sort of "rip on each other" rapport, so that wasn't meant as a hateful comment.

    I literally called him a bastard for not putting it on the test, we had a good laugh over it.

    I did pass my test, but he really does make his tests very challenging, and throws a LOT of tricks into his questions and wording as well as requiring you to write down the formulas step by step including a complete derivation of the formulas, because even though he includes them he NEVER includes the exact formula you need and absolutely requires you to rewrite the formula for the problem you're on.

    BTW it wasn't a digital course, it was instrumentation and process control for industry, but included just a touch of digital.

    We did a complete course on digital in semester one and two.

    No disrespect to the teacher, he's a great guy and goes to literally extreme measures to help his students including private tutoring and spending MANY of his own personal hours dedicated to students. You couldn't ask for a better teacher TBH.
     
Loading...