GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  Operating System
Go To First  |  Previous Question  |  Next Question 
 Operating System  |  Question 91 of 94    Print  
Memory Mapped Input / Output
What is the difference between memory mapped i/o and i/o mapped i/o?


  
Total Answers and Comments: 1 Last Update: October 04, 2008     Asked by: dim2k8 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 03, 2008 23:58:44   #1  
sk_seeker Member Since: December 2007   Contribution: 43    

RE: Memory Mapped Input / Output
This question can be answered at two levels.
+ First, what is memory and IO mapped IO?? Advts and disadvts, etc
+ Why were they invented?? I.e. a Comp Arch History Perspective

Both methods are used to communicate with IO peripherals connected to a CPU.

IO Mapped IO
IO mapped IO uses special instructions in the ISA to work with IO devices: to transfer data to IO devices as well as to control them. This scheme is generally found in Intel processors. The instructions are IN and OUT instructions. These instructions can read and write one byte at a time to an IO device.

Pros
+ Solves the limited memory addressability problem as no memory address range needs to be set aside for IO space.
+ Separate IO bus => no performance impact to memory traffic

Cons
+ Substantially slower than memory-mapped IO due to strict ordering(consistency) requirements.
+ CPU chip design needs to support IO port logic
+ IN/OUT are assembly instructions i.e. cannot be programmed in a high level language like C, without using nasty macros.
+ Limited IO port space

Memory Mapped IO
There is a protocol followed in hardware when a CPU wants to read a byte from a virtual address that it generates. The protocol goes something like this:
+ On the address bus, CPU places the virtual address.
+ On the control bus, a READ(LOAD) or a WRITE(STORE) is placed.
+ On the data bus, for a Store, the data to be stored in memory is placed and the CPU waits.
+ When the memory operation is done, CPU has got the data.
If the same protocol above can be followed by an IO device, then the CPU can address IO devices just like any memory location.  

Memory mapped IO maps the device (device memory and device control registers) into the CPU address space, just like the CPU maps physical memory. This leads to a uniform addressing mechanism, whether the target address is a memory location OR an IO device && also note that the same bus is used for both memory and IO traffic. But, the memory and IO address ranges have to be separate. I/O devices monitor the CPU's address bus for an IO address && respond back if the address matched the device-assigned address. 

Pros
+ Uniform memory addressing scheme: CPU chip design can throw out IO Port logic
+ Easily programmable in a high level language like C. We can use things like memcpy(), etc.
+ Much much faster than IO mapped IO (100x)
+ Huge address space compared to limited IO port space
+ Most CPU memory addressing modes now available to IO space access also.

Cons
+ Memory and IO bus share same buses (address and data bus) i.e. may need a separate IO bus to divert IO traffic.

Computer Arch perspective
When life began for CPUs, we had limited memory addressability. Setting aside some of it for IO space was difficult, especially as IO space consumption increased. So, separate memory and IO address spaces were invented. But, a portion of the ISA (Instruction Set Architecture) Op code space had to be reserved for IO space operations. This was okay as the no of opcodes in an ISA were also small, when life began. Separate IO space was also accompanied by a separate IO bus i.e. memory and IO operations did not impact each other directly. 

But, life started getting complicated for CPUs. Memory addressability increased over time, and setting aside some IO space in the memory addressability range was no longer a problem. So, we now could address both memory locations and IO devices through the same protocol, with the only restriction that memory and IO address space had to be mutually exclusive ranges. Since both memory locations and IO devices are addressed using the memory bus, there is a potential for impacting performance for each other. But, this is usually mitigated by a separate IO bus. 


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer :  differnt memory mangement techniques r Paging and Segmentation ...
Read Answers (1) | Asked by : Vidya

What is cache memory? Can we increase cache memory size as large as a hard disk(40GB)? What are the adv and disadv? What is diff betn swap(solaris) and cache?

Latest Answer : in memory mapped i/o the data transfer is like between two memory segments..i.e the i/o port  is referred by a memory address.where in i/o mapped i/o we use specific command and i/o port is not mentioned as a memory address. ...
Read Answers (1) | Asked by : bajjuri thirupathi

Memory protection is normally done by the 1. processor and associated hardware 2. operating system 3. compiler 4. user program
View Question | Asked by : Rujul

The term "non volatile memory" states 1. that memory is retained in the memory unit for some time even after power failure to the memory unit 2. that memory is lost by power 
Latest Answer : The answer is D: (i.e.) data is retained in the non volatile memory even years after power failure to the memory unit provided the memory unit does not get corrupted or crashes down. ...
Read Answers (1) | Asked by : Rujul

Latest Answer : hi vinay thanks for your ans but i could'nt understand plz give me ans with detail ...
Read Answers (2) | Asked by : prabu.se

While executing a process some of pages are stored in main memory and some in virtual memory. if computer do not get required page in main memory then how it find exact location of that page in virtual memory.
Read Answers (1) | Asked by : Vaibhav Gupta

View Question | Asked by : Anoop

Latest Answer : Hai When we use the application goes to over the RAM capability some amount of space in the HDD act as a RAM for  managing the application.that is called Virual memory.if the system running in virtual memory it is slow than RAM based running.bcoz ...

What is the difference between memory mapped i/o and i/o mapped i/o? 
Latest Answer : This question can be answered at two levels.+ First, what is memory and IO mapped IO?? Advts and disadvts, etc+ Why were they invented?? I.e. a Comp Arch History PerspectiveBoth methods are used to communicate with IO peripherals connected to a CPU.IO ...
Read Answers (1) | Asked by : dim2k8


 Sponsored Links

 
Related Articles

C++ Memory Management operators

C Memory Management operators Need for Memory Management operators The concept of arrays has a block of memory reserved The disadvantage with the concept of arrays is that the programmer must know while programming the size of memory to be allocated in addition to the array size remaining constant m
 

C++ Standard Input Output Stream

C Standard Input Output Stream In this C tutorial you will learn about standard input stream and standard output stream explained along with syntax and examples C programming language uses the concept of streams to perform input and output operations using the keyboard and to display information on
 

What is Bit Mapped Index

Bit Map Indexing is a technique commonly used in relational databases where the application uses binary coding in representing data. This technique was originally used for low cardinality data but recent applications like the Sybase IQ have used this technique efficiently. The word cardinality is
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

System Implementation

In the previous articles relating to SDLC Stages we discussed about Project Planning and Feasibility Study moved on to System Analysis and Requirements which lead to Systems Design. Systems Design will naturally lead to another stage where it becomes closer to the actual deployment of the p
 

System Analysis and Requirements

In the previous chapter, we’ve discussed about project planning and feasibility study. That stage was important because it tries to establish a problem in our highly technological world. As our understanding on what we can do in computers evolve and so are the things that we need to make t
 

Operating Systems and IT Certification

With the burst of information technology that is becoming a part of the dominant culture throughout the world, are programs that are designed to help those in this area to grow in knowledge.  By understanding the different technologies that are available, one is able to use them and impleme
 

How To Determine If Your CRM System Will Fail

How To Determine If Your CRM System Will Fail One of the primary reasons why many CRM systems fail is because of the quality of the data Even if you are using a high end CRM system your company will have no chance of success if it is processing data that is incorrect or faulty Fortunately data quali
 

How Consistent Practice Can Help You Improve Your Memory

How Consistent Practice Can Help You Improve Your Memory Researchers have known for a long time that learning a skill in set intervals is the best way to master it Instead of teaching someone a large number of things at once they learn better when the information is split apart in sections mosgoogle
 

Intelligence and Memory

Intelligence and Memory If you wish to improve your memory you will also need to understand the nature of intelligence Intelligence is currently broken down into two categories and these are crystallized intelligence and fluid intelligence mosgoogle Crystallized intelligence deals with the brain pro
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape