Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Binary file added MemoryInterleaving/Interleaving.pdf
Binary file not shown.
Binary file added MemoryInterleaving/Memory Interleaving.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions MemoryInterleaving/example-one-broken-down.md
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions MemoryInterleaving/exampleone.md
Original file line number Diff line number Diff line change
@@ -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 |
3 changes: 3 additions & 0 deletions dramOrganisation/dramOrganisation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DRAM Organization

<img src="image/dramOrganisation/1713309733173.png" width="200" height="400">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions dramOrganisation/image/dramOrganisation/ramorder.md
Original file line number Diff line number Diff line change
@@ -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 |
Binary file added memorymaps/image/memory-maps/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added memorymaps/image/memory-maps/memory-bank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 102 additions & 6 deletions memory-maps.md → memorymaps/image/memory-maps/memorymaps.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -36,15 +35,17 @@ 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}$

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 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.

Expand Down Expand Up @@ -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.

Expand All @@ -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 |
30 changes: 30 additions & 0 deletions memorymaps/image/memory-maps/questionThreeBrokenDown.md
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.