Top Banner

Click here to load reader

ELCT 912: Advanced Embedded Systems - Embedded Systems... · PDF fileELCT 912: Advanced embedded Systems Winter 2011. Memory Description ˘ˇˆ ˙ ˝ ˙ ˙ ˛ˇ ˘˙ ˙ ˝ ......

Jul 30, 2018

ReportDownload

Documents

dinhcong

  • ELCT 912:Advanced Embedded Systems

    Lecture 2: Memory and Programmable Logic

    Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering

  • Memory

    Random Access Memory (RAM)

    Read-Only Memory (ROM)

    Can be read and writtenStatic Random Access Memory (SRAM)

    A memory device in which permanent binary information is storedMask ROM: The programming is done by the semiconductor company during the

    2Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    (SRAM)Data stored so long as vddis applied 6-transistors per cellFaster

    Dynamic Random Access Memory (DRAM)

    Require periodic refreshSmaller (can be implemented by 1 or 3 transistors)slower

    the semiconductor company during the last fabrication process of the unitPROM: Once the PROM is programmed, it cannot be reversedEPROM: An erasable PROM and can be erased by exposure to UV lightEEPROM: Can be erased and programmed with electrical pulsesFlash memory: High-density read/write memories that are nonvolatile. They have the ability to retain charge for years with no applied power

    ELCT 912: Advanced embedded Systems Winter 2011

  • Block Diagram of Memory

    3Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    !

    "#$

    Example: 2MB memory, byte-addressable-N =8 (because of byte-addressability)-K= 21 (1 word= 8-bit)

    ELCT 912: Advanced embedded Systems Winter 2011

  • Static Random Access Memory (SRAM)

    %

    4Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    &%&%

    Typically each bit is implemented with 6 transistors (6T SRAM Cell)During read, the bitline and its inverse are precharged to Vdd (1) before set WL=1During write, put the value on Bitline and its inverse on Bitline_bar before set WL=1

    ELCT 912: Advanced embedded Systems Winter 2011

  • Dynamic Random Access Memory (DRAM)

    &

    %

    5Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    1-transistor DRAM cell During a write, put value on bitline and then set WL=1 During a read, prechage bitline to Vdd (1) before assert WL to 1Storage decays, thus requires periodic refreshing (read-sense-write)

    &

    ELCT 912: Advanced embedded Systems Winter 2011

  • Memory Description

    6Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    Capacity of a memory is described as # addresses x Word size

    ELCT 912: Advanced embedded Systems Winter 2011

  • How to address Memory

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    (

    '

    ))

    **

    +(

    7Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ,

    - . / ) , ' (

    +'

    "0

    "#0*

    ELCT 912: Advanced embedded Systems Winter 2011

  • How to address Memory

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    (

    '

    ))

    **+(1'

    8Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ,

    - . / ) , ' (

    +'1(

    "0

    "#0*1'

    +**1(2'

    ELCT 912: Advanced embedded Systems Winter 2011

  • Use 2 Decoders

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    (

    '

    ))

    **

    **

    +'

    +

    9

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ,+

    "0

    ''**"*"*

    (',

    3&

    ( '

    +(

    "#0* "0

    Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    ELCT 912: Advanced embedded Systems Winter 2011

  • Tristate Buffer

    4

    10Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    !

    $

    $

    "!0**

    Could amplify signalTypically used for signal traveling e.g. bus

    ELCT 912: Advanced embedded Systems Winter 2011

  • Bi-directional Bus using Tri-state Buffer

    **

    + !

    11Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    &

    ELCT 912: Advanced embedded Systems Winter 2011

  • Read/Write Memory

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    (

    '

    ))

    **

    **

    +'

    +

    12

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ,+

    "0

    ''**"*"*

    (',

    ( '

    +(

    "#0* "0

    1(

    ELCT 912: Advanced embedded Systems Winter 2011

  • Read/Write Memory

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    (

    '

    ))

    **

    **

    +(

    +'

    13

    ' ' ' ' ' ' ' '

    ' ' ' ' ' ' ' '

    ,+'

    "0

    ''**"*"*

    (',

    ( '

    +(

    "#0*1' "0

    1'

    ELCT 912: Advanced embedded Systems Winter 2011

  • Building Memory in Hierarchy

    Design a 1Mx8 using 1Mx4 memory chips

    14Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    '2)'2)

    "0

    ELCT 912: Advanced embedded Systems Winter 2011

  • Building Memory in Hierarchy

    Design a 2Mx4 using 1Mx4 memory chips

    +'5+'6+'-

    +(

    '2)'2)

    "0

    ,

    '

    (

    15Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    +'5+'6+'-

    +(

    '2)'2)

    "0

    +( '*

    "0

    '

    (

    ELCT 912: Advanced embedded Systems Winter 2011

  • Building Memory in Hierarchy

    Design a 2Mx8 using 1Mx4 memory chips

    +'5+'6+'-

    +(

    '2)'2)

    "0

    +'5+'6+'-

    '2)'2)

    +( '*

    '

    16

    +(

    '2)'2)

    "0

    +'5+'6+'-

    +(

    '2)'2)

    "0

    +'5+'6+'-

    +(

    '2)'2)

    "0

    *

    "0

    (

    Dr. Mohamed Abd el Ghany

  • Memory Model

    (2(+

    (2&.

    (2)'

    (27"

    %+

    (2((((((((

    (2((((((('

    (2(((((((

    (2(((((((,

    32-bit address space can address up to 4 GB (232) different memory locations

    17Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    77

    (27"

    89#+

    (2(((((((,

    (277777777 (2(

    ELCT 912: Advanced embedded Systems Winter 2011

  • Endianness [Danny Cohen 91]

    A byte ordering- How a multiple byte data word stored in memory

    Endianness (from Gullivers Travels)

    Big Endian

    Most significant byte of a multi-byte word is stored at the lowestmemory address

    18Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    memory address

    E.g. Sun Sparc, PowerPC

    Little Endian

    Least significant byte of a multi-byte word is stored at the lowestmemory address

    e.g. Intel x86

    Some embedded & DSP processors would support both for interoperability

    ELCT 912: Advanced embedded Systems Winter 2011

  • Endianness Examples

    Store 0x21436587 at address 0x0000

    (26-

    (2./

    (2),

    %+

    (2((((

    (2((('

    (2(((

    (2'

    (2),

    (2./

    %+

    (2((((

    (2((('

    (2(((

    19Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    (2),

    (2'

    89#+

    (2(((

    (2(((,

    &:$+&:$+

    (2./

    (26-

    89#+

    (2(((

    (2(((,

    %33%$%33%$$+$+

    ELCT 912: Advanced embedded Systems Winter 2011

  • Permanent binary information is stored

    Non-volatile memory

    Power off does not erase information stored

    Read Only Memory (ROM)

    20Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    !!!

    ELCT 912: Advanced embedded Systems Winter 2011

  • 32x8 ROM

    ,26!6

    (',

    /,

    $*#,

    21Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    65,(,'

    /,

    *

    7*

    ELCT 912: Advanced embedded Systems Winter 2011

  • Programming the 32x8 ROM

    ('

    !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!

    """" """" """" """" """" """" """" """" """" """" """" """" """"

    22

    '

    5

    ,(

    ,'

    - . / ) , ' (

    /,

    *

    Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    ELCT 912: Advanced embedded Systems Winter 2011

  • Example: Lookup Table

    # $%#&'#

    # $%#&'#

    Design a square lookup table for F(X)=X2 using ROM

    23Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    ELCT 912: Advanced embedded Systems Winter 2011

  • Square Lookup Table using ROM

    # $%#&'#

    (

    '

    ,

    !

    !

    ,6

    * )

    24Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering

    " " " " " "

    !

    * )

    /

    .

    -

    ELCT 912: Advanced embedded Systems Winter 2011

  • Square Lookup T