From mboxrd@z Thu Jan 1 00:00:00 1970 From: michael@kjorling.se (Michael =?utf-8?B?S2rDtnJsaW5n?=) Date: Mon, 18 Sep 2017 11:59:44 +0000 Subject: [TUHS] And now ... Weirdnix? In-Reply-To: <20170918103911.2bok6nfjpbbm6cqq@client.local> References: <8AA943A2-D6C0-4812-9C16-C09D1298754F@tuhs.org> <20170917144909.DB27FA585CB@yagi.h-net.msu.edu> <201709180831.v8I8V6LB021088@freefriends.org> <20170918103911.2bok6nfjpbbm6cqq@client.local> Message-ID: <20170918115944.GC19358@6A257D6BF119422186439413BD282393> On 18 Sep 2017 12:39 +0200, from andreas.kahari at icm.uu.se (Andreas Kusalananda Kähäri): > I've been wondering about this for some time, if a byte isn't 8 bits on > an architecture, how would you go about calculating memory sizes in a > way that makes it comparable between machines? > > A 32 KB memory buffer is 262144=32*1024*8 bits on one machine, but > 294912=32*1024*9 bits on another. That's a difference of 32 Kbit. > > [snip] > > Maybe this isn't/wasn't an issue at all? Memory _chips_ are often specified in terms of accessible bits. So you might have a chip that can hold _(8 * 2^20) * 8 bits_, or eight binary megabytes for the case where 1 byte == 8 bits. The same chip could be specified as _(64 * 2^20) * 1 bits_ for 64 binary megabits. This would normally be written 8Mx8 or 64Mx1 for a binary "M" prefix. How you then use those bits is entirely up to the system integrator and software developer. And we do know that on systems with limited memory, bit-packing is a common practice, based on the mantra that "no good bits should ever be allowed to go to waste". This notation has the benefit that it relates directly to how much data can be held, as opposed to _how_ that data is held. -- Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se “People who think they know everything really annoy those of us who know we don’t.” (Bjarne Stroustrup)