1 cs 106 computing fundamentals ii chapter 21 “computer organization” herbert g. mayer, psu cs...

15
1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Herbert G. Mayer, PSU CS Status 7/9/2013 Status 7/9/2013 Initial content copied verbatim from Initial content copied verbatim from CS 106 material developed by CS 106 material developed by CS professors: Cynthia Brown & Robert Martin CS professors: Cynthia Brown & Robert Martin

Upload: curtis-martin

Post on 20-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

1

CS 106Computing Fundamentals II

Chapter 21“Computer Organization”

Herbert G. Mayer, PSU CSHerbert G. Mayer, PSU CSStatus 7/9/2013Status 7/9/2013

Initial content copied verbatim fromInitial content copied verbatim fromCS 106 material developed byCS 106 material developed by

CS professors: Cynthia Brown & Robert MartinCS professors: Cynthia Brown & Robert Martin

Page 2: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

2

Syllabus Nature of DataNature of Data Computer OrganizationComputer Organization What Makes a Computer?What Makes a Computer? Computer ModulesComputer Modules Instruction Set ArchitectureInstruction Set Architecture Bits, Moving BitsBits, Moving Bits OSOS ApplicationsApplications

Page 3: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

3

Nature of Data

• Spreadsheets give us a way to create Spreadsheets give us a way to create processes that manipulate dataprocesses that manipulate data

• We can think of a piece of data as a We can think of a piece of data as a quantity that can be stored in a cell of a quantity that can be stored in a cell of a worksheetworksheet

• That cell represents an identifiable, That cell represents an identifiable, physical location where the data residesphysical location where the data resides

• What happens when you work on a What happens when you work on a spreadsheet or other programspreadsheet or other program

Page 4: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

4

Computer Organization (1)• A typical computer is made up of a few basic A typical computer is made up of a few basic

parts:parts:

• ProcessorProcessor. This is the “chip” where the work gets . This is the “chip” where the work gets donedone

• Might be an Intel chip or AMD or some other kind. Might be an Intel chip or AMD or some other kind. Modern chips have multiple processors (“cores”) Modern chips have multiple processors (“cores”) on them that can share the workon them that can share the work

• Modern computers have yet another processor for Modern computers have yet another processor for graphics processinggraphics processing

• A measure of chip quality is the speed, measured A measure of chip quality is the speed, measured in Gigaherz. The bigger number means faster work! in Gigaherz. The bigger number means faster work! Does it matter? We wait anyway Does it matter? We wait anyway

• Amount of heat (in Watts) generated is critical Amount of heat (in Watts) generated is critical

Page 5: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

5

Computer Organization (2)• Memory.Memory. This memory is like the memory on a This memory is like the memory on a

microwave; when the computer is off or loses microwave; when the computer is off or loses power, the memory loses its contents (the way your power, the memory loses its contents (the way your microwave forgets what time it is when you have a microwave forgets what time it is when you have a power outage)power outage)

• Memory is fast and is connected closely with the Memory is fast and is connected closely with the processor. Yet memory speed is slow in relation to processor. Yet memory speed is slow in relation to the CPUthe CPU

• Memory speed is often measured in Megaherz; faster Memory speed is often measured in Megaherz; faster is better. The size of memory is measured in is better. The size of memory is measured in Gigabytes; 4 on 32-bit computersGigabytes; 4 on 32-bit computers

• Storage, implemented as: disks, SSDs, or flash Storage, implemented as: disks, SSDs, or flash drivesdrives

• Flash storage holds its value when the power is Flash storage holds its value when the power is off, but is slower than regular memory. Size could off, but is slower than regular memory. Size could be Gigabytesbe Gigabytes

Page 6: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

6

Computer Organization (3)

• CacheCache. This is a special-purpose memory . This is a special-purpose memory that mediates between working memory and that mediates between working memory and the processor. Having a good-size cache the processor. Having a good-size cache can make the computer faster. Caches are can make the computer faster. Caches are fast, yet expensive, consume more powerfast, yet expensive, consume more power

• Input devicesInput devices. Keyboard, mouse, and . Keyboard, mouse, and microphone but also game controllers, microphone but also game controllers, laboratory instruments, etc.laboratory instruments, etc.

• Output devicesOutput devices, such as screen, printer, , such as screen, printer, speaker, and others, like robot arms or a speaker, and others, like robot arms or a car’s brake systemcar’s brake system

Page 7: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

7

What Makes a Computer?

• Many modern appliances have built-in Many modern appliances have built-in chips; e.g. cars, televisions, washing chips; e.g. cars, televisions, washing machines, etc.machines, etc.

• What makes a computer special is that it What makes a computer special is that it stores its program in memory, just like stores its program in memory, just like data, and can accept and execute new data, and can accept and execute new programsprograms

• It can also potentially modify its own It can also potentially modify its own programs (“learn”)programs (“learn”)

Page 8: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

8

Computer Modules

Page 9: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

9

Instruction Set Architecture

Page 10: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

10

Bits

• Bit: Short for Bit: Short for BIBInary diginary digiTT

• Everything in the computer, whether it is Everything in the computer, whether it is text, numerical data, music, videos, text, numerical data, music, videos, programs like Excel, macros or other code programs like Excel, macros or other code you write, or the operating system you write, or the operating system (Windows, MacOS, OSX, Linux) is stored (Windows, MacOS, OSX, Linux) is stored digitally in these bits, tiny devices digitally in these bits, tiny devices that have two distinct physical statesthat have two distinct physical states

• Abstractly these states are represented by Abstractly these states are represented by the numbers 0 and 1. Such an individual 0 the numbers 0 and 1. Such an individual 0 or 1 container is the or 1 container is the bitbit

Page 11: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

11

Moving bits, Simplistic Model

• It would be too inefficient for the computer to It would be too inefficient for the computer to access and move bits individually, though bit-based access and move bits individually, though bit-based computers have been designed, e.g. NCR successor of computers have been designed, e.g. NCR successor of Century seriesCentury series

• Bits are grouped into chunks that are moved around Bits are grouped into chunks that are moved around the computer, from the disk to the memory to the CPU, the computer, from the disk to the memory to the CPU, as a groupas a group

• The bigger the chunk is, the faster the computer can The bigger the chunk is, the faster the computer can move data. A “32 bit” computer moves data in 32 bit move data. A “32 bit” computer moves data in 32 bit chunks. A “64 bit” computer moves data in bigger 64-chunks. A “64 bit” computer moves data in bigger 64-bit chunks and can conveniently handle a bigger bit chunks and can conveniently handle a bigger working memory working memory

• The original chunk was typically a byte (8 bits)The original chunk was typically a byte (8 bits)

• Note that bus width and natural data width are Note that bus width and natural data width are orthogonalorthogonal

Page 12: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

12

Operating System• The operating system is the key system SW on The operating system is the key system SW on

your computer: it controls what happens, and your computer: it controls what happens, and manages resources. If you have multiple manages resources. If you have multiple programs open, for example, and you type programs open, for example, and you type something, it figures out where the something, it figures out where the characters should gocharacters should go

• While the computer is up and running, the While the computer is up and running, the operating system is resident in working operating system is resident in working memory, to be fastmemory, to be fast

• But when the computer is turned off… the But when the computer is turned off… the memory is wiped outmemory is wiped out

• So when you turn your computer on, how does So when you turn your computer on, how does it get started with no operating system?it get started with no operating system?

Page 13: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

13

“Booting”

• A special, dedicated device = chip that A special, dedicated device = chip that retains its data when power is off, has a retains its data when power is off, has a small program built insmall program built in

• When you turn on your computer this program When you turn on your computer this program loads the actual operating system from the loads the actual operating system from the external memory into the working memoryexternal memory into the working memory

• This is called “booting” because it is This is called “booting” because it is supposedly like picking yourself up by your supposedly like picking yourself up by your own bootstrapsown bootstraps

• This is what is going on during the minutes This is what is going on during the minutes (on Windows) after you turn on the computer (on Windows) after you turn on the computer before your operating system shows upbefore your operating system shows up

Page 14: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

14

Applications

• Besides your operating system and some Besides your operating system and some associated programs, your computer also associated programs, your computer also has application programs that actually do has application programs that actually do the things you want to do: word the things you want to do: word processing, games, spreadsheets, play processing, games, spreadsheets, play music, etc.music, etc.

• The typical computer user just The typical computer user just usesuses applications. In this class we will be applications. In this class we will be creatingcreating some applications inside of Excel some applications inside of Excel

Page 15: 1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS

15

1986 Cray 2 Supercomputer