Help with some digital exam review?

Thread Starter

GRNDPNDR

Joined Mar 1, 2012
545
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.

A 16-bit signal was received by a smart MPI block and it consisted of a 3-bit address, a single parity bit and the remaining bits were data.
If the received packet was 1011101011001110, what is its HEX value? Enter only the 4 hex numbers.
________ BACE
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?

What HEX value would mask out everything but the data from the received signal? Enter only the 4 hex numbers.
________ 1FFE

What HEX value would mask out everything but the address from the received signal? Enter only the 4 hex numbers.
________ E000

What HEX value would mask out everything but the parity bit value from the received signal? Enter only the 4 hex numbers.
________ 0001
I do not understand masking and we didn't cover that much of it....so I'm really lost here.
 

WBahn

Joined Mar 31, 2012
30,058
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?
 

Thread Starter

GRNDPNDR

Joined Mar 1, 2012
545
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
 

Thread Starter

GRNDPNDR

Joined Mar 1, 2012
545
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?
 

MrChips

Joined Oct 2, 2009
30,806
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.
 

Thread Starter

GRNDPNDR

Joined Mar 1, 2012
545
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
 

WBahn

Joined Mar 31, 2012
30,058
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
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:

tshuck

Joined Oct 18, 2012
3,534
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

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.
 

MrChips

Joined Oct 2, 2009
30,806
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.
 

Thread Starter

GRNDPNDR

Joined Mar 1, 2012
545
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
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.
 
Top