PDA

View Full Version : Physical Flat Address Space of Microprocessors

Brookman
02-14-2001, 09:52 PM
Hi, my name is Brooks Hanley. I just want to get answered a question that has been buging me about for a long time. How is it that a 32-bit processor (with 32-bit address bus) has an address space of 4GB? When performing a (seemingly) aprobriate equation for getting the address space from the address bus width, 2^32 you get 4,294,967,296. This should be expressed in bits and expressing the 32 in bytes is the only way you achieve 4GB. The proof is dividing by 1024 twice to get the answer in Megabits (bytes?) 4096 which when divided by 8 (the conversion of bits to bytes) yields 512Megabytes not 4GB. How can this be?

bunk
02-15-2001, 01:57 PM
4 GB * 1024 = 4096 MB
4096 MB * 1024 = 4194304 KB
4194304 KB * 1024 = 4294967296 Bytes
4294967296 bytes * 8bit/byte = 34359738368 bits

32 bit address or 2^32 is 4294967296 available address &gt;&gt;&gt;pointers&lt;&lt;&lt; to &gt;&gt;&gt;Memory Locations&lt;&lt;&lt;. Each memory location is a byte in size.

2^32 = 4294967296 possible memory addresses

Randy_tx
02-15-2001, 03:23 PM
WOWZER ! From a first time poster too.......dang!

------------------
When all else fails...I'm a heck of a parts swapper!

Brookman
02-15-2001, 05:42 PM
Hi its the moderator again. I was wondering how it is possible that a bit on the address bus can equal a whole byte of memory. It is 32bits not 32 bytes. I am refering to non-segmented non/virtual memory; a flat physical address space. Thankyou very much.

bunk
02-16-2001, 01:36 AM
To show how this works lets simplify and use a 2 bit address bus.

A 2 bit address would have 4 possibilities,,, 00 01 10 or 11 .

Each of these addresses points to a block of memory not to a single bit of memory. A memory address of 00 points to an 8 bit chunk of memory called 00, a memory address of 01 points to another 8 bit chunk of memory called 01, and so on. Each of the available memory address points to an &gt;&gt;8 bit chunk of memory&lt;&lt; not to a single bit. Everything is stored in bytes. The hardware (ram) is responsible for matching the address name to a specific chunk of memory space. Look at it like a street address you just need to send this to 01,, let the mail man figure out where 01 is your job is only to put the correct address on the envelope.

let us assume this is the physical memory array inside an actual 8byte ram module

.........C00....C01....C10....C11

R0......Byte0..Byte1..Byte2..Byte3

R1......Byte4..Byte5..Byte6..Byte7

Each byte is a chunk of memory space that is 8 bits,

The memory bus in this example is 3 bit,,
000 001 010 011 100 101 110 111 are our 8 memory addresses. The RAM module is responsible for knowing that address 000 is row0 column00 in the physical array and that this is byte0, that 001 is row0 column01 and this is byte1.. all the way to 111 is row1 column11 and this is byte7. Thus this 3bit memory array has 8 address, 2^3 is 8. It points to 8 different bytes by giving them a name 000 or 001 or 010 etc. When the RAM moves over a column it is moving over 8bits at a time. The memory address only points out to RAM what row and column to go to. The RAM moves to the correct row and column and then gets the 8bits of data stored there.

Each memory address named by our 3 bit memory bus is 8bits long(this is where you miss the scheme) ; thus our 3bit memory bus handles 8 locations of 8bits each, or 8 bytes. the name 001 is only the name of a Byte(memory addres) not an actual physical location known by the cpu or program. The RAM is responcible for translating the memory address to a physical location, this is built in the actual ram module.

OK this gets a little nitty gritty and it really helps to understand binary math when working with some of this.

In our memory array we have 2 rows and 4 columns and we have a 3 bit memory address scheme. the first bit is the Row value and the 2ndbit and 3rdbit are Column values. Thus if the first bit is 0 the location is on row0 and if the first bit is 1 then it is on row1. The second 2 bits define the column. thus 101 is broken down into first bit row 1,,,the next 2 bits are column 01,, thus row1 column 01 this points to byte5,, which matchs 101 in binary http://www.PCGuide.com/ubb/smile.gif It could help to understand here that each column is 8bits wide,, or a byte,, when the RAM moves to the next column it is moving over 8bits at a time.

So here is a slightly more detailed example of an 4bit memory address using a 4x4 array (the physical layout in determined by the manufacturor of the RAM module)

........c00.....c01......c10......c11

r00...Byte00...Byte01...Byte02...Byte03

r01...Byte04...Byte05...Byte06...Byte07

r10...Byte08...Byte09...Byte10...Byte11

r11...Byte12...Byte13...Byte14...Byte15

In a 4x4 memory array it would take a 4bit memory address to handle the 16 locations in memory, each location is a byte. Once again 4 bits of memory address (2^4) or 16 address are used to point to 16 bytes. A bit can point to a byte. The RAM module being built on a 4x4 basis like this one would know that the first 2bits were row and next 2bits are column. 1010 would translate to row 10,,, column 10,, in binary 1010 is 10 and in our array 1010 points to byte10. Thus once again this address points to a location that is a byte in size.

In a realistic 32bit it gets even more involved on the actual RAM modules. To get 4GB or memory it would take 4 RAM sticks,,, Each of these RAM sticks uses 8 ramchips. In a 32 bit memory address the 4 ramsticks would be 00 01 10 11,, the first 2 bits of the address poin to the ramstick needed. Notice that your memory banks on the motherboard start with 0 as the first physical bank. Then we can assume 8 ramchips per stick the next 3 bits would be used to identify which chip to goto,, 000 001 010 011 100 101 110 111. So a memory address starting with 10110.... would point to ramstick10, the 3rd one physically, 110 would point to chip110 on the 3rd ramstick, chip 110 would be the 7th chip physcically. So this address starting out with 10110.. points to ramstick10 chip110, or the 3rd stick..7thchip.

RAMsticks 00...01...10...11
Chips 000...001...010...011...100...101...110...111

So if the first 2 bits for stick, next3 bits for chip, this leaves 27bits for row/column,, maybe something like the next 12 bits for row address and the other 15 for column address. When all is said and done,, this 32 bit memory address ended up at a specific spot on a specific chip on a specific ram stick,, that spot is 8bits or a Byte in size http://www.PCGuide.com/ubb/smile.gif. If you still need to know more,, time to head to technical college and get a degree http://www.PCGuide.com/ubb/smile.gif

Good God why dont they make wysiwyg bulletin boards

[This message has been edited by bunk (edited 02-16-2001).]

[This message has been edited by bunk (edited 02-16-2001).]

[This message has been edited by bunk (edited 02-16-2001).]

sea69
02-16-2001, 10:41 AM
WoW.. hehe http://www.PCGuide.com/ubb/smile.gif

TaLk AbOuT a TeCh ToPiC ...salut to those to have a clue on this http://www.PCGuide.com/ubb/eek.gif

------------------
"Remember u r 'unique'... just like everyone else!"

Ghost_Hacker
02-16-2001, 11:50 AM
That was an excellent explanation of memory addressing!!!
In fact I'm going to print it out and stick it my Assembler programming book. http://www.PCGuide.com/ubb/biggrin.gif

------------------
"It's just a whisper in my Ghost"

[This message has been edited by Ghost_Hacker (edited 02-16-2001).]

sea69
02-16-2001, 12:58 PM
hehe "GH"

thought I was the only one that did that .. http://www.PCGuide.com/ubb/smile.gif

------------------
"Remember u r 'unique'... just like everyone else!"

hacker
02-16-2001, 09:45 PM
bunk,

Damn, hope you hang around.

Not much of a poster myself, but read here often.

I think if I read your post 2 or 3 more times I might get it. Maybe 5 or 6.

Still, to me, you described a grid infomation access ( my words ) http://www.PCGuide.com/ubb/confused.gif very well.

Hope to see you around.

http://www.PCGuide.com/ubb/eek.gif http://www.PCGuide.com/ubb/eek.gif

------------------
I was called "hacker" before there was a HeathKit.

mjc
02-17-2001, 12:11 AM
Heck, maybe Charles should clip it and put in the memory section of the Guide!

I think it would have taken me several books that haven't been out of storage in years and I know I couldn't have done it anywhere near the justice Bunk did.

------------------
mjc
To ME or NOT to ME....