![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Hobbyist Programmer
|
binary counting
This is a question from my digital logic book
Quote:
__________________
i dont know much about programming but i try to help Last edited by mrynit; Dec 19th, 2007 at 10:11 PM. |
|
|
|
|
|
|
#2 |
|
Banned
![]() ![]() |
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 11:01 PM. |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
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 |
|
|
|
|
|
#4 |
|
Banned
![]() ![]() |
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.
|
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
Re: binary counting
That is the entire question, verbatim!
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#6 |
|
Banned
![]() ![]() |
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... |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Dec 2005
Posts: 118
Rep Power: 0
![]() |
Re: binary counting
Doesn't that imply a set? A 108 member bitset requires 108 bits. But I'm probably just confused.
|
|
|
|
|
|
#8 | |
|
Banned
![]() ![]() |
Re: binary counting
Quote:
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 |
|
|
|
|
|
|
#9 |
|
Programmer
Join Date: Oct 2007
Posts: 39
Rep Power: 0
![]() |
Re: binary counting
Sign bit?
|
|
|
|
|
|
#10 |
|
Hobbyist Programmer
|
Re: binary counting
considering data structures have not been mentioned i would say no
__________________
i dont know much about programming but i try to help |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Binary Serialization vs. Byte Streams | kurifu | C# | 1 | Apr 7th, 2007 6:17 PM |
| linked list & binary tree questions | n00b | C++ | 14 | Nov 4th, 2006 3:24 AM |
| Java code to convert binary to decimal and hexadecimal to binary | prince_haldir | Java | 1 | Mar 7th, 2006 2:51 AM |
| Binary | Ubert | Other Programming Languages | 8 | Sep 23rd, 2005 11:09 AM |
| Reading Delphi Binary | kcnz | C# | 2 | Aug 7th, 2005 11:35 PM |