1.Organization

download 1.Organization

of 17

Transcript of 1.Organization

  • 8/3/2019 1.Organization

    1/17

    Computer OrganizationComputer Organization

    Hardware and Software

  • 8/3/2019 1.Organization

    2/17

    Computing SystemsComputing SystemsComputers have two kinds of components:Computers have two kinds of components:

    HardwareHardware, consisting of its physical devices, consisting of its physical devices(CPU, memory, bus, storage devices, ...)(CPU, memory, bus, storage devices, ...)

    SoftwareSoftware, consisting of the programs it has, consisting of the programs it has(Operating system, applications, utilities, ...)(Operating system, applications, utilities, ...)

  • 8/3/2019 1.Organization

    3/17

    Hardware: CPUHardware: CPUCentral Processing Unit (CPU):Central Processing Unit (CPU):

    the brain of the machinethe brain of the machine

    location of circuitry that performs arithmetic andlocation of circuitry that performs arithmetic andlogical ML statementslogical ML statements

    measurement: speed (roughly) in megahertzmeasurement: speed (roughly) in megahertz

    (millions of clock(millions of clock--ticks per second)ticks per second) examples: Intel Pentium, AMD K6, Motorolaexamples: Intel Pentium, AMD K6, Motorola

    PowerPC, Sun SPARC,PowerPC, Sun SPARC,

  • 8/3/2019 1.Organization

    4/17

    Hardware: RAMHardware: RAMRandom Access Memory (RAM)Random Access Memory (RAM)

    main memory, which is fast, butmain memory, which is fast, but volatilevolatile......

    analogous to a persons shortanalogous to a persons short--term memory.term memory.

    many tiny onmany tiny on--off switches: for convenienceoff switches: for convenience

    on is represented by 1, off by 0.on is represented by 1, off by 0.

    each switch is called aeach switch is called a bbinary diginary digitit, or, or bitbit..

    8 bits is called a8 bits is called a bytebyte..

    221010 bytes =1024 bytes is called abytes =1024 bytes is called a kilobytekilobyte (1K)(1K)

    222020 bytes is called abytes is called a megabytemegabyte (1M).(1M).

  • 8/3/2019 1.Organization

    5/17

    Hardware (Disk)Hardware (Disk)Secondary Memory (Disk):Secondary Memory (Disk):

    Stable storage using magnetic or optical media.Stable storage using magnetic or optical media.

    Analogous to a persons longAnalogous to a persons long--term memory.term memory.

    Slower to access than RAM.Slower to access than RAM.

    Examples:Examples:

    floppy disk (measured in kilobytes)floppy disk (measured in kilobytes)

    hard disk (measured in gigabytes (2hard disk (measured in gigabytes (23030 bytes))bytes))

    CDCD--ROM (measured in megabytes), ...ROM (measured in megabytes), ...

  • 8/3/2019 1.Organization

    6/17

    Hardware: the BusHardware: the BusThe Bus:The Bus:

    Connects CPU to other hardware devices.Connects CPU to other hardware devices.

    Analogous to a persons spinal cord.Analogous to a persons spinal cord.

    Speed measured in megahertz (like the CPU),Speed measured in megahertz (like the CPU),but typically much slower than the CPU...but typically much slower than the CPU...

    The bottleneck in most of todays PCs.The bottleneck in most of todays PCs.

  • 8/3/2019 1.Organization

    7/17

    Hardware: CacheHardware: CacheWhile accessing RAM is faster than accessingWhile accessing RAM is faster than accessing

    secondary memory, it is still quite slow,secondary memory, it is still quite slow,

    relative to the rate at which the CPU runs.relative to the rate at which the CPU runs.

    To circumvent this problem, most systems addTo circumvent this problem, most systems adda fasta fast cache memorycache memory to the CPU, to storeto the CPU, to store

    recently used instructions and data.recently used instructions and data.

    (Assumption: Since such instructions/data(Assumption: Since such instructions/datawere needed recently, they will be neededwere needed recently, they will be needed

    again in the near future.)again in the near future.)

  • 8/3/2019 1.Organization

    8/17

    Hardware: SummaryHardware: SummaryPutting the pieces together:Putting the pieces together:

    CPU

    Bus

    Main

    Memory

    Secondary

    Memorycache

    Programs are stored (longPrograms are stored (long--term) in secondary memory,term) in secondary memory,and loaded into main memory to run, from whichand loaded into main memory to run, from whichthe CPU retrieves and executes their statements.the CPU retrieves and executes their statements.

  • 8/3/2019 1.Organization

    9/17

    Software: OSSoftware: OSTheThe operating systemoperating system (OS) is loaded from(OS) is loaded from

    secondary memory into main memory whensecondary memory into main memory when

    the computer is turned on, and remains inthe computer is turned on, and remains inmemory until the computer is turned off.memory until the computer is turned off.

    RAM DiskCPUCache

    Bus

    OS

  • 8/3/2019 1.Organization

    10/17

    Software: OSSoftware: OSThe OS acts as the manager of the system,The OS acts as the manager of the system,

    making sure that each hardware devicemaking sure that each hardware device

    interacts smoothly with the others.interacts smoothly with the others.

    It also provides the interface by which theIt also provides the interface by which theuser interacts with the computer, and awaitsuser interacts with the computer, and awaits

    user input if no application is running.user input if no application is running.

    Examples: MacOS, WindowsExamples: MacOS, Windows--95, Windows95, Windows--NT,NT,UNIX, Linux, Solaris, ...UNIX, Linux, Solaris, ...

  • 8/3/2019 1.Organization

    11/17

    Software: ApplicationsSoftware: ApplicationsApplications are nonApplications are non--OS programs thatOS programs that

    perform some useful task, includingperform some useful task, including

    word processors, spreadsheets, databases,word processors, spreadsheets, databases,web browsers, C++ compilers, ...web browsers, C++ compilers, ...

    Example C++ compilers/environments:Example C++ compilers/environments:

    CodeWarrior (MacOS, Win95, WinNT, Solaris)CodeWarrior (MacOS, Win95, WinNT, Solaris)

    GNU C++ (UNIX, Linux)GNU C++ (UNIX, Linux)

    Turbo/Borland C++ (Win95, WinNT)Turbo/Borland C++ (Win95, WinNT)

    Visual C++ (Win95, WinNT)Visual C++ (Win95, WinNT)

  • 8/3/2019 1.Organization

    12/17

    Software: User ProgramsSoftware: User ProgramsPrograms that are neither OS programs norPrograms that are neither OS programs nor

    applications are called user programs.applications are called user programs.

    User programs are what youll be writing inUser programs are what youll be writing inthis course.this course.

  • 8/3/2019 1.Organization

    13/17

    Putting it all togetherPutting it all togetherPrograms and applications that are not running arePrograms and applications that are not running are

    stored on disk.stored on disk.

    RAM DiskCPUCache

    Bus

    OS App

  • 8/3/2019 1.Organization

    14/17

    Putting it all togetherPutting it all togetherWhen you launch a program, the OS controls the CPUWhen you launch a program, the OS controls the CPU

    and loads the program from disk to RAM.and loads the program from disk to RAM.

    RAM DiskCPUCache

    Bus

    OS AppAppOS

  • 8/3/2019 1.Organization

    15/17

    Putting it all togetherPutting it all togetherThe OS then relinquishes the CPU to the program,The OS then relinquishes the CPU to the program,

    which begins to run.which begins to run.

    RAM DiskCPUCache

    Bus

    OS AppAppApp

  • 8/3/2019 1.Organization

    16/17

    The FetchThe Fetch--Execute CycleExecute CycleAs the program runs, it repeatedly fetches the nextAs the program runs, it repeatedly fetches the next

    instruction (from memory/cache), executes it,instruction (from memory/cache), executes it,and stores any results back to memory.and stores any results back to memory.

    RAM DiskCPUCache

    Bus

    OS AppAppApp

    Thats all a computer does: fetchThats all a computer does: fetch--executeexecute--store,store,millions of times each secondmillions of times each second!!

  • 8/3/2019 1.Organization

    17/17

    SummarySummaryA computer has two kinds of components:A computer has two kinds of components:

    Hardware: its CPU, RAM, Disk(s), ...Hardware: its CPU, RAM, Disk(s), ...

    Software, its OS, Applications, and User Programs.Software, its OS, Applications, and User Programs.