CSIS-110 Introduction to Computer Science Dr. Meg Fryling “Dr. Meg” Fall 2012 @SienaDrMeg #csis110
Lecture Fourteen Agenda Questions? Exam questions? Assignments CSI Ch 6: Hardware Homework 3 – Part I (1-3) Note: Exam 1 Solutions on Piazza If you don’t know why you got something wrong, please find out!
Assignments Readings: See course scheduled on syllabus Homework 3 The textbook readings are going to help you with homeworks AND labs See pdf on Piazza Homework 3 Due at START of class Monday 10/29 Program Template Coming to class late does NOT extend your due date/time Lab 5 Due at START of lab 6 Coming to lab late does NOT extend your due date/time
For Wednesday’s Class Install Racket on your laptop http://racket-lang.org/download/ Scheme programming environment Bring your laptop to class We will do some Scheme and Python programming in class
Memory – Volatile Registers Cache RAM Small storage in ALU Contain one word (how big is that?) and info that will be needed immediately Access is fast! Cache Small and fast Usually built into processor chip Processors can access without FSB Contains copies of frequently used data RAM Main memory Access via FSB if not found in Cache Can be accessed directly (Random) Word is usually 2 bytes (16 bits) Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory.
Figure 6.1 The von Neumann architecture Bus - A set of wires that connect all major sections Figure 6.2 Data flow through a von Neumann architecture
The Fetch-Execute Cycle Figure 6.3 The Fetch-Execute Cycle
Secondary Storage Devices Why is it necessary to have secondary storage devices? Can you name some of these devices?
Magnetic Disk Structure
Time to read/write data to disk Address of data: Surface, track, sector Seek time: Time it takes for the read/write head to get positioned over the right track Latency: Time it takes for the sector to spin to the read/write head Transfer Time: Time for one sector to move under the read/write head Access Time: Time it takes for a block to start being read Seek Time + Latency + Transfer Time
Disk Performance: Example Rotation speed: 7200 rev. / min Arm movement speed: 0.02 ms to move to the next track Tracks per surface: 1000 Number of surfaces: 1 Sectors per track: 50 Characters (bytes) per sector: 512
Disk Example (cont’d) First, convert the Rotation speed to Rotation time, in milliseconds (ms): Step 1: convert rev/minute to rev/second: 7200 rev / 1 minute = 120 rev / second Step 2: convert revolutions to seconds: 120 rev / 1 sec = 1 revolution in 1/120 of a second Step 3: convert to decimal: 1/120 = .00833 seconds / revolution Step 4: convert to milliseconds: .00833 seconds/rev = 8.33 ms/ rev 7200 rev / 1 minute = 120 rev / second 120 rev / 1 sec = 1 revolution in 1/120 of a second 1/120 = .00833 seconds / revolution .00833 seconds/rev = 8.33 ms/ rev
Disk Example (cont’d) Voila! Each rotation takes 8.33 ms! Now we can use this to calculate … seek time, latency, transfer time, and total access time 7200 rev / 1 minute = 120 rev / second 120 rev / 1 sec = 1 revolution in 1/120 of a second 1/120 = .00833 seconds / revolution .00833 seconds/rev = 8.33 ms/ rev
Time needed to move from the first to the last track Best-case Worst-case Average-case Seek Time Time needed to move from the first to the last track Time needed to move over 1/3 of the tracks Latency Time needed for one full revolution of the disk Time needed for half of the revolution of the disk Transfer Time Time needed for a block to pass under the head Total Access Time Sum of the above *We assume that in the average case, the read/right head moves about 1/3 of the total number of tracks.
Disk Example 1 (Continued) Rotation speed: 7200 rev/ min Remember we already calculated Rotation Time: 8.33 ms! Arm movement speed: 0.02 ms to move to the next track Tracks per surface: 1000 Number of surfaces: 1 Sectors per track: 50 Characters (bytes) per sector: 512 How many characters can be stored on a single disk? Seek time Latency Transfer time Total Best Worst Average