l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
December 2: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2010 Jun 23 18:37

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] =?utf-8?q?_Memory_addressing=3F?=
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] =?utf-8?q?_Memory_addressing=3F?=



> -------- Original Message --------
> Subject: Re: [vox-tech] Memory addressing?
> From: "Chanoch (Ken) Bloom" <kbloom@gmail.com>
> Date: Tue, June 22, 2010 9:46 am
> To: lugod's technical discussion forum <vox-tech@lists.lugod.org>
> 
> 
> On Tue, Jun 22, 2010 at 09:11:44AM -0700, Brian Lavender wrote:
> > Can someone confirm what is correct? 
> > 
> > Tim and I were discussing memory addressing at Crepeville last night
> > and we had a disagreement about how memory is addressable. I say that
> > on today's common intel i386 32 bit architecture (in case you are one of
> > those souls who builds your hardware from scratch), that memory is byte
> > (octet) addressable. You can load a byte from memory into the lower 8
> > bits of a register. Tim says that memory is only addressable on 32 bit
> > word boundaries.
> > 

I stand corrected. Now that I have my hardware textbook open,
Tanenbaum 1990, I see that the smallest addressable unit on most
computers
is the byte -- 8 bits. Bytes are grouped into words. The word-length is
the size of the registers, not registers and memory.

<snip>

> Consider the following program. The fact that you can get pointers to
> arbitrary characers should be enough proof that the architecture is
> byte addressable.

Tanenbaum calls the smallest addressable unit a cell. He then lists
examples
of cell lengths for 11 computers. Before cells were standardized
to 8 bits, they ranged from 1 bit to 60 bits per cell. Therefore, a 60
bits per cell computer would store a single ASCII character in the
lowest
7 bits and set the upper 53 bits to off (probably). You could then
allocate
a pointer to address that 60 bit cell.

The reason for the discussion was Brian's intrusion detection
implementation stored the incoming packets in a hash
table. The key to the hash table was quite
large -- inbound IP address, outbound IP address, inbound port, and
outbound port. I thought to my self, on a very large implementation (say
Google) the table could grow to a billion entries. Could a hash table
store this amount in memory? Could you allocate an array of half the
total memory? Could you allocate an array of a billion integers? Brian,
on his laptop, couldn't allocate a billion integers. But he could
allocate a billion characters (bytes). Since I thought both bytes and
integers were words, and since I thought memory stored words
like registers stored words, we had our discussion.

The following failed to compile with an array-to-large error:
int main( void )
{
     int table[ 1000000000 ];
     return 0;
}

The following succeeded to compile:
int main( void )
{
     char table[ 1000000000 ];
     return 0;
}

This compiles but core dumps:
#include <stdio.h>
int main( void )
{
     char table[ 1000000000 ];
     printf( "Hello world!\n" );
}

<snip>

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.