Click to See Complete Forum and Search --> : addressing more than 100 floors


HypnotiC
September 12th, 2004, 09:47 AM
hey ... assume that i have a building with 100 floors . and i have 2 bit decimal counter from 0 to 99.
now if i want to increase the building for more than 100 floors .... how can i address the extra floors while i have just 2 bit counter .... for example how can i address 105, 110 .....152.......... etc

this problem is an example of registers addressing in the CPU .... i need a mathematical relation to implement this.

I hope u understand me friends ....

Thanks.

RoboTact
September 12th, 2004, 02:16 PM
Yet I do not understand. You can adress extra amounts of data using extra registers (couple or more)... What do you want? Do you want to adress all the 100+ items by the same 2 dec bits? Or to use a couple of that two-dec-bits values to adress it? Anyway I can't catch the problem: first is obviously wrong, and second is simple to implement...

mehdi62b
September 12th, 2004, 03:37 PM
I think you mean something like CS:IP we have in CPU

if so,you should use one of your counter as address counter and the other one as an offset counter ....

in this way you could address 10^4 floors with two decimal counters, instead of 10^2 floors while using just one counter ....
Address=Counter1*100+counter2
Does this clarify things?

---------------
Mehdi.:)