Thread: virtual page question

  1. #1
    Registered User
    Join Date
    Apr 2009

    virtual page question

    An other, question how do I figure how many bits are needed for an offset, how many physical page and how many virtual pages. again using 8 bit addressing. 64 bits phyical memory and a page size is 16 bytes.

    This what I think I have.

    5 bits for the offet.

    for the virtual page, 2^8= 256, then 256/16 for 16 virtual pages

    Physical pages are 7.

    Am I right or totally wrong?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    64 bits phyical memory
    That's definitely wrong.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Apr 2009
    Quote Originally Posted by CornedBee View Post
    That's definitely wrong.
    the 64 bits of physical memory was given by my professor. He knows that it is not realistic.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Toronto, ON
    Quote Originally Posted by uscuba2 View Post
    64 bits phyical memory and a page size is 16 bytes.
    16 bytes = 128 bits = twice as much memory as you've got.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    Perhaps it's meant to be 64 BYTES?

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Portland, OR
    Uh, are we sure the instructor doesn't mean a 64-bit address space? In other words a memory size of 2^64?

    64 bits is 8 bytes. Yet a page size of 16 bytes? That's nonsense. I have to believe he meant 2^64 bytes, not 64 bits.
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-17-2008, 01:00 PM
  2. page fault
    By George2 in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2008, 06:27 AM
  3. Virtual Keyword
    By Shal in forum C++ Programming
    Replies: 6
    Last Post: 05-18-2006, 11:37 AM
  4. Microsoft Virtual PC question
    By Lionel in forum Windows Programming
    Replies: 2
    Last Post: 07-24-2005, 11:09 PM
  5. C++ XML Class
    By edwardtisdale in forum C++ Programming
    Replies: 0
    Last Post: 12-10-2001, 11:14 PM