Physical organization of a computer

  • What a computer looks like physically:

Physical organization of a computer

  • Categories of the computer components:

Logical (functional) organization of a computer

  • What a computer looks like logically (= by their function):

What a computer looks like from inside

  • When you open the computer case, the inside of the computer looks like this:

What a computer looks like from inside

  • The computer system consists of 2 components:

  • The components that make up a computer system are:

    • The Central Processor Unit (CPU) - a.k.a. the processor
    • The Computer Memory = a.k.a. RAM (Random Access Memory)

What a computer looks like from inside

  • The RAM (or Random Access Memory) stores/contains computer programs:

  • A computer programs consists of:

    1. Program instructions
    2. Program variables

What a computer looks like from inside

  • The CPU (or Central Processing Unit) executes instructions in programs:

  • A CPU consists of:

    • Digital circuitry that fetch instructions from memory
    • Digital circuitry that execute the instructions fetched

Updated logical (functional) organization of a computer

  • What a computer looks like logically (= by their function):

Components of a computer

A computer consists of 4 types of components:

  1. Central Processing Unit (= CPU) = "brain" of a computer
  2. Main memory (= RAM) = storage space of a computer

  3. Input devices = devices used to receive data into the computer
  4. Output devices = devices used to output data from the computer

We take a closer look at the computer (main) memory component next

Computer memory (a.k.a.: Random Access Memory or RAM)

  • The main memory or RAM consists of many memory cells:

  • Each memory cell is uniquely identified by a memory address (which is a (binary) integer number)

    • Note: memory addresses always starts at the number zero (0)

  • Each memory cell can store a small number

    • A computer can only store (binary) numbers !!!     


    I showed all numbers in the diagram as decimal numbers for convenience

Analogy to help you understand a computer memory

  • The main memory or RAM is similar to a collection of mail boxes:

     

    where:

    • Each mail box is uniquely identified by an integer mailbox number (= address)
    • Each mail box contains slip of paper can store a (small) number

Operations that a computer can perform on the main memory

  • The computer can perform 2 operations on the main memory:

      1. Read operation:   the computer retrieves the number from one or more memory cells at a specific memory address

      2. Write operation:   the computer stores a number into one or more memory cells at a specific memory address

Analogy to help you understand the write and read operations to a computer memory

  • The write operation and the read operation to the computer memory is similar to the store and recall operations of a calculator:

Question:   how can a computer store things (like text) other than numbers ??

How does the computer store information using just numbers ?

  • Information is stored inside a computer as numbers by using an encoding method

  • An encoding method is an agreement on how to represent certain facts by a code (= specific number)

    Example: encoding the marital status information

       0 = single      2 = divorsed
       1 = married     3 = widowed           

How can a computer tell the meaning of a number ?

Problem description:

  • We just saw how to represent information on a person's marital status:

       0 = single      2 = divorsed
       1 = married     3 = widowed           


  • There are many different kinds of information !

    Example: encoding method for college students

       0 = freshman        2 = junior     4 = graduate MS 
       1 = sophomore       3 = senior     5 = graduate PhD       

  • Problem:

    • What does 0 represent ???     (It can mean single or freshman !)

How can a computer tell the meaning of a number ?

Answer to the representation conundrum:

  • The meaning of a code (like the number 0) can only be determined when the context is given (= known):

      • When the computer is working with marital status data, the number 0 means: single

      • When the computer is working with college student data, then the number 0 means: freshman

  • The context information for data in a computer program is:

    • The data type (will be discussed later)


  • Analogy to help you understand the concept of context:

      • Make a correct English sentence that begins with: You is ....     

The context of the word You

  • Answer:

       You is an English word
    


  • When you use the word You in the context of a personal pronoun (which is the common case), you must use You are ...

    Example:

      You are a person.       // You used as a personal pronoun
    

  • When you use the word You in the context of a noun, you must use You is ...

       You is an English word  // You used as a noun