Virtual Memory: 6 Address Translation

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 121

  • @meep6188
    @meep6188 7 ปีที่แล้ว +133

    While my professor just shows us this crap on a slide and just speeds through it, you actually show it and explain it, thank you.

  • @stevenan93
    @stevenan93 7 ปีที่แล้ว +136

    bruh i could have just watched this video all semester

  • @lhsrebel72
    @lhsrebel72 5 ปีที่แล้ว +18

    These videos helped me get a full understanding of this material in about 2 hours, it took my professor two months to attempt and fail to teach it....

  • @poststuff172
    @poststuff172 หลายเดือนก่อน

    My professor has worked at top companies like intel and NVIDIA and lectures this class for 15+ years but cannot make it simple those concepts just as much as you sir! Thank you for sharing these videos for free.

  • @dangray1152
    @dangray1152 8 ปีที่แล้ว +79

    So to clarify, especially for the physical address bits:
    Virtual mem offset= 4KB = 2^12, so 12 bit offset for both virtual and physical.
    32bit machine, 32-12 = 20 bits for virtual address
    RAM is 256MB, 256 = 2^28, 28 * 12 = 16 bits for the physical address

    • @thelump
      @thelump 8 ปีที่แล้ว +30

      28-12**

    • @chrispearson6356
      @chrispearson6356 4 ปีที่แล้ว +9

      Dan, the video is a little confusing.
      On a given computer, physical addresses always have the same number of bits, no matter how much RAM is installed. For example, on a 32-bit system (having 32 address lines), physical addresses always have 32 bits. With 256 MB RAM installed, the highest 4 bits of all *valid* physical addresses would be zero. With 512 MB RAM installed, the highest 3 bits of valid addresses would always be zero. Etc.
      In other words, installing more/less of RAM does not change the size of page table entries.

    • @SuperJosba
      @SuperJosba 4 ปีที่แล้ว

      4KB != 2^12 so it does not cause 12 bit offset

    • @rahulr9301
      @rahulr9301 3 ปีที่แล้ว

      @@chrispearson6356 how the page table size are determined? whether it depends on 32 bit os or 64 bit os like that?

    • @chrispearson6356
      @chrispearson6356 2 ปีที่แล้ว +2

      @Rahul R The details of the virtual addressing system depend on the CPU architecture. The architecture may allow the OS to choose the page size and/or page table size. TMI for this comment. The Wikipedia article "Page (computer memory)" has a table titled "Page sizes among architectures" that has good info on this.

  • @uclocnguyenvo422
    @uclocnguyenvo422 4 ปีที่แล้ว +8

    one of the most underrated channel on TH-cam :( I feel bad for students who do not know this series due to the lack of popularity

  • @weyauh4338
    @weyauh4338 5 ปีที่แล้ว +2

    You probably heard this a thousand times, but your explanations are so beautifully precise and helpful! Thanks so much!

  • @summermoonspace
    @summermoonspace 9 ปีที่แล้ว +1

    I got confused by VA for almost 2 month.. and now this whole stuff becomes clear because of this video. Thanks so much

  • @bear9322
    @bear9322 ปีที่แล้ว

    This video is slightly off topic in accordance to my assignment and yet it still taught me more about my assignment than upper division lectures.

  • @SuperJosba
    @SuperJosba 4 ปีที่แล้ว +1

    By far the best lecture on TH-cam. Thank You!!!

  • @vineet5322
    @vineet5322 3 ปีที่แล้ว

    please, give this guy a medal

  • @omartusson
    @omartusson 2 ปีที่แล้ว +1

    Great video and a very great explanation. To Clarify, The presentation is using MebiByte (MIB) and Kibibyte (KiB) and it's not using Megabyte (MB) and KilloByte (KB).
    so it's 256 MiB = 268, 435, 456 Byte and you can check that since 2^28 also equals 268, 435, 456.
    1 KB = 1000 Byte
    1 KiB = 1024 byte = 1.024 KB
    1MiB = 1024 KiB
    1MiB = 1048.58 KB
    So if the page size was 4 KB it would had contained 4,000 entry
    but since page size is 4 KiB, it contains 4,096 entry (as you can see in the slides)

  • @kavithapriyacj4868
    @kavithapriyacj4868 4 ปีที่แล้ว

    Sir I had wasted three days ...bcz I didn't see it video.. hatsoff for ur level of teaching 🙏

  • @michaelsid2323
    @michaelsid2323 9 ปีที่แล้ว +22

    Thank you... I have a chance to pass my computer systems final.

    • @davidblack-schaffer219
      @davidblack-schaffer219  9 ปีที่แล้ว +2

      Michael Siderius You're welcome to look at the full class online at test.scalable-learning.com, enrollment key YRLRX-25436

    • @TheFcbfan95
      @TheFcbfan95 8 ปีที่แล้ว

      +David Black-Schaffer Hey, Nyckeln verkar inte fungera, skulle du kunna skicka mig en ny? THX!

    • @davidblack-schaffer219
      @davidblack-schaffer219  8 ปีที่แล้ว +1

      +Oskar Friberg make sure you are on test.scalable-learning.com for the trial course and not www.scalable-learning.com

    • @TheFcbfan95
      @TheFcbfan95 8 ปีที่แล้ว

      Thx! I got in, you're awesome!

  • @aliwahid
    @aliwahid 11 หลายเดือนก่อน

    I tried to watch many videos to understand this topic and i learned nothing .. but your playlist is great , thank you for your great explanation

  • @piratevv
    @piratevv 4 ปีที่แล้ว +3

    each page size is 4096, hence 2^12 is 4096. that's how we get the number 12. So 12 bits is sufficient to access an arbitrary byte within a page

  • @fengquansong6475
    @fengquansong6475 9 ปีที่แล้ว

    I am very appreciate this list of videos. I get confused by reading book and this video really explains everything so clear!
    Thank you.

  • @nguyenkien5558
    @nguyenkien5558 ปีที่แล้ว

    This explanation is better than university professor

  • @thegravatrax6461
    @thegravatrax6461 2 ปีที่แล้ว +1

    How did you come up with a 28 bit address space from 256MB of RAM?

  • @VishalThakur-zg7ub
    @VishalThakur-zg7ub 8 ปีที่แล้ว +26

    correction : "physical memory pages" are called frames.

  • @Hentirion
    @Hentirion 7 หลายเดือนก่อน +1

    Very great video and this is 9 years old video.

  • @chrispearson6356
    @chrispearson6356 4 ปีที่แล้ว +2

    The video says the first 20 bits of the virtual address give the "virtual page number". That's not exactly how it works. For example, on Intel x86, there are *two levels* of tables. The high-order 10 bits of a virtual address are used as an index into the first table (called the page directory). That gives the physical address of a page table. Then, the next 10 bits of the virtual address are used as an index into that page table. That gives the physical address of the memory page. Finally, the lowest 12 bits of the virtual address are used as the byte offset into the page.

  • @vortyx090
    @vortyx090 8 ปีที่แล้ว +1

    The explanation is great, and the video is even better, is so clear!! Ty for your work

  • @leeelwin957
    @leeelwin957 8 ปีที่แล้ว

    Thanks David very much, you answered the question which bothered me for years

  • @veerendra.k
    @veerendra.k 9 ปีที่แล้ว

    Thank You! Really Good Explanation. While studying these concepts when I was in college days, I had so many doubts and I thought I understood, but I wasn't

  • @silverreyes7912
    @silverreyes7912 9 ปีที่แล้ว +4

    this is gold. Made perfect sense.

  • @Cruentus
    @Cruentus 3 ปีที่แล้ว +4

    Although the Video talks about KB and MB, it means KiB and MiB.

  • @charlieguan3618
    @charlieguan3618 6 ปีที่แล้ว +2

    A really youtube hero!!!!

  • @brucebigbro4079
    @brucebigbro4079 8 ปีที่แล้ว +1

    thank you very much! this really helps!
    wish i have found your channel earlier.

  • @chapo876
    @chapo876 4 ปีที่แล้ว +3

    how exactly does 256MB of ram give 28 bits?

    • @UsatMVS
      @UsatMVS 3 ปีที่แล้ว +1

      yeah wtf it doesn't
      I guess there's some mistake. Maybe 256MegaBITS he meant idk

    • @yogipro183
      @yogipro183 2 ปีที่แล้ว

      Actually he is right since size of ram is 256MB if we assume 1byte==1word then there are 256M words 2^8*2^20=2^28 words in ram . To access these many words randomly we need 28 address lines(buses).
      There for we can say 256MB RAM==28-bit physical address space.

  • @ZhikunCai
    @ZhikunCai 7 ปีที่แล้ว

    This series is very instructive! Thanks!

  • @timothyang2066
    @timothyang2066 5 ปีที่แล้ว +1

    Hi - thanks for the vid. Could someone give me a bit more insight as to why we always need an offset?

  • @PhilipMachanick
    @PhilipMachanick 8 ปีที่แล้ว +1

    Nice and clear. However, there is no reason to store the virtual page
    number, since it is exactly equal to the index that finds that entry in
    the page table.

  • @unsafemail6073
    @unsafemail6073 3 ปีที่แล้ว

    is Physical Address Extension referred to after this one ? It would be great to see how it fits in. See that with PAE 32bit virtual memory can address even more than 4gb of physical memory. From what I understand it was a commercial decision by hardware driver makers to kill the idea 32 bit O/S's by not supporting that larger address space.

  • @TrixieFromSanFran
    @TrixieFromSanFran 4 ปีที่แล้ว

    I'm confused: If we are assuming word-addressable memory, then why do we need 12 bits for the offset? That many bits for the offset lets us identify individual bytes in the 4KB page, but shouldn't we have just enough offset bits to identify words within the page? So 10 offset bits?

    • @chrispearson6356
      @chrispearson6356 2 ปีที่แล้ว +1

      @Dylan F What you say would be true for a word machine but, per Wikipedia, those are "largely only of historical interest." This video assumes byte addressing.

  • @1107057475
    @1107057475 8 ปีที่แล้ว

    your teaching skills are great Thank you

  • @MagnusTheUltramarine
    @MagnusTheUltramarine 3 ปีที่แล้ว +1

    Wasn't it that each VA had 1024 words (each word 4 bytes), so address 4 should map to physical address 4bytes+4bytes+4bytes (first 3 addresses) = 12bytes, so the offset should be 12 bytes, and address 4096 + 12 = 4108, not 4100 in the last video

    • @MagnusTheUltramarine
      @MagnusTheUltramarine 3 ปีที่แล้ว +1

      unless each address is 1 byte, although you said each one was 4 bytes = 1 word

  • @demirel16
    @demirel16 8 ปีที่แล้ว +1

    Does every process have one common virtual address space?

  • @r1ckydj
    @r1ckydj ปีที่แล้ว

    this is one of the best explanations on memory management. Thank you for doing this. I have a doubt at 1:16. Why does the last 12 bits not get translated? in the previous video @David had mentioned that a page get translated to a page of equal size on ram. In this video, With the introduction of offsets, it became a bit confusing for me. please help. thanks again

  • @harpreetsaini2595
    @harpreetsaini2595 8 ปีที่แล้ว +1

    when swap (virtual memory) in linux is not in use means used memory of swap space is 0 then any TLB is in working mode or not ? please clarify.

    • @chrispearson6356
      @chrispearson6356 2 ปีที่แล้ว +1

      @Harpreet Saini Good question. My understanding is that, on Linux, disabling swapping does *not* disable virtual memory (addressing), because VM is still needed for process memory isolation. Even without swapping, Linux can run multiple processes and it still runs each process in its own virtual address space, to prevent any process spying on or corrupting other processes.
      So I think that VM works the same with swapping disabled except that, when physical memory is exhausted (when all page frames are in use), the OS can't page out dirty pages. Note that it can still discard read-only, file-backed pages (such as program code), and it can still run the out-of-memory algorithm ("OOM killer") to free up memory by killing some process.
      How does VM isolate process address spaces? Each process has its own set of page tables and the OS makes sure that no physical page frame is used by more than one process. (Except in the case of shared memory, where processes intentionally want to access the same memory).

  • @ag-perez
    @ag-perez 4 ปีที่แล้ว

    0:35 calculation is true only if the machine in question has byte-level addressing.

  • @keithscull8288
    @keithscull8288 9 ปีที่แล้ว

    QUICK question, this part wasn't too clear to me, but once the remaining 20 gets translated through the map to the PA, you say the PA becomes 16.. IS this because we're assuming as in the last video, that we're mapping from VA 4, to 20 - 4 = 16? Is that why the PA here was 16???

  • @msn.muddam
    @msn.muddam 3 ปีที่แล้ว

    what if I have 64 bit address with page size of 4 kilo bytes and the system having a 4 GB RAM?

  • @PrincessMomina
    @PrincessMomina 9 ปีที่แล้ว

    Totally amazing and helpful tutorials. Thank you

  • @jyotirmayaojha6516
    @jyotirmayaojha6516 7 ปีที่แล้ว +4

    shouldnt 256 MB translate to 2^28 bytes instead of 2^28 bits (since its B not b).

    • @nimragauhar4838
      @nimragauhar4838 6 ปีที่แล้ว +3

      okay i had the same exact question and i figured it out!
      how he figures out the size of each memory and the offset and the page address bits:
      Question is:
      What happens to a 32-bit Machine with a 256MB RAM abd 4KB pages.
      from what we are given:
      it says 32 bit machine that means that the virtual machines total bits are 32.
      VM:
      -----------------------------------
      -----------------------------------
      then they tell us that the RAM is 256MB:
      256= 2^8
      and M indicates 2^20 -> there is a table for this.
      where K=2^10 , M=2^20, G=2^30 . . . and so on.
      so 256MB is same as (2^8)(2^20)B
      adding the powers we get
      2^28 B for the RAM
      note that 2^28 B is same as 256MB
      but since memory is measured in terms of bytes
      the power of 2 of that Byte indicates the bits
      kinda like a rule.
      now we know that
      RAM:
      -----------------------------------
      -----------------------------------
      now we need to know the page offset?
      how do we figure that out?
      simple if we know the size of the page which the question gives us as 4KB
      now 4KB is same as (2^2)(2^10)B-> (2^12)B
      B is a standard now so the power of 2 will be the bits needed
      that means the page offset is 12 and its same for both VM and RAM
      VM:
      -----------------------------------
      ----
      ---------------------------------------
      < (32-12)bits > |
      VM address |pageOffset
      RAM:
      -----------------------------------
      ----
      ---------------------------------------
      < (28-12)bits >|
      RAMaddress |pageOffset

    • @asdf256
      @asdf256 5 ปีที่แล้ว

      @@nimragauhar4838 How does 2^3 = 256?

    • @asdf256
      @asdf256 5 ปีที่แล้ว

      @@nimragauhar4838 Further, how does (2^3) * (2^20) = 2^28 ???

    • @nimragauhar4838
      @nimragauhar4838 5 ปีที่แล้ว

      @@asdf256 I edited my reply. I made a typo there. Instead of 2^3 it's 2^8 which makes sense as 2^8 is actually 256. And that would answer your other question too. So 2^8 * 2^20 = 2^28.

    • @UsmanJabbar905
      @UsmanJabbar905 4 ปีที่แล้ว

      @@nimragauhar4838 Thank you so much! I was so confused how he got those values!

  • @virtuousjoffrey8022
    @virtuousjoffrey8022 4 ปีที่แล้ว

    How does he get 28 bit physical address? Anyone care to show the calculation?

  • @letsfets8021
    @letsfets8021 8 ปีที่แล้ว

    hi do you offer some more private online lectures which is going more in detail with paging? I need this for my exercise and i never understood it and my university doesnt explains it clearly

  • @kunalsinghgusain2070
    @kunalsinghgusain2070 7 ปีที่แล้ว

    Thankyou very much.
    Really great explaination you taught every part of the topic.
    The people who disliked this video maybe were not smart enough to figure out obvious info themselves.

  • @vinaydivakar6688
    @vinaydivakar6688 7 ปีที่แล้ว

    Beautifully explained!

  • @hda90
    @hda90 3 ปีที่แล้ว

    @7.28 you are actually wrong. For a 32 bit system, maximum 4GB of RAM is accessible, beyond that is inaccessible. So, Page table will not be helpful if we are going beyond 32 bit address lines.

  • @MicEE2998e5
    @MicEE2998e5 4 ปีที่แล้ว

    So is it 1 byte per word?

  • @CptDoge-rn3ou
    @CptDoge-rn3ou 7 ปีที่แล้ว

    Very helpful ! Great presentation :)

  • @johnlight-knight8060
    @johnlight-knight8060 6 ปีที่แล้ว +1

    What about logical Adress??

  • @junepaulcuajotor3777
    @junepaulcuajotor3777 4 ปีที่แล้ว

    how did you convert the 256mb of ram to 28 bits physical address?

    • @NSN2195
      @NSN2195 4 ปีที่แล้ว

      256 MB = 256 * 1 MB = (2^8) * (2^20) = 2^28 bytes (locations) in memory. So we need 28 bits to address all of them.

  • @vaidehipatel7647
    @vaidehipatel7647 8 ปีที่แล้ว

    i lke ur teaching and the presentation! :) thank you

  • @CSshreyas
    @CSshreyas 8 ปีที่แล้ว

    nice series,thanks for the videos

  • @babythedude
    @babythedude 7 ปีที่แล้ว

    Why do 20bits tell you it goes to virtual number 0, while 16bits tell you to go to physical page number 1?

  • @milicajevremovic1891
    @milicajevremovic1891 8 ปีที่แล้ว +1

    this is great, thank you so much!

  • @smitjainsj
    @smitjainsj 8 ปีที่แล้ว

    A big thanks to your sir.. These are best Memory Related Videos I have seen.. Please keep it going!!!! :0

  • @knotfkingaround90
    @knotfkingaround90 9 ปีที่แล้ว

    If had sixteen plus gigs of virtual r.a.m; would it made a substantially difference??

    • @knotfkingaround90
      @knotfkingaround90 9 ปีที่แล้ว

      ***** What?

    • @keithscull8288
      @keithscull8288 9 ปีที่แล้ว

      +purple elf I have a question, so, for example as you said, well let's take an easier example like 32 BITS assumes 4 gb of memory, because 2^32 = 4294967296, 4294967296 BYTES are approximately 4 gigs. So, if we're converting BYTES to gigs to render that answer, why do we say a 32 BIT system? It seems to me we take the amount of BITS and bring 2 to the power of that and suddenly THAT answer becomes the BYTE amount, which we convert to gigs to figure how much memory MIPS promises us via our Virtual address.. but that makes no mathematical sense, because 8 bits is a byte

    • @keithscull8288
      @keithscull8288 9 ปีที่แล้ว

      Purple elf thanks so much for the response. In regards to the commodore example, I understand completely how you came up with 64 kb, but I'm confused as to the 32 bit 4 gig example.. So for the commodore example,
      2^16 * 8 = 524288 bits of addressing space converted to kb = 64 kb address space, GREAT, that works out for me, I understand.
      BUT, the 32 bit system example.. not so much:
      2 to the power of 32 = 4294967296 bytes
      4294967296 / 32 = 134217728 BITS
      134217728 bits converted to kilobytes = 16777.216 kb of addressing space, but we know we have 4 kb of addressing space, not over 16 thousand.. o.O help? lol thanks

    • @keithscull8288
      @keithscull8288 9 ปีที่แล้ว

      At least I know my math isn't that terrible.. haha thanks bud, IOP is input output per second right? Geez with 2^4096 wouldn't the addressing space per page's OFFset be enormous ? All those unused bytes

    • @keithscull8288
      @keithscull8288 9 ปีที่แล้ว

      Lol so You're telling me with that much address space it would be able to store data telling you if you've opened the picture file before or not

  • @ludvikbrodl1001
    @ludvikbrodl1001 8 ปีที่แล้ว

    Great video, thank you.

  • @oiverarmandoch
    @oiverarmandoch ปีที่แล้ว

    are 'page table' the same as 'translation table'

    • @w0nnafight
      @w0nnafight ปีที่แล้ว

      you ask too many questions

  • @eitanwisberg4746
    @eitanwisberg4746 2 ปีที่แล้ว

    Wait so we don't need to translate the page offset?🤔🤦

  • @flintthuang
    @flintthuang 8 ปีที่แล้ว

    amazing explanation!

  • @mathialagant
    @mathialagant 2 ปีที่แล้ว

    I really like the questions part

  • @meddh1065
    @meddh1065 2 ปีที่แล้ว

    amazing job !

  • @nat0041
    @nat0041 4 ปีที่แล้ว

    i want to give you a hug

  • @thanasistigk1425
    @thanasistigk1425 7 ปีที่แล้ว

    that was very helpful thank you

  • @SarbotamChatterje
    @SarbotamChatterje 8 ปีที่แล้ว

    can david sir or anyone solve a problem based on offset please?

  • @s33king81
    @s33king81 ปีที่แล้ว

    Best. Super clear. Thanks so much.

  • @xiecyan5724
    @xiecyan5724 7 ปีที่แล้ว

    very good tutorial

  • @Knechtspieler
    @Knechtspieler 2 ปีที่แล้ว

    thank you very much

  • @Petioptrv
    @Petioptrv ปีที่แล้ว

    One thing I’m still not clear on is, is the page offset translated?
    Just kidding. Great explanation!

  • @diwang4572
    @diwang4572 3 ปีที่แล้ว

    Thank you!

  • @hsyoon2778
    @hsyoon2778 4 ปีที่แล้ว

    Thank you sir!

  • @call_me_mechanic
    @call_me_mechanic 8 หลายเดือนก่อน

    Thank you

  • @ΝικοςΜαυρος-τ3υ
    @ΝικοςΜαυρος-τ3υ 6 วันที่ผ่านมา

    bro u r goat

  • @silas3463
    @silas3463 4 ปีที่แล้ว

    This is great

  • @mateusz-czajkowski
    @mateusz-czajkowski 3 ปีที่แล้ว

    am I the only one who watches these videos because wants to know how this all works "underneath" from programmer perspective?

  • @SureshBabu-de5wm
    @SureshBabu-de5wm 4 ปีที่แล้ว

    Good Pretsentation

  • @ianjones7440
    @ianjones7440 7 ปีที่แล้ว

    you could have explained what's the functions of the physical and virtual memories.. It's kind of hard to learn until you know what it is your learning lol

  • @mohamedkhairdimashky67
    @mohamedkhairdimashky67 7 ปีที่แล้ว

    Thanks a lot man!

  • @MrGowrishankar5
    @MrGowrishankar5 7 ปีที่แล้ว

    thank you ...

  • @skolazdola4854
    @skolazdola4854 6 ปีที่แล้ว

    The upper 20 bits of virtual memory gets translated. Nothing more in this video.

  • @narendrakrane
    @narendrakrane 6 ปีที่แล้ว

    Oookkk... We got that... "OFFSET IS NOT TRANSLATED".....

    • @123gregery
      @123gregery 7 หลายเดือนก่อน

      yes, it's the only thing I understood

  • @selvalooks
    @selvalooks 2 ปีที่แล้ว

    vow vow vow !!!

  • @johntharwat5950
    @johntharwat5950 5 ปีที่แล้ว

    Finally a normal English not Indian guy saying "hay doday a gonna dalk aboud sbsbabshsh"

  • @luckybairagi7294
    @luckybairagi7294 3 ปีที่แล้ว

    but 32bit computer doesn't support 8GB of ram, ryt?

  • @subee128
    @subee128 10 หลายเดือนก่อน

    Thank you very much