diff --git a/MemoryInterleaving/Interleaving.pdf b/MemoryInterleaving/Interleaving.pdf new file mode 100644 index 0000000..8b7678f Binary files /dev/null and b/MemoryInterleaving/Interleaving.pdf differ diff --git a/MemoryInterleaving/Memory Interleaving.pdf b/MemoryInterleaving/Memory Interleaving.pdf new file mode 100644 index 0000000..6ffa1b7 Binary files /dev/null and b/MemoryInterleaving/Memory Interleaving.pdf differ diff --git a/MemoryInterleaving/example-one-broken-down.md b/MemoryInterleaving/example-one-broken-down.md new file mode 100644 index 0000000..494157a --- /dev/null +++ b/MemoryInterleaving/example-one-broken-down.md @@ -0,0 +1,13 @@ +# example one (broken down) + +## Suppose we have a 128 byte memory and we are using 8-way, low-order interleaving. What is the structure of the addresses for this memory? + +2^7 = 128 + +2^3 = 8 + +to find the low order interleaving we need to take 7 away from 3 + +7 - 3 = 4 + +this means that the first 4 bits are used to select the byte in the bank, followed by the last 3 bits to select the bank diff --git a/MemoryInterleaving/exampleone.md b/MemoryInterleaving/exampleone.md new file mode 100644 index 0000000..9314841 --- /dev/null +++ b/MemoryInterleaving/exampleone.md @@ -0,0 +1,26 @@ +# Memory Interleaving Example + +## Suppose we have a 128 byte memory and we are using 8-way, low-order interleaving. What is the structure of the addresses for this memory? + +Step 1: calculate the number of address lines needed + +The memory has a capacity of 128 bytes. This means that we need 7 address lines to address 128 bytes of memory. + +this is because: + +$$ +2^7 = 128_{10} +8-way \space low \space order, to \space get \space the \space bits \space log_2(8) = 3 \space +so \space 3 \space bits, last \space 3 \space on \space the \space right, are \space used \space to \space select \space the \space bank. +$$ + +total of 7, minus 3 for mempry bank address leave 4bits + +The first 4 bits are used to select the byte in the bank, followed by the last 3 bits to select the bank + +e.g. first address in bank 0 is 0000 in the bank 000 + +| Offset | Bank | +| ------ | ------ | +| 4 bits | 3 bits | +| 0000 | 000 | diff --git a/dramOrganisation/dramOrganisation.md b/dramOrganisation/dramOrganisation.md new file mode 100644 index 0000000..fa39f37 --- /dev/null +++ b/dramOrganisation/dramOrganisation.md @@ -0,0 +1,3 @@ +# DRAM Organization + + diff --git a/dramOrganisation/image/dramOrganisation/1713309733173.png b/dramOrganisation/image/dramOrganisation/1713309733173.png new file mode 100644 index 0000000..cd92f2d Binary files /dev/null and b/dramOrganisation/image/dramOrganisation/1713309733173.png differ diff --git a/dramOrganisation/image/dramOrganisation/ramorder.md b/dramOrganisation/image/dramOrganisation/ramorder.md new file mode 100644 index 0000000..d1ab350 --- /dev/null +++ b/dramOrganisation/image/dramOrganisation/ramorder.md @@ -0,0 +1,16 @@ +# Here's a more memorable phrase using the first letter of each term + +## "Can Do Real Cool Things, But Always Carefully" + +This phrase is a mnemonic to help you remember the order of the bits in the address for a memory system with 8-way interleaving. The first letter of each word in the phrase corresponds to the order of the bits in the address: + +| Bit Order | Term | +|---------------|---------| +| C (Can) | Channel | +| D (Do) | DIMM | +| R (Real) | Rank | +| C (Cool) | Chip | +| T (Things) | | +| B (But) | Bank | +| A (Always) | Array | +| C (Carefully) | Cell | diff --git a/memorymaps/image/memory-maps/image.png b/memorymaps/image/memory-maps/image.png new file mode 100644 index 0000000..3888501 Binary files /dev/null and b/memorymaps/image/memory-maps/image.png differ diff --git a/memorymaps/image/memory-maps/memory-bank.png b/memorymaps/image/memory-maps/memory-bank.png new file mode 100644 index 0000000..1502156 Binary files /dev/null and b/memorymaps/image/memory-maps/memory-bank.png differ diff --git a/memory-maps.md b/memorymaps/image/memory-maps/memorymaps.md similarity index 53% rename from memory-maps.md rename to memorymaps/image/memory-maps/memorymaps.md index 331beb8..03878e3 100644 --- a/memory-maps.md +++ b/memorymaps/image/memory-maps/memorymaps.md @@ -1,4 +1,3 @@ - # Memory Maps A memory map is a diagram of the memory system that shows the address range and the memory modules installed in the system. It's used to illustrate the address range for each memory module and the amount of free space in the system. @@ -36,7 +35,7 @@ Create a Memory Map for a system with 2GB capacity. Assume the system has 3 x 32 Step 1: calculate full address range: -$2\text{ GB} &=& 2 * \text{GB} = 2^{1}*2^{30} = 2^{31}.$ This means that we need 31 address lines. +$2\text{ GB} = 2 * \text{GB} = 2^{1}*2^{30} = 2^{31}.$ This means that we need 31 address lines. $2^{31} = 2,147,483,648_{10} = \text{0x8000\;0000}$ @@ -44,7 +43,9 @@ $2^{31} = 2,147,483,648_{10} = \text{0x8000\;0000}$ Step 2: calculate the address range for the 3 x 32MB memory modules. Each module is 32MB = 32 * MB = 2^5 x 2^20 = 2^25. This means that we need 25 address lines to address 32MB of memory. -$$2^{25} = 33,554,432_{10} = 0x200\;0000$$ +$$ +2^{25} = 33,554,432_{10} = 0x200\;0000 +$$ 25 / 4 = 6 with a remainder of 1. This means that we need 6 hex digits to represent the address. This means that the address range is 0x000 0000 to 0x1FF FFFF. @@ -77,13 +78,17 @@ Memory Map for a system with 8GB capacity. Assume the system has 3 x 160MB memor Step 1: calculate full address range: 8GB = 8 * GB = 2^3 x 2^30 = 2^33. This means that we need 33 address lines. -$$2^{33} = 8,589,934,592_{10} = 0x2000\;0000$$ +$$ +2^{33} = 8,589,934,592_{10} = 0x2000\;0000 +$$ -33 / 4 = 8 with a remainder of 1. This means that we need 8 hex digits to represent the address. This means that the address range is 0x0000 0000 to 0xFFFF FFFF.** dont trust this** +33 / 4 = 8 with a remainder of 1. This means that we need 8 hex digits to represent the address. This means that the address range is 0x0000 0000 to 0xFFFF FFFF.**dont trust this** Step 2: calculate the address range for the 3 x 160MB memory modules. Each module is 160MB = 160 * MB = 2^8 x 2^20 = 2^28. This means that we need 28 address lines to address 160MB of memory. -$$2^{28} = 268,435,456_{10} = 0x1000\;0000$$ +$$ +2^{28} = 268,435,456_{10} = 0x1000\;0000 +$$ 28 / 4 = 7 with a remainder of 0. This means that we need 7 hex digits to represent the address. This means that the address range is 0x0000 0000 to 0x0FFF FFFF. @@ -97,3 +102,94 @@ leaving 0x300 0000 to 0xFFFF FFFF: 7,424MB of unused memory +## question 3 + +A computer system has a memory with a capacity of 2 GB. The memory is divided into 4 banks, each with a different size. + +- Bank 0 has a size of 512 MB +- bank 1 has a size of 768 MB +- bank 2 has a size of 256 MB +- bank 3 has a size of 512 MB + +Draw a memory map that shows the location and size of each memory bank. + +![Memory map](image.png) + +| Bank | Size | Start Address | End Address | +| ------ | ------ | ------------- | ----------- | +| Bank 3 | 512 MB | | | +| Bank 2 | 256 MB | | | +| Bank 1 | 768 MB | | | +| Bank 0 | 512 MB | | | + +### Step 1: calculate full address range + +$2\text{ GB} = 2 * 1\text{ GB} = 2^{1}*2^{30} = 2^{31}.$ This means that we need 31 address lines. + +$2^{31} = 2,147,483,648_{10} = \text{0x8000\;0000}$ +stating form 0 we address 0x0000 0000 - 0x7FFF FFFF + +31 / 4 = 7 with a remainder of 3. This means that we need 7 hex digits to represent the address.This means that the address range is 0x0000 0000 to 0x7FFF FFFF. + +### Step 2 : Calculate `bank 0` address range + +$512\text{ MB} = 512 * 1\text{ MB} = 2^9*2^{20} = 2^{29}.$ This means that we need 29 address lines. + +$2^{29} = 536,870,912_{10} = 0x2000\;0000$ + +address bank 0 = 0x0000 0000 - 0x1FFF FFFF + +### Step 3 : Calculate `bank 1` address range + +$768\text{ MB} = 768 * 1\text{ MB} = 2^9*2^{20} = 2^{29}.$ This means that we need 29 address lines. + +$2^{29} = 805,306,368_{10} = 0x3000\;0000$ + +0x0000 0000 - 0x1FFF FFFF is taken, so add 0x1FFF FFFF to the address range + +| | start | end | | +| - | ----------- | ----------- | ------------------------ | +| | 0x0000 0000 | 0x3000 0000 | | +| + | 0x1FFF FFFF | 0x1FFF FFFF | (last address of bank 0) | +| | 0x1FFF FFFF | 0x4FFF FFFF | | + +address bank 1 = 0x2000 0000 - 0x4FFF FFFF + +### Step 4 : Calculate `bank 2` address range + +$256\text{ MB} = 256 * 1\text{ MB} = 2^8*2^{20} = 2^{28}.$ This means that we need 28 address lines. + +$2^{28} = 268,435,456_{10} = 0x1000\;0000$ + +0x0000 0000 - 0x4FFF FFFF is taken, so add 0x4FFF FFFF to the address range + +| | start | end | | +| - | ----------- | ----------- | ------------------------ | +| | 0x0000 0000 | 0x1000 0000 | | +| + | 0x4FFF FFFF | 0x4FFF FFFF | (last address of bank 1) | +| | 0x4FFF FFFF | 0x5000 0000 | | + +address bank 2 = 0x5000 0000 - 0x5FFF FFFF + +### Step 5 : Calculate `bank 3` address range + +$512\text{ MB} = 512 * 1\text{ MB} = 2^9*2^{20} = 2^{29}.$ This means that we need 29 address lines. + +$2^{29} = 536,870,912_{10} = 0x2000\;0000$ + +0x0000 0000 - 0x5FFF FFFF is taken, so add 0x5FFF FFFF to the address range + +| | start | end | | +| - | ----------- | ----------- | ------------------------ | +| | 0x0000 0000 | 0x2000 0000 | | +| + | 0x5FFF FFFF | 0x5FFF FFFF | (last address of bank 2) | +| | 0x5FFF FFFF | 0x7FFF FFFF | | + +address bank 3 = 0x6000 0000 - 0x7FFF FFFF + +| Bank | Size | Start Address | End Address | +| ------ | ------ | ------------- | ----------- | +| Bank 3 | 512 MB | 0x6000 0000 | 0x7FFF FFFF | +| Bank 2 | 256 MB | 0x5000 0000 | 0x5FFF FFFF | +| Bank 1 | 768 MB | 0x2000 0000 | 0x4FFF FFFF | +| Bank 0 | 512 MB | 0x0000 0000 | 0x1FFF FFFF | diff --git a/memorymaps/image/memory-maps/questionThreeBrokenDown.md b/memorymaps/image/memory-maps/questionThreeBrokenDown.md new file mode 100644 index 0000000..da47a1b --- /dev/null +++ b/memorymaps/image/memory-maps/questionThreeBrokenDown.md @@ -0,0 +1,30 @@ +# memory map for question 3 + +## Bank 0 = 512mb + +536,870,911 = available addresses available for bank 0 + + 536,870,911 +Bank 0 = 0000 0000 -> 1FFF FFFF + +## Bank 1 = 768mb + +1,342,177,279 - 536,870,911 = 805,306,368 possible addresses available for bank 1 + + 1,342,177,279 +Bank 1 = 2000 0000 -> 4FFF FFFF + +## Bank 2 = 256mb + +1,610,612,735 - 1,342,177,279 = 268,435,456 possible addresses available for bank 2 + + 1,610,612,735 +Bank 2 = 5000 0000 -> 5FFF FFFF + +## Bank 3 = 512mb + +2,147,483,647 - 1,610,612,735 = 536,870,912 possible addresses available for bank 3 + + 2,147,483,647 + +Bank 3 = 6000 0000 -> 7FFF FFFF diff --git a/theCPUandMemory/image/relationshipBetweenCPUandMemory/1713310292159.png b/theCPUandMemory/image/relationshipBetweenCPUandMemory/1713310292159.png new file mode 100644 index 0000000..394a59b Binary files /dev/null and b/theCPUandMemory/image/relationshipBetweenCPUandMemory/1713310292159.png differ