![]() |
| | #1 |
| DESTINY Join Date: Jul 2008 Location: in front of my computer
Posts: 803
| microprocessor I dont know why I always get stuck in the microprocessors things. I'm having a course of 8086 microprocessor. I ahve following questions. Please answer them in detail- 1. The address bus is of 20 bits, so this means that 8086 can access 1M of memory. I dont understand what this means. Does this mean that we can attach 1M of RAM to it? Please explain in detail as if you are explaining a real stupid. Really I'm a real noooooooooob when it comes to deal with memory and registers. 2. Why does the 8086 need 4 segment registers of 64K? I've also read 8085 but there was no need of such segment registers. I have gone through my book and few websites but none of them explains the memory part in detail. Thanks
__________________ HOPE YOU UNDERSTAND....... By associating with wise people you will become wise yourself It's fine to celebrate success but it is more important to heed the lessons of failure We've got to put a lot of money into changing behavior PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D. IDE- Microsoft Visual Studio 2008 Express Edition |
| BEN10 is offline | |
| | #2 |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,212
| BEN10 you know our policy here about homework! But since I don't actually know the answer for a fact, I will give you a clue about what I would guess (in an educated way) for #1: How big can an (unsigned) int be if it is 20 bits long? In other words, what is the largest number you can represent with 20 bits, if the smallest is 0x0? A much less educated guess for #2 has something to do with the number of instruction pointers maintained by the processor. Last edited by MK27; 09-10-2009 at 11:19 AM. |
| MK27 is online now | |
| | #3 |
| Super Moderator Join Date: Sep 2001
Posts: 4,746
| In each case, the limit is because you have a binary number of a certain length stored in a certain device. The maximum value of that number is how much memory that device can address. |
| sean is offline | |
| | #4 |
| Malum in se Join Date: Apr 2007
Posts: 3,188
| An 8086 wired in Harvard configuration can address 4MB of memory, warning this is an advanced configuration used (AFAIK) only in embedded designs and your instructor is unlikely to have even heard of it, so I wouldn't mention it in class. 4 segment registers are needed because, well, they aren't really needed, they just make the processor more flexible.
__________________ Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off. |
| abachler is offline | |
| | #5 |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 877
| A couple of keywords to search for would be "Protected mode", "Gate A20", and snot, it left. About 3 years ago I had to write a boot loader for an i486 clone. I actually _had_ to learn all that crap to get it to work, however, I cannot recall what any of the terminology means at the moment. |
| Kennedy is offline | |
| | #6 |
| DESTINY Join Date: Jul 2008 Location: in front of my computer
Posts: 803
| @MK27 This is not a homework I'm not asking for someone to code something for me. I'm just asking for make the concepts clear to me. And yes I do know that 2^20=1M, but what I dont understand is what this means? The resources say that it can address 1MB of memory, here is where I get confused. So, please if somebody know it better help me in understanding it.
__________________ HOPE YOU UNDERSTAND....... By associating with wise people you will become wise yourself It's fine to celebrate success but it is more important to heed the lessons of failure We've got to put a lot of money into changing behavior PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D. IDE- Microsoft Visual Studio 2008 Express Edition |
| BEN10 is offline | |
| | #7 | |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| Quote:
Or are you confused about how a 16-bit segment address and a 16-bit segment offset combine to produce a 20-bit address? That's an oddity peculiar to real mode x86. If an address is given as SEGMENT:OFFSET, then the absolute physical address is SEGMENT*16 + OFFSET. You should be able to see that there is more than one way to refer to the same physical address. The address 0x0001:0000 and the address 0x0000:0010 both refer to physical address 0x10, because 1*16+0 == 16 and also 0*16+16 == 16. This produces a huge overlap in the address space such that each byte of memory can be addressed in 4096 different ways. These 4096 ways represent a redundancy in the address space of 12 bits (2^12 == 4096). Thus, although you have 32 bits of address, you lose 12 bits because of this overlapping, resulting in (effectively) a 20-bit address space. Edit: If you're observant you notice that there are some addresses which don't have 4096 different ways of addressing them. For instance, physical address 0x0 can only be written as 0x0000:0000. This might lead you to wonder where these "missing" addresses have gone. In fact, they appear at the very top of the address space as an extra 64k (okay, actually 65519 bytes) of memory you can access beyond the 1M barrier. I only mention this because I'm sure abachler will point it out if I don't
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot Last edited by brewbuck; 09-10-2009 at 10:02 PM. | |
| brewbuck is offline | |
| | #8 |
| DESTINY Join Date: Jul 2008 Location: in front of my computer
Posts: 803
| Thanks brewbuck for a helpful reply. What I'm asking is that what do they mean when they say that the microprocessor can address 1M(for 20bitaddress bus) or 64K(for 16 bit) of memory. Could you elaborate this one please. I know how do they get it(2^20 or 2^16), but I dont undertsand what is actually its meaning. In some places they say it can address 1M of memory and in other places they say it can address 1MByte of meomory(why not 1Mbit)? I hope now my question is clear. EDIT: My second question is why is their a need of segment registers in 8086, why not a full 20bit address rather than dividing the address in 4segments?
__________________ HOPE YOU UNDERSTAND....... By associating with wise people you will become wise yourself It's fine to celebrate success but it is more important to heed the lessons of failure We've got to put a lot of money into changing behavior PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D. IDE- Microsoft Visual Studio 2008 Express Edition Last edited by BEN10; 09-10-2009 at 10:08 PM. |
| BEN10 is offline | |
| | #9 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| Well, either 1 M or 1 Mbyte or 1 megabyte all mean the same thing -- 1048576 ( == 2^20 ) bytes. There are several reasons why addresses refer to bytes instead of bits. For one, each bit having its own address doesn't turn out to be helpful in practice (i.e. it makes it more difficult to write programs). It also reduces the amount of RAM that could be addressed by a given number of address bits. On the other hand, why don't addresses refer to 32-bit quantities instead of 8-bit quantities (for instance)? Well, there ARE some machines like that. The advantage is that you get a larger memory (4 times what you could address with byte addressing). The disadvantage is that types which are less than 32 bits large are more difficult to manipulate (the C type 'char' would be very inefficient for instance). Of course, all molds are broken, and I'm sure there are machines out there where each bit has its own address. EDIT: To be clear, the memory is not divided into four segments, the processor's VIEW of the memory is divided because it only has four segment registers. As for why the addressing is not directly 20-bit, it's a complicated thing. For one, having these overlapping segments is actually convenient in many ways. It means that data can be divided up into 64k-sized chunks and moved around in memory. It's sort of like a primitive form of virtual memory but without any protection. For another, the architecture was inherently 16-bit, and it would have been inefficient to have 20-bit address values flowing through the processor -- especially so because most applications would never need to use that much memory to begin with. It's weird how this stuff all made so much sense back when it was widely used, and these days people (quite rightly) ask questions like this.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot Last edited by brewbuck; 09-10-2009 at 10:20 PM. |
| brewbuck is offline | |
| | #10 | |
| DESTINY Join Date: Jul 2008 Location: in front of my computer
Posts: 803
| This is what I found on one of the websites: Quote:
__________________ HOPE YOU UNDERSTAND....... By associating with wise people you will become wise yourself It's fine to celebrate success but it is more important to heed the lessons of failure We've got to put a lot of money into changing behavior PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D. IDE- Microsoft Visual Studio 2008 Express Edition | |
| BEN10 is offline | |
| | #11 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| It means what I said in the third paragraph of my previous post.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot |
| brewbuck is offline | |
| | #12 |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,212
| I don't understand why you are so confused. You know what an address is, right, eg, a pointer address? Notice the units with malloc are integer bytes. If I have a million possible addresses, then I can access up to 1M of memory. The address bus delivers an address to the processor. If it is 20-bits wide, that is an observation about a physical characteristic of the bus: it's a pathway thru which a simultaneous "sequence" of bits flows (ie, they do not actually occur one after the other, 010101001, they occur all at once, in a row, 20 of them). If one such row is a memory address, and the addresses are integers, the range of addresses will be from 0 to 2^20-1. Even if there are a million gigabytes hooked up to the processor, it can only make use of 1Mb because it cannot processes addresses for any more than that. I suppose you could make each unit of memory larger, but then you would have to write software exclusively for such an arrangement (I think), because as you know from programming, it is fundamental that one address refer to one byte, 8 bits. Although the address of each byte actually requires 20 bits to store (in the 8086), of course they actually are not stored anywhere, they are abstractions that refer to places in physical memory. Last edited by MK27; 09-11-2009 at 08:12 AM. |
| MK27 is online now | |
| | #13 |
| Super Moderator Join Date: Aug 2001
Posts: 7,817
| This discussion is bringing back terrible memories of having to bank switch to access a frame buffer that was larger than 64k. Real mode was just awful and we stayed in it for way way too long. Intel had protected mode as of the 386 and yet we really didn't use it all that much until the Pentium 1 when W95 came out. The 486 actually had a very good protected mode and games frequently made use of it via Rational Systems DOS4GW extender or some other extender....but the OS was sadly all in real mode. Also brings back memories of EMM386 (EMS) and HIMEM.SYS (XMS) and the awful re-entrancy problems in DOS. Only good thing about those days is that they are gone. This also made memory configs a huge mess. There was barely enough room for MSCDEX, your mouse, sound, and other drivers in upper memory.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #14 |
| DESTINY Join Date: Jul 2008 Location: in front of my computer
Posts: 803
| That's what my question is, what's get "hooked" up with the processor to make use of the 1MB of memory. Is it RAM of 1MB size? The various places of RAM is given addresses varying from 00000H uptill 1MB and whatever is stored in these addresses gets executed by our system. Is this true?
__________________ HOPE YOU UNDERSTAND....... By associating with wise people you will become wise yourself It's fine to celebrate success but it is more important to heed the lessons of failure We've got to put a lot of money into changing behavior PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D. IDE- Microsoft Visual Studio 2008 Express Edition Last edited by BEN10; 09-11-2009 at 10:17 PM. |
| BEN10 is offline | |
| | #15 | |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,212
| Quote:
system bus demonstration (ROM and RAM) The RAM is connected to the north bridge on the mother board, and the north bridge connects to the processor via the system bus, also called the Front Side Bus. If you look at your motherboard, the processor, the north bridge, and the RAM are very easy to see (the north bridge has a big square heat sink on it, like the processor, but less elaborate). This is a FSB chip, I believe. So the "address bus" is part of it. I also figure each of the little pin legs represents a one bit pathway, in which case you can see how all the bits line up. But I don't know that for sure. Last edited by MK27; 09-12-2009 at 06:40 AM. | |
| MK27 is online now | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| assembly for M8 microprocessor series | GanglyLamb | Tech Board | 3 | 03-15-2006 05:34 PM |
| What's cooler than free boobs? 5 free assembly books from AMD. | Silvercord | A Brief History of Cprogramming.com | 47 | 02-13-2003 08:22 PM |
| Does inline assembly still have to follow microprocessor instruction set? | Silvercord | C++ Programming | 8 | 01-30-2003 04:29 PM |
| a microprocessor thing! | badhri | C Programming | 8 | 05-29-2002 10:58 AM |
| What is the best way to test the microprocessor until failure | vnrabbit | C Programming | 9 | 03-13-2002 10:46 AM |