Link to home
Start Free TrialLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

Word addressable?

Hi,

I'm trying to read some spec for an emulator, and I've come across this sentence:

"The machine is word addressable and has a memory of 600 words, each consisting of 4 decimal digits"

What is a word though? I'm interpreting that like:

      memory[600];   // memory is a type that can hold numbers 0 - 9999.

but that's not like any data type I've heard of (char, short, int, float, double) don't have such a range definition. Am I missing what this is? (well I know I am, can anyone explain?)

Thanks
Avatar of jkr
jkr
Flag of Germany image

A "word" is usually defined as "a group of bits or digits/characters processed as a unit" (see also http://en.wikipedia.org/wiki/Word_%28computing%29) . To quote that article further

"The size of a word is reflected in many aspects of a computer's structure and operation. The majority of the registers in the computer are usually word-sized. The typical numeric value manipulated by the computer is probably word sized. The amount of data transferred between the processing part of the computer and the memory system is most often a word. An address used to designate a location in memory often fits in a word"

So, a 32bit system has a word size of four bytes, 1 1bit one of two etc.
That doesn't explain why a word on this machine consists of 4 decimal digits ... Is this an actual machine ? (which ?) Or is this just a theoretical exercise ?
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would assume that if it's BCD, then it's 2 bytes per word, and not 4 (ie. 2 decimal digits per byte - 1 decimal digit per nibble).
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

ASKER

It may well be a real machine, but this is just an excercise from a brain teaser book. I guess they mean:

unsigned char [600][4] cause the grammar that goes along with it comes in blocks like:

    1004
    9049

and they say you ignore the first character and the last three characters are the memory address. Then they go on to show how this is out of memory range:

     2780

            ->   780 > 600

Yeah............
>> but this is just an excercise from a brain teaser book.

That's what I thought :) It sounded a bit too theoretical heh. 600 words of main memory is a bit small for most practical uses.


>> I guess they mean:
>> 
>> unsigned char [600][4]

Not necessarily, because they didn't relate the decimal digits to bytes. There might be 2 digits per byte of 8 bits. Or maybe a byte is only 4 bits wide ... Maybe the machine uses some kind of 10-state storage cell, instead of a binary one (as long as we're dealing with a theoretical exercise, why not ;) )

My point is that the actual storage apparently doesn't matter, so a more accurate way to model the memory is probably something like this :

        decimal_digit word[4];
        decimal_digit memory[600][4];

where decimal_digit is a type that can hold a decimal digit.
Well, then the term "a group of bits or digits/characters processed as a unit" also applies ;o)
Sure jkr ... I just wanted to go a bit deeper into this ... ;)
four decimal digits, that could be done with a 16-bit word. Use 4 bits per digit.

>> four decimal digits, that could be done with a 16-bit word. Use 4 bits per digit.

I think that has already been mentioned ;)

Hi Infinity,

I stand by the 600x4 configuration based on the term 'decimal digits', though nothing is certain as this is merely an exercise..

Had "packed decimal" (or similar) been intended, I feel sure that it would have been indicated.


Kent