FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Binary Coding





carlospro7
I'm not sure if this is the right place to post this but anyway...

I was given this assignment on binary numbers. The object is to pinpoint the location of this certain doughnut that is in this set of doughtnuts and it's divided in 4 sets of 4. Like this:

OO OO
OO OO

OO OO
QO OO

The Q being the doughnut that i need to pinpoint. Now I have to locate this doughnut using a binary code and can only be a maximum of 5-bits. The question it says is "devise two code schemes for pinpointing the location of the blue (Q) doughnut with the MSB (Most significant bit) giving the order of directions." I'm not entirely sure what that means, and while this may be a stupid question, what exactly is a code scheme? I'm new at this, and it'd be great if someone could help me with it. Thanks in advance.
AftershockVibe
Erm... I have to admit that I'm not entirely sure what the question wants as an answer as it has no context. But here is what I would hazard a guess it means...

You have 5 bits:
XXXXX; where X= 0/1

MSB indicates "direction order" (which comes later) so you have:
DXXXX

Now, we need a way to locate the Q on a 4x4 grid (I'm not sure why the sets are necessary). I'll hazard another guess and say that the remaining Xs can represent these in binary:

DXXYY
or
DYYXX

giving you your two "coding schemes" and D tells you which one you are using.

For example
01011 means using DXXYY (as D=0) so Q is at (2,3)
or
10110 means Q is at (2,1)

NB: Co-ordinates begin at zero

Edit: It is very easy to see which set the Q is in as well by looking at the MSBs of XX and YY respectively.
carlospro7
Geee, thanks man!
Related topics
How To : Secure Your PHP Website
from integer to binary
Programming links, info, and tutorials
Decimal, Binary and Hexadecimal
My Personal Digital Play Ground
Fortran Tutorials(77)
MySQL Masters Binary Logs & Replication?
So is everyone here using HTML coding???
HTML coding and uploading.
Started to use my own coding!!! HELP please!
AJAX web coding
PHP VS ASP
Mac's and Coding
build Universal Binary version of mysql administrator
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.