[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why do we still need bytes? Why can't we just address individual

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 32
Thread images: 2

File: ab15-548b.jpg (23KB, 280x234px) Image search: [Google]
ab15-548b.jpg
23KB, 280x234px
Why do we still need bytes? Why can't we just address individual bits? 64-bit system can address 16 exabits. Why the hell can't I have a 3-bit integer? Or 11-bit integer? And what is all this structure padding bullshit?
>>
>>7903725
It's the established standard for computer architectures. Everything from CPUs to address busses are designed with that standard in mind.

Nothing to do with technical capability, it's just a standard.
>>
>>7903725
vector<bool>

also don't use vector<bool>
>>
Trying to figure out how to structure a ternary based computer is a fun thought experiment
>>
>>7903725
struct
{
.
.
.
unsigned int fieldof3bits : 3;
.
.
.
} newdatatypename;
>>
>>7903735
Bools aren't 1 bit
>>
what would be the point? you'd just make your registers and, as a result, programming more complicated. a lot of stuff involving bit shifting would be fucked.
>>
>>7903806
(below assumes sizeof(unsigned int) == 4 bytes)

The size of the struct will still be sizeof(unsigned int). Bit fields don't reduce allocated/addressed size, they just allow you to use pieces of an initial allocation. So you can have 32 unsigned int bit fields that store 1 bit, but if you have 33 the size of the struct becomes 8 bytes.

This doesn't mean you're only reading/writing 3 bits, the C compiler just divvies up the allocation more minutely. You are still allocating/referring to a 4 byte block of memory.
>>
>>7903725
Why do you use words rather than a stream of letters?
>>
>>7903725
>Why the hell can't I have a 3-bit integer? Or 11-bit integer

typename<unsigned n>
class int_n_bits{
private:
int data;

public:
int_n_bits(int s){
data=s%(1<<n);
}
int_n_bits& operator=(int s){
data=s%(1<<n);
return *this;
}
operator int() const{
return data;
}
};

using int3bits =int_n_bits<3>;
using int11bits =int_n_bits<11>;


Happy?
>>
>>7903813
They are when in a vector (the designers were drunk that day)

https://isocpp.org/blog/2012/11/on-vectorbool
http://en.cppreference.com/w/cpp/container/vector_bool
>>
File: 1395156384325.jpg (91KB, 1024x768px) Image search: [Google]
1395156384325.jpg
91KB, 1024x768px
>>7903813
>Bools aren't 1 bit
They might as well be.
Entry-level computers have billions of bytes of storage, and the OS and applications just use it like a $2 whore.
Jesus, look at how ridiculous Java is.
You can't write "Hello World" without millions of bytes of library code.
It's like the industry gets paid to waste RAM, hard disk storage and CPU cycles.
And what in the hell would you gain from eliminating "all this structure padding bullshit"?
You wouldn't really save much memory (if any), since every int pointer (say) would have to have the number of bits as well as the address, AND the address would have to have more bits.
So what would you gain???
I suppose it might satisfy your personal autistic sense of ordnung, but it would offend mine.
>>
>>7903725
How is the computer gonna know it's a 3bit digit?
11100010, how does it know you mean: 111, 000, 10 (3 digits) and not 11100010(1 digit)?.
>>
>>7903728
Obviously you have no idea what you're talking about ;)
>>
>>7903725
Because doing operations like reading from memory one bit at a time is inefficient as hell compared to reading entire words or pages of memory at a time.
>>
If youre trying to address every bit with a pointer then the pointer would need to have as many bits as your whole system has.

Everything is based on C and C has pointers, its the basic idea behind building logical structures.

If you need to go full mad use bitfields
struct muhfield {
unsigned int:10;
}

I cant believe I just wrote this... I need to leave this place asap
>>
>>7903940
Then correct me.

https://en.m.wikipedia.org/wiki/Byte_addressing

I've tried disproving my initial response and everything I read just says it's an architecture design choice.
>>
>>7903928
Do you know how much is needed to interpret a bit for a normal computer? That's right, a byte.
>>
>>7904006
lol'd hard

>>7903725
never heard of assembly?
>>
>>7903940
Then prove me wrong. I can't find a single piece of writing that shows technological inability to access individual bits. A byte hasn't even always been defined as 8 bits. Older computer architectures even accessed bytes that weren't a power of 2 number of bits.
>>
>>7903725
I don't even know what a byte or a bit is, my computer just werks.
>>
>>7903725
>>7904006
Just look up what an n-cube is. That's basically the reason why it's impossible to use single bits in complex systems.
>>
>>7903725
Pretty sure you'd need specific processors to work with varying amounts of bits
>>
>>7903725

It has to do with boolean logic and the physical layout of electrical gated pathways.

You can't read an area in memory without physically addressing it with electrical signals to operate the specific gates needed to obtain a value in the first place.

addressing an individial bit requires another bit.

1 bit gateways can address 1 bit
2 bit gateways can address 4
4 bit gateways 8
...
32 bit gatways 4.2 billion (this is where the 4gb limit for 32 bit processors comes from)

hence why we are on 64 bit comluters now and will be for quite some time.
>>
>>7903928
Is this real?
Because with what I've heard from the Japanese it doesn't seem too far off that they upgrade their stone age PCs to WIN8.1 through floppy drives
>>
>>7904913

to be more clear, you could certainy access one bit per cpu cycle if you wanted to, if the memory controller was physically gated in such a way.

.. . but that makes no sense since you probably need to access the next one on the next cycle. why not just grab as many at a time as possible?

it would take 8 clock cycles to grab 8 bits instead of 1.
>>
>>7904913
how long a time till I have to buy Windows' Doors 128 bit OS?
>>
>>7904540
Imagine you're a computer. You've got a stream of data coming at you: all ones and zeros. How do you figure out how many bits each word is? How do you know it's supposed to be interpreted as a 3bit word? Or an n-bit word in general? You can't know this as a computer, so you'll just assume each chunk of 8 bits is a word.
Tl;dr: 8 bits in a byte is a kind of arbitrary choice, but it's the standard.
>>
>>7905097
That's precisely what I posted here: >>7903728

Some asshat here >>7903940 said I didn't know what I was talking about.

You've just reiterated my point. The reason we aren't accessing individual bits isn't technological incapability, it's just a standard in computer architecture that stuck and is still used.
>>
>>7904941
60 years from now.
>>
>>7904916
Dumb weeb.
>>
>>7903725
>Why can't we just address individual bits?
While a single bit wide computer architecture isn't unthinkable, it would be incredibly awkward to design and program. Grouping bits into usable-size bytes and words makes things quicker and easier.
Thread posts: 32
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.