the computer memory model n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
The Computer Memory Model PowerPoint Presentation
Download Presentation
The Computer Memory Model

Loading in 2 Seconds...

play fullscreen
1 / 40

The Computer Memory Model - PowerPoint PPT Presentation


  • 2252 Views
  • Uploaded on

The Computer Memory Model. Everything derives from this. Address. Data. Memory. J/K. J/K. J/K. J/K. J/K. J/K. J/K. J/K. r/w. info stored in digital logic (J/K latches) therefore, only 1s and 0s. What if?. You were a computer designer and... You needed to store information

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'The Computer Memory Model' - Audrey


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the computer memory model

The Computer Memory Model

Everything derives from this

slide2

Address

Data

Memory

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

r/w

info stored in digital logic (J/K latches)

therefore, only 1s and 0s

what if
What if?
  • You were a computer designer and...
  • You needed to store information
  • and retrieve it?
    • info would be stored as numbers (numbers can “represent” anything)
    • numbers would be placed at addressable locations (addresses are numbered from 0 to some maximum)
why 1s and 0s
why 1s and 0s
  • remember CSE241
  • memory banks are J/K latches, capable of “remembering” a binary state
  • latches are grouped into banks merely to store more information than is possible in 1s and 0s
  • 1or 0 is a bit, 8 bits are a byte
store something in memory
store something in memory
  • there are 16 banks of 8 latches each
  • rules: r/w = 0 reads latches, = 1 sets latches
  • memory addresses 0 to 15 banks, or
    • 0000 to 1111 in binary
  • data size is 8 bits (number of latches in each bank)

e.g. store the value 22 at location 10

    • r=0 (passive)
    • address = 10102 (10 decimal)
    • data = 0001 01102 (22 decimal)
    • r/w=1, then r/w=0 (write strobe)
slide6

Address

Data

15

Memory

0

1111 1111

r/w

slide7
How much memory is there, if the address bus is 8 bits?
  • How much memory if the address bus is 32 bits?
  • Does the size of the data bus matter?
    • This is a bigger deal than you might imagine
  • Should all memory behave the same?
a byte
A Byte
  • Eight bits
  • Can represent a number from 0 to 25510
  • Reflect computer memory as a huge bank of 8-bit switches
extending bytes
Extending bytes
  • Use 7 bits

111 1111 - represent 0 to 12710

  • Use the highest bit for “sign”

0 111 1111 127

1 111 1111 ( -127 )

2 s compliment
2’s Compliment

Replaces the redundancy of

0000 0000

1000 0000

To get negative: take the positive number, “complement” all the bits, add 1

To get positive: take the negative number, “complement” all the bits, add 1

slide11
For example,

Positive Integer 4 0000 0100

Compliment of 4 1111 1011

+ 1 0000 0001

Negative Integer 4 1111 1100

-----------------------------------

3 0000 0011

2 0000 0010

1 0000 0001

0 0000 0000

-1 1111 1111

-2 1111 1110

-3 1111 1101

size of storable numbers
Size of storable numbers?

4 bits: 0000 to 1111

16 different numbers,

maximum number is 15, or 24- 1 for unsigned

-8 to +7 for signed two’s compliment

8 bits?

28=256 different numbers

maximum number is 28 -1 = 255 for unsigned

-27 to +(27-1) = -128 to 127 for signed

difference between address and data
Difference between address and data
  • Address : number of different locations is important:

32 bit means 232 different locations

  • Data : range is important:

32 bit means -231 to+(231 - 1) for signed numbers

0 to +(232 - 1) for unsigned numbers

start thinking binary nibbles and hex digits
0000 - 0

0001 - 1

0010 - 2

0011 - 3

0100 - 4

0101 - 5

0110 - 6

0111 - 7

1000 - 8

1001 - 9

1010 -10 - A

1011 -11 - B

1100 -12 - C

1101 -13 - D

1110 -14 - E

1111 -15 - F

Start Thinking Binary Nibbles and Hex Digits
converting binary to hex
Converting Binary to Hex

1010011110011110101100110100

step 1: break into “nibbles”

1010 0111 1001 1110 1011 0011 0100

step 2: convert each to Hex number

1010 0111 1001 1110 1011 0011 0100

A 7 9 E B 3 4

converting hex to binary
Converting Hex to Binary

26D47FE16

2 6 D 4 7 F E

0010 0110 1101 0100 0111 1111 1110

literals
“Literals”
  • Hard numbers
  • 0, 15, 121, 78716 etc.
java support for binary hex
Java Support for Binary / Hex

From the Java Reference Manual:

Integer literals are written in three formats: decimal (base 10), hexadecimal (base 16), and octal (base 8). Decimal literals are written as ordinary numbers, hexadecimal literals always begin with 0X or 0x, and octal literals begin with 0. For example, the decimal number 10 is 0xA or 0XA in hexadecimal format, and 012 in octal format.

what does that mean
what does that mean?

0x1234 means 123416, which means 466010

0xAEF4 means 4478810

slide20
why?

0 x 1AF4 can be converted easily into binary

1 A F 4

0001 1010 1111 0100

So hex shows up in programming all the time, because binary is the computer’s interface to the world

slide21

Address

Data

Memory

r/w

slide22

Address

Data

Memory

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

r/w

info stored in digital logic (J/K latches)

therefore, only 1s and 0s

store something in memory1
store something in memory
  • there are 16 banks of 8 latches each
  • rules: r/w = 0 reads latches, = 1 sets latches
  • memory addresses 0 to 15 banks, or
    • 0000 to 1111 in binary
  • data size is 8 bits (number of latches in each bank)

e.g. store the value 22 at location 10

    • r=0 (passive)
    • address = 10102 (10 decimal)
    • data = 0001 01102 (22 decimal)
    • r/w=1, then r/w=0 (write strobe)
slide24

Address bus size determines how many separately addressable banks

Data bus size determines how many bits in a bank

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

select

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

decoder

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

binary

r/w

slide25

Address bus size determines how many separately addressable banks

Data bus size determines how many bits in a bank

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

rw = 0

out

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

in

rw = 1

r/w

slide26

I/0 Memory

Data Memory

Program Memory

Fast Specialty Memory

slide27
What goes in Program Memory?
  • What goes in Data Memory?
  • What’s the difference between address and data?
  • Why “Specialty” Memory?
  • What goes “in” Memory-Mapped I/O?
slide28

Address bus size determines how many separately addressable banks

Data bus size determines how many bits in a bank

Memory

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

r/w

design dilemma 1
Design dilemma #1

Should the number of bits in a bank, be greater than the data bus size?

16 bit memory, but only 8 bit data

2 write cycles to fill up each address

No. That just wastes time.

design dilemma 2
Design dilemma #2

What if the “computer” uses and needs numbers that are larger than the data bus?

Now... this one is real. 8 bit data bus can only pass around numbers, like, -128 to 127. Virtually useless.

data storage
Data Storage
  • Address size is usually 32 bits

232 different locations

0 to 232-1

  • Data bus and memory banks that store data are usually 8 bits wide

Numbers limited to 0 to 255 (or -128 to 127)

  • How then, do you store bigger numbers?

say, 32 bits = 4 bytes = 8 hex digits = 1 word

- 429497296 to + 429497295.

Now that’s reasonable.

slide33

Address bus size determines how many separately addressable banks

Data bus size determines how many bits in a bank

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

J/K

4 bytes (4 address locations), always

regarded as one computer “word”

r/w

4 bytes 4 address locations always regarded as one computer word
4 bytes (4 address locations), always regarded as one computer “word”

e.g 0x A2 01 C4 FF

Data Memory

4

FF

5

C4

01

6

A2

7

0

A2

1

01

2

C4

FF

3

which end of the word goes in the lower address
which end of the Word goes in the lower address?
  • does the big end of the number go in address 0? (big endian)
  • does the little end of the number go in address 0? (little endian)
  • Big Endian: words are stored with Big byte low
  • Little Endian: words are stored with Little byte low
the representation
the “representation”
  • constructs are designed and stored and routed and presented for simplest, fastest, easiest manufacturing
  • what they represent may be complicated
fast specialty memory
Fast Specialty Memory

dependable, 32-bit memory blocks: called “registers”

a counter for tracking where in data memory you currently are: called a “stack pointer”

a counter for tracking where your program is: program counter (means that program memory can be within data memory)

the architecture golden rules
The Architecture Golden Rules
  • Account for memory volatility - dependable storage and retrieval
  • Maximize throughput - reduce the time it takes to perform an operation, especially storage and retrieval
  • Separate encoding of information from hardware - data is stored fast and dependably (see above), but what it means is up to the user.
assignment 3 due in two weeks
Assignment 3 – due in two weeks

Part 1:

  • Build a Java (or any language) based memory simulator
  • memory: 00 thru ff (8 bit addressing)
  • data is 8 bits
  • stores data on Write function
    • takes data in Base 10 Integer
    • limit data to -128 to +127, 2’s complement
    • takes address in Hex
  • memory dump - show contents of 00-ff in Hex
assignment 3
Assignment 3

Part 2:

Take in 32 bit word storage as big Base 10 integer

Limit input to numbers possible using 32 bits

Ask for storage address in Hex, use the next highest 4-byte boundary.

Store data words in big endian format

Display on memory dump