• C

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
DJ_AM_JuiceboxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
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.
0
Infinity08Commented:
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 ?
0
Kent OlsenData Warehouse Architect / DBACommented:

Emulator.  Now THERE's a word that I've gotten to know well in recent years, having written several.  :)

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

This suggests to me that the machine does a form of BCD math, as that's pretty typical of machines that natively operate on character (ASCII, EBCDIC, etc.) data.  IBM built an entire industry doing character based math, though they support a lot more than just those two types.

Memory therefore probably looks like:

  unsigned char Memory[600][4];

"Word addressable" suggests that memory is accessed via Memory[word] and is transferred to/from a CPU register 4 bytes at a time.  The emulator (and hardware implementation) can not access memory as Memory[word][byte].


Good Luck,
Kent
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
INTRODUCING: WatchGuard's New MFA Solution

WatchGuard is proud to announce the launch of AuthPoint, a powerful, yet simple, Cloud-based MFA service designed to eliminate the vulnerabilities that put your data, systems, and users at risk.

Infinity08Commented:
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).
0
DJ_AM_JuiceboxAuthor Commented:
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............
0
Infinity08Commented:
>> 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.
0
jkrCommented:
Well, then the term "a group of bits or digits/characters processed as a unit" also applies ;o)
0
Infinity08Commented:
Sure jkr ... I just wanted to go a bit deeper into this ... ;)
0
grg99Commented:
four decimal digits, that could be done with a 16-bit word. Use 4 bits per digit.

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

I think that has already been mentioned ;)
0
Kent OlsenData Warehouse Architect / DBACommented:

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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.