Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 19th, 2007, 8:58 PM   #1
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
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?
__________________
i dont know much about programming but i try to help

Last edited by mrynit; Dec 19th, 2007 at 9:11 PM.
mrynit is offline   Reply With Quote
Old Dec 19th, 2007, 9:50 PM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
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.

Last edited by Sane; Dec 19th, 2007 at 10:01 PM.
Sane is offline   Reply With Quote
Old Dec 20th, 2007, 12:38 AM   #3
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
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.
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Old Dec 20th, 2007, 7:55 AM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Dec 20th, 2007, 8:01 AM   #5
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Re: binary counting

That is the entire question, verbatim!
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Old Dec 20th, 2007, 8:14 AM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
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...
Sane is offline   Reply With Quote
Old Dec 21st, 2007, 6:29 AM   #7
Klipt
Hobbyist Programmer
 
Join Date: Dec 2005
Posts: 118
Rep Power: 0 Klipt is an unknown quantity at this point
Re: binary counting

Quote:
Originally Posted by Sane View Post
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.
Klipt is offline   Reply With Quote
Old Dec 21st, 2007, 6:40 AM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: binary counting

Quote:
Originally Posted by Klipt View Post
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
Sane is offline   Reply With Quote
Old Dec 21st, 2007, 11:53 PM   #9
WaltP
Programmer
 
Join Date: Oct 2007
Posts: 39
Rep Power: 0 WaltP is on a distinguished road
Re: binary counting

Sign bit?
WaltP is offline   Reply With Quote
Old Dec 22nd, 2007, 9:19 AM   #10
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Re: binary counting

Quote:
Originally Posted by WaltP View Post
Sign bit?
considering data structures have not been mentioned i would say no
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary Serialization vs. Byte Streams kurifu C# 1 Apr 7th, 2007 5:17 PM
linked list & binary tree questions n00b C++ 14 Nov 4th, 2006 2:24 AM
Java code to convert binary to decimal and hexadecimal to binary prince_haldir Java 1 Mar 7th, 2006 1:51 AM
Binary Ubert Other Programming Languages 8 Sep 23rd, 2005 10:09 AM
Reading Delphi Binary kcnz C# 2 Aug 7th, 2005 10:35 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:53 AM.

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