2
$\begingroup$

I'm stuck on a point while reading about these different accessing methods. As per author.

Sequential access

Memory is organized into units of data, called records.Access must be made in a specific linear sequence.

I understand that it will take variable time to access due to sequential ordering.

Direct Access

individual blocks or records have a unique address based on physical location.Access is accomplished by direct access to reach a general vicinity plus sequential searching,counting,or waiting to reach the final location. Again, access time is variable.

Here I'm Stuck that if we have unique address why it is taking variable time and why we can't directly access data.

Random Access

Each addressable location in memory has a unique,physically wired-in addressing mechanism. The time to access a given location is independent of the sequence of prior accesses and is constant.

What is the difference between this and direct access method.

$\endgroup$

4 Answers 4

0
$\begingroup$

Yeah, me i say, with DIRECT access, only addresses are known and kept, so as you try to read or write, the data contained in those memory addresses the computer is iterating through is never looked at/opened but only the data kept in the address you are trying to read or write to is the one opened.

This differs from RANDOM, as random has a mechanism of storing each memory address independent of the other, therefore, accessing it does not require iterating through the rest of the memory addresses thus the name, random access, e.g. our RAM uses this.

For the SEQUENTIAL, this follows a certain linear format and therefore for you to access data maybe on address 2020, you have to first read the data from 1-2019 before getting to the required data, hence the term sequence(step by step). a good example are the Tapes..

$\endgroup$
1
  • $\begingroup$ I don't quite follow your explanations. You are talking as if the memory addresses were kept in memory !? $\endgroup$
    – user16034
    Commented Aug 4, 2022 at 10:05
0
$\begingroup$

The text says it: direct access works by sequential search from a neighboring location (such as the start of a block known to contain the desired data). Though the search should not be long, the number of searched positions is variable.

As far as I know, this peculiar definition is rarely met, and usually direct and random access are synonymous.

Also, do not confuse with direct memory access which is a mechanism by which hardware devices can access the RAM memory without intervention of the CPU.

$\endgroup$
0
$\begingroup$

Although both direct and random access terms can be used interchangeably, based on the definitions mentioned it might give rise to slightly different meanings. This could be one of the possible interpretations of the definitions.

Direct Access

individual blocks or records have a unique address based on physical location.

Here the block size may be dependent on the application/scenario. For example: Different filesystems, RDBMS, etc have different block sizes. So you have a direct access to the base address of the block and then you search sequentially till the desired data is found. As an example, this is how paging works to locate the instruction in main memory. It is evident that you can access only those locations directly which are at the block size boundaries, and after that you will on average have to perform $blockSize/2$ queries to get the required data.

Random access

Each addressable location in memory has a unique, physically wired-in addressing mechanism.

Essentially here it says you can access any memory address, so this definition deals with a lower level of abstraction than the definition above. Hypothetically, with these definitions, Random and Direct access would be the same if the block size would be the same as word size for a given system. A possible but bad example, on a 64-bit machine, accessing an array of int64_t in C.

$\endgroup$
-1
$\begingroup$

Sometimes, depending on the sources,direct access and random access are used to express the same memory access mode and therefore do not present any substantial difference in the speed of data access.

More in detail, the differences between the two modes can be sought in their implementation: Random Access can be realized directly via RAM memory wiring, while direct access can use secondary storage; in this case is obvious that random access is faster than direct access.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.