Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Coder's Corner Lounge (http://www.programmingforums.org/forum11.html)
-   -   binary counting (http://www.programmingforums.org/showthread.php?t=14774)

mrynit Dec 19th, 2007 9:58 PM

binary counting
 
This is a question from my digital logic book
Quote:

The minimum member of bits required to distinguish 108 distinct objects is ?
I converted 108 to binary, 110 1100. that is seven (7) bits. But the answer in the back of the book says eight (8) bits. How is the correct answer 8 not 7 bits?

Sane Dec 19th, 2007 10:50 PM

Re: binary counting
 
Is it in the context of programming? As far as I know, no 7 bit datatype exists. You can use bitfields to separate bytes into odd amounts of bits. But other then that, to store something distinguished by 7 bits, you would need an 8 bit datatype. So you are correct, but that may have been the reasoning behind the answer.

Edit : Unless it's something like each object is distinguished by two values. IE. The first object takes values 0-1. The second object takes values 2-3. So on and so forth. Then 108*2 = 216. Which takes 8 bits of memory.

mrynit Dec 20th, 2007 1:38 AM

Re: binary counting
 
there is no contex to programming. the chapter the question is from is on the concepts of binary for computing, logic gates and true tables. It was not on the full topic of computer numbering systems.

I think your edit statement is correct.

The question is vauge to me.
I thought the answer to be Object A can be labeled as 1, Object B can be labeled as 2 and so on, thus 108 is the total of unique objects and convert it to binary. I don't see how the question implies that Objects have the state of being on or off, a binary nature, leading to the solution of 108*2 to binary which uses 8 bits. :icon_confused:

Sane Dec 20th, 2007 8:55 AM

Re: binary counting
 
Could you post the question in its entirity? Maybe it has a vague way of implying that each object requires 2 values per entry.

mrynit Dec 20th, 2007 9:01 AM

Re: binary counting
 
That is the entire question, verbatim!

Sane Dec 20th, 2007 9:14 AM

Re: binary counting
 
I guess by "distinguish", the question means "distinguish whether 108 objects are there or not". If you had 8 bits, you could set object #77 to on. And object #31 to off. Etc etc. That's how you distinguish them. Otherwise with 7 bits you could only list the number of objects that are set to on. You could only say with 100 0000, that "all objects up to #64 are on, and everything past is off".

But this is just my guess based on the answer they gave...

Klipt Dec 21st, 2007 7:29 AM

Re: binary counting
 
Quote:

Originally Posted by Sane (Post 138579)
I guess by "distinguish", the question means "distinguish whether 108 objects are there or not".

Doesn't that imply a set? A 108 member bitset requires 108 bits. But I'm probably just confused.

Sane Dec 21st, 2007 7:40 AM

Re: binary counting
 
Quote:

Originally Posted by Klipt (Post 138598)
Doesn't that imply a set? A 108 member bitset requires 108 bits. But I'm probably just confused.

Oh wow. Yes. I definitely confused myself there. That would require 108 bits. For some reason I thought it was the same thing as what I was saying in my second post. I need to remember to reread a thread before I post a response. Heh.

Disregard my last post, look at my second post's edit then... I'm not exactly sure why the question would imply that each object requires two values though. My theory has no supporting evidence. So I would have no clue bud. XD

WaltP Dec 22nd, 2007 12:53 AM

Re: binary counting
 
Sign bit?

mrynit Dec 22nd, 2007 10:19 AM

Re: binary counting
 
Quote:

Originally Posted by WaltP (Post 138633)
Sign bit?

considering data structures have not been mentioned i would say no


All times are GMT -5. The time now is 8:41 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC