CSC Intro. to Computing Lecture 9: Computing Components
Announcements Homework #1 returned at end of class Mean score: 80; σ=15 Answer key available on web page Quiz at end of class on Thursday Practice quiz on Blackboard/web (answers on separate page) Do NOT memorize algebraic properties I will provide them
Working Together Goal is for students to learn Means mistakes are made, questions raised Peers useful when learning material But the goal is for YOU to learn material Talk about homework all you want Leave conversation with only memories, nothing written, typed, dictated, displayed on a screen… Wait at least 15 minutes before continuing with homework
How Does a Computer work? When discussing computers, most people think of processor A.k.a., Central Processing Unit (CPU) Examples include: Pentium IV, PowerPC, Itanium, Pentium M…
What To Execute Next Most modern computers use von Neumann architecture Does not require separate components to store data and instructions Harvard architecture would require 2 hard drives Uses control unit to drive entire machine Assumes existence of input & output devices
How a Computer Is Organized
CPU Design Processor is made up of several parts These parts serve many functions Calculating mathematical & logical functions Commanding actions of rest of computer
Arithmetic/Logical Unit Calculates mathematical & logical actions So does addition, subtraction, multiplication, division, AND, OR, NOT, NOR… Accepts only one or two inputs a + b/c is two instructions: an addition and division Uses small VERY fast memory: “Registers” Registers work at speed of processor, much faster than any other memory Only registers available on a machine
Control Unit Organizes and oversees program execution Also uses several registers: Instruction Register (IR) holds instruction to execute Program Counter (PC) states what instruction to execute next Control unit insures computer executes step- by-step in logical, orderly manner Often to the chagrin of person using computer
Memory Modern computers typically use 8-bit addressability 8 bits == 2 nibbles == 1 byte Each memory location stores 1 byte Most Intel-based machines use 32-bit address space Can access at most 2 32 different bytes Or no more than 4,294,967,296 bytes of memory
Memory continued Apple, AMD, and newer Intel-based machines use 64-bit address space How many times more memory is this? Why could this be needed?
Memory Modern desktop machines are 32-bit Means they access memory 32-bits at a time How computers view memory contents:
Memory What does the data represent? Could be a program, picture, mp3, CSC110 grades, … Processor translates this data into something more meaningful Output units then present this information
“Output Units” Output unit A device through which results stored in the computer memory are made available to the outside world
“Input Units” Input Unit A device through which data and programs from the outside world are entered into the computer
Limitations of Book Division What would a hard disk be considered?
Limitations of Book Analogy What would a hard disk be considered? Saving this class lecture Output Unit Loading this lecture Input Unit Some devices perform both input and output
Connecting the Computer
Time versus Space Rear Admiral Grace Murray Hopper A coil of wire nearly 1,000 feet long Distance traveled by an electron along the wire in the space of a microsecond A 1 foot piece of wire In the space of a nanosecond The length of a grain of pepper In the space of a picosecond
Bus Operations Bus “driven” at a specific frequency Different buses connect different components Do not want slow hard drive to work at speed of fast memory Could have two buses join at one point Only one device can write to bus at a time Two devices writing at once called a “collision” Sophisticated algorithms used to limit impact
Executing a Program Processors run at 3GHz+ Memory runs much slower But memory contains the instructions Processor does no good spinning wheels waiting for instruction from memory How can increasing processor speed be helpful?
Fetch-Execute Cycle Processor run like assembly line One stage fetches instruction for memory Stores small number of instructions in fast memory stored on processor – “cache” Next stage decodes the instruction Retrieves any data needed from memory Data stored in registers
Fetch-Execute Cycle Instruction is executed Multiple units execute instructions ALU executes math/logic functions Control unit handles “branch” instructions Have multiple ALUs to execute multiple instructions at once Final unit “retires” instruction Writes results back to main memory
Fetch-Execute Cycle
Processor Limitations Can only push processor so far Ultimately limited by speed of electrons Running into physical limits of how quickly silicon-based gates can switch Replacement technology is VERY expensive
Processor Bottleneck Solution Often have data all of which needs same transformation mp3s, movies, graphic files Weather forecasting Use fetch-execute cycle But execute each instruction on multiple data sets
Processor Bottleneck Solution Used in supercomputers, high-end workstations Have multiple processors perform actions simultaneously Also found in desktop/laptop machines Use multiple functional units in single processor Called “MMX” in Windows-based machines, “Altivec” on Macs
SIMD Processing
MIMD Processing Usually have multiple processes at once Using computer to “multitask” Could speed performance by splitting tasks onto different CPUs Could be done by splitting processor time Intel’s “hyperthreading” Could join multiple CPUs onto one chip Becoming more common as we speak
MIMD Processing
Secondary Storage Main memory is volatile and limited Secondary storage vital for long-term data Also stores unneeded data Need has existed since beginning of computer
Magnetic Tape One of first systems of saving data Works in manner identical to audio cassette Slow access times What are they still used for?
Magnetic Disks Small read/write head flies over platter Disk “crashes” when head contacts platter Platter covered in thin film of protective material Using multiple platters improves performance Can access data quicker Can improve disk reliability
Magnetic Disk
Magnetic Disks Head moves directly to location on disk with data Disk split into many tracks Like CD or record Each track split into sectors Each sector stores one block of data All blocks contain same amount of data
For Next Lecture Read PALGO chapters 1-5 First real work directing computers What I find most fun about computers Study up on circuits Quiz at end of next lecture Get ready for homework on computing components next week