StudentCodingHUB

Use programming to create innovative things.
  • new post

    Sunday, 15 March 2015

    MEMORY LOCATIONS & ADDRESSES

    Memory locations consist of millions of storage cells which can store a binary digit or bit having value 0 or 1.

    Group of n bits, called as a word of information can be stored and retrieved in a single basic operation.

    Accessing the main memory requires address for each word location 0 to 2k – 1.


    Main memory of this computer can have up to 2k  words.
    For example a 24 bit address generates an address space of 224 (16777216) locations ≡16M 
    and a 32 bit address creates an address space of 232   or 4G.

    Address
    n bits



    Word
    0




    word 0
    1




    word 1

    .
    .
    .
    .





    i
    bn-1
    .  .  .  .  . .
    b1
    b0
    word i

    .
    .
    .
    .





    2k -1




    word 2k-1



    Representation of Numbers in main memory


    Consider a 32 bit pattern is used to represent a signed integer
                                                                                                                     

    b31
    b30
    b1
    b0

                Sign bit           b31       = 0 for positive numbers
                                                     = 1 for negative numbers

                Magnitude       = b30 . 230 + b29 . 229  + . . . . . + b1 . 2 + b0 . 20


      Magnitude can range from 0 to 231 – 1 and the numbers are said to be in binary 
      positional notation.
     The above encoding format is called Signed Magnitude representation.


    Representation of Characters in main memory


    Characters can be letters of the alphabet, decimal digits, punctuation marks etc. 
    They are represented by codes that are usually 6 – 8 bits long.
    Shows how 4 characters in ASCII can be stored in a 32 bit word.                                      

    8 bits
    8 bits
    8 bits
    8 bits
    ASCII Character
    ASCII Character
    ASCII Character
    ASCII Character


    Representation of Instructions in main memory


    A main memory word can also be used to represent an instruction. One part of the word specifies the operation to be performed and the other part specifies operand address. 
    Each of these parts are called as ‘field’.                                                     

    8 bits
    24 bits
    Operation field
    Addressing information


    Here the 8 bit operation field can encode 28 (256) distinct instructions.


    • The different ways in which operands can be named in machine instructions are called addressing modes.
    • Memory words whose addresses are specified by the instructions are interpreted as operands. Whether an operand is a character or a numeric data item is determined by the operation field of the instruction.
    • An operand may be either shorter or longer than one word. An operand length of 8 bit is convenient, because this size is used to encode character data. An 8 bit data is called a byte.

    No comments:

    Post a Comment