Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

Contents 1 Introduction (0:00–10:00, 104:00–106:00) 2 Hardware (10:00–104:00) 2.1 RAM and the CPU . . . 2.2 Hard Drives . . . . . . . 2.3 Peripherals . . . . . . . 2.4 Specifications . . . . . .

. . . .

. . . .

. . . .

. . . .

1

. . . .

. . . .

. . . .

. . . .

. . . .

2

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

2 2 4 5 7

Computer Science E-1 Spring 2010 Scribe Notes

1

Lecture 2: February 1, 2010 Andrew Sellergren

Introduction (0:00–10:00, 104:00–106:00) • 0 new handouts. • As it turns out, Apple’s new iPad is a comedy goldmine. Check out the original video being parodied. Whether or not you think the iPad is just an oversized, overglorified iPhone, you can hopefully at least appreciate that it is a full-blown computer. What’s amazing is that it performs all of the same computations and understands the exact same binary that your clunky desktop does. • Please don’t think we’re being too harsh on Apple. Generally speaking, we try to find a middle ground between the hype and the hate. Consider that 9 years ago, people were also griping about the newly released iPod, which is now by far the most popular MP3 player available. • To recap our discussion of binary from last week, we’ll bring 8 volunteers up to the front of the class, each of whom will represent one of the bits in a byte. So the volunteer standing farthest to the right represents the 1’s column and the volunteer standing farthest to the left represents the 128’s column. Now if we have a select few of them raise their hands to represent their columns being filled with a 1, we can represent the numbers 01000010, 01001111, and 01010111 which in ASCII correspond to the letters B, O, and W. So we can spell out “BOW,” which the volunteers will do so we may thank them for their participation! • Assignment 1 was due today and Assignment 2 will be posted shortly. Come next week for the first of two movie nights with popcorn and Pirates of Silicon Valley! Check out the trailer here.

2 2.1

Hardware (10:00–104:00) RAM and the CPU • Recall from last week that the CPU is the brain of a computer. It handles virtually all user input and generates the appropriate output. It is thus the I/O (input/output) hub. Input might come from a keyboard or mouse or even from a peripheral device like a scanner or a camera. Output might be presented to the user on a monitor, through the speakers, or via a printer. • Data and information are stored persistently on the hard disk drive (HDD). Before we can interact with it, however, it must be loaded up into random access memory (RAM). Between RAM and the CPU are the L1 and L2 caches. • Whatever programs you have open will be loaded into RAM. The more programs you open, the more RAM you’ll use. If you run out of RAM, the programs will be loaded into virtual memory which is really just space

2

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

on the HDD. If we take a look at the Activity Monitor on Dan’s Mac (or equivalently the Task Manager on a PC), we can see how much of his RAM is currently being used. As it turns out, all of it is being used, so the CPU has borrowed some space from the HDD for additional programs. Unless you take a peek at the Activity Monitor or the Task Manager, you won’t know whether your CPU is using RAM or virtual memory in addition to RAM. The downside to virtual memory, of course, is that it’s much slower than RAM. You might actually be aware that your CPU is using virtual memory simply because you experience lag time when you bring a program to the foreground, which occurs when your CPU is moving the program from virtual memory to RAM. Some operating systems allow you to control how much space on the HDD will be reserved for virtual memory. You can, in fact, stipulate that the size of virtual memory be zero, in which case you might get memory overload errors if you try to open too many programs at once. Take note that Activity Monitor unfortunately misrepresents the amount of virtual memory available. • In Activity Monitor or Task Manager, it’s useful to sort by RAM descending so you can see which programs are taking up the most memory. Browsers in particular have problems with memory leaking meaning the amount of memory they consume increases the longer they are open. If you notice in Activity Monitor or Task Manager that the amount of memory a program is using continually increases, it may be because of a memory leak. Although you can’t do much to prevent the problem, you can temporarily fix it by closing the program and reopening it. • Question: as an aside, memory leaks arise when programs fail to free memory they aren’t using anymore. In order for a program’s memory to be reused, the program must “free” it, or in other words alert the operating system that it doesn’t need it anymore. • Question: you might notice that programs are using CPU cycles even when you’re not directly interacting with them. In the case of a browser, this might happen if you are on a website that automatically updates its concent periodically. Adobe’s Flash software (which powers YouTube videos, for example) is particularly wasteful when it comes to CPU resources. You might notice a jump in CPU usage when you access a website that uses Flash. Note that dual-core processors essentially have two CPUs, so your total CPU usage might exceed 100%. • When we said earlier that RAM is divided up until it runs out and virtual memory is provided instead, we were actually oversimplifying the process. In fact, each open program’s memory is divided between real and virtual. The operation system frequently asks each program if it has any memory that it doesn’t immediately need. If so, the operating system will designate this virtual memory and place it on the HDD until it is requested.

3

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

• In Activity Monitor, the Kind column will tell you which applications have been rewritten to support 64-bit processors. Just because an application supports 64-bit processors, hwoever, doesn’t mean that it will actually make use of those extra bits. Furthermore, even if it does, it might not improve performance all that much. So don’t think that 32-bit processors are at that much of a disadvantage these days. • Question: what are threads (i.e. what does the Threads column in Activity Monitor refer to)? Certain programs have the ability to split themselves into several different instances, or threads. Google Chrome, for example, uses a different thread for each tab that is open. That way, if a single tab is taking a long time to load, it won’t freeze up the rest of the program. Programs that support multi-threading make good use of multi-core processors: if a program can create separate threads for each operation it wants to complete, then these threads can be send to separate cores which will thus execute multiple operations at the same time. In years gone by, when multi-threading didn’t exist, your entire CPU might have been tied up while you printed a document. Nowadays, you can send something to the printer and go about your other business. 2.2

Hard Drives • To recap from last week: what will we see when we open up a hard drive? We should see a few platters, which actually store the data, as well as read-write heads which actually manipulate the data. Because hard drives consist of these mechanical parts which spin and move at great speeds, they have a very high rate of failure. The lifespan of a hard drive is generally only a few years. For that reason, you should back up your data often! When your hard drive fails, you can check its label to find the manufacturer and call them to see if it’s still under warranty. • When you take apart a hard drive (not recommended if you ever want to use it again), you’ll actually notice that at a certain point it “depressurizes.” When hard drives are being assembled, their parts are packed together very tightly. Because we’ve already taken apart this hard drive once before, we won’t observe it in this case. • The platters inside the hard drive are circular in shape and have a thin metallic coat with mirror-like reflectiveness. Touching this surface will undoubtedly ruin the data on the drive. The alignment of each magnetic particle determines which digit it represents. For example, we might designate that when the north end of the particle points right, it represents a 0. When the north end of the particle points left, it represents a 1. The alignment of these particles is set by sending an electric current through the read-write heads. In the opposite process, data is read from these particles by spinning the platters very quickly and producing a small amount of electrical current which is conducted by the read-write heads. 4

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

• In older hard drives, the magnetic particles were aligned parallel to the direction of the platters’ spinning. In newer hard drives, they are aligned perpendicular to the direction of the platters’ spinning, which allows for more of them to fit together on the same size platter. This helped increase hard drive capacity. Other innovations which increased hard drive capacities were smaller read-write heads and the addition of more platters. Unfortunately, because the magnetic particles have a fixed size, there is an upper limit on the capacity of hard drives of this type. Recently, the solid-state drives (SSDs), which resemble RAM in that they don’t have moving parts but rather appear to have chips on their surface, have become more popular. Unfortunately, the technology is still fairly expensive, so for the same amount of money, you can buy a HDD with much higher capacity than an SSD. Because there are no moving parts in an SSD, it tends to be faster than a normal HDD. • Hard drives are characterized by the speed of its platters, measured in revolutions per minute. A typical hard drive might be 7200 RPM. The read-write heads are so close to the platters that a human hair couldn’t fit between them. This slim separation is one of the reasons hard drives can be so easily damaged by a physical stress like a computer being dropped. The hard drive platters, along with the fan, are one of the few remaining components of a computer that have moving parts. Recall that the fan is used to cool the CPU which builds up tremendous heat while performing so many operations in such a small space and a short amount of time. Solid-state drives are also an improvement over HDDs in the sense that they have no more moving parts which are subject to mechanical failures. They are akin to USB flash drives in that they store data directly on the chip. 2.3

Peripherals • Recall from last week our brief mention of the various ports which are used to attach peripheral devices to your computer. Some of them are pictured below:

5

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

Peripheral and serial ports, which are slower and bulkier, are being phased out. These days, nearly every device can be connected via a USB port. USB ports themselves have even undergone revision: USB 1.0 had a speed of 11 megabits per second (less than 1.5 MBps) whereas USB 2.0 has a speed of 480 megabits per second (approx. 60 MBps). Intel and Apple have promised that a new connector named Light Peak, which uses fiber optics, will be able to achieve transfer speeds of 10 gigabits per second and up! • Another more modern type of connector you may have heard of is FireWire, alternately known as IEEE 1394 or i.LINK. Many cameras and video devices have this type of connector. • Some examples of display connectors are VGA, DVI, and HDMI. VGA was the standard for a long time, but is gradually being edged out by DVI and HDMI which actually transmit data digitally. Next in line is DisplayPort. • The back of your computer may also have a series of indicator lights which can notify you of the computer’s status if you have the manual. For example, it might alert you to a CPU or RAM failure.

6

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

• In the area of portable storage, we’ve gone from floppy drives to CDs to DVDs. Although CDs and DVDs and now Blu-ray discs are all the same size, they differ greatly in the amount of data they can store. CDs can store about 700 MB, DVDs can store about 4.7 GB, and Blu-ray discs can store about 30 GB. 2.4

Specifications • If we take a look at Apple’s specifications page for the Mac Pro, we see a lot of techno-speak that we’re now beginning to understand. At the top, it mentions that you can buy the CPU with 1 or 2 processors, each of which has 4 cores, making the whole system either 8-core or Quad-core. • Under the Memory section, we see that there is room for either 4 or 8 DIMMs (the sticks of RAM), each of which may be 1 GB, 2 GB, or 4 GB. Thus, the whole system might have a total memory capacity of 16 or 32 GB. • On the top right, under Connections and audio, we can see the various ports which are available on the Mac Pro, namely 4 FireWire, 5 USB, 2 Ethernet jacks, and more. PCI Express slots are also available for expansion, x16 being faster than x4. In terms of hard drives, the Mac Pro offers SATA connectivity. • These days, the specifications of the DVD drive tend not to matter too much, but suffice it to say that the Mac Pro can both read from and write to DVDs. DVD-R and DVD+R are one-time-use recordable formats and DVD-RW is a reusable recordable format. • Be wary of offers to optimize your computer. There are stores which will charge you large sums of money just to remove desktop clutter and tweak settings which may or may not have any effect at all on your computer’s performance. As E-1 students, you will soon be well-prepared to avoid scams like this and to undertake the task of optimizing your own computer if you so desire. • Dell’s Inspirons page details its systems in much the same language as Apple used to detail the Mac Pro. Processors in PCs are generally either AMD or Intel with AMD tending to be cheaper. In terms of operating systems, Windows 7 seems to be pleasing more users than Vista. • One interesting caveat to beware of: comparing processor speeds between two different processors isn’t useful at all. Different manufacturers and even different models can vary greatly in their actual speeds. • Ironically, Apple’s decision to offer fewer options to consumers might actually be more appealing. The number of options available in building your own PC can often seem overwhelming. David’s advice for choosing

7

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 2: February 1, 2010 Andrew Sellergren

laptops: start with screen size. Go to the store and play around with a Mac or PC and find out what screen size feels comfortable for you. Only then consider processor speed and disk space. • Be wary that manufacturers will try to upsell you with regard to RAM and disk space. In other words, they’ll charge you more for additional memory than it would cost to buy it separately and install it yourself. Of course, it’s much more difficult to install memory on a laptop than on a desktop, so keep that in mind. • Now that you have this new knowledge about hardware, you might find it interesting to go to a store and ask a few questions about system specifications. You might even find that the salesmen will make inaccurate or irrelevant claims! • Question: building a system yourself is certainly feasible and even fun, but it can be a pain when one of the components fails and you have to figure out which one it is. If you have a pre-built system, you’ll be dealing with a single manufacturer. Also keep in mind that you need to do a good amount of research to make sure that all of the components you’re buying separately will actually work together. If you’re willing to put in the time to build it and service it yourself, however, you may save yourself some money and you’ll certainly learn a lot. A great place to start for buying hardware is Newegg.

8

Computer Science E-1 Spring 2010 Scribe Notes Lecture 2: February ...

Feb 1, 2010 - Come next week for the first of two movie nights with popcorn and Pirates of Silicon Valley! Check out the trailer here. 2 Hardware (10:00–104:00). 2.1 RAM and the CPU. • Recall from last week that the CPU is the brain of a computer. It handles virtually all ... Some operating systems allow you to control how ...

351KB Sizes 0 Downloads 235 Views

Recommend Documents

Computer Science E-1 Spring 2010 Scribe Notes Lecture 2: February ...
Feb 1, 2010 - original video being parodied. Whether or not you think the iPad is just an oversized, overglorified iPhone, you can hopefully at least appreciate that it is a full-blown ... which case you might get memory overload errors if you try to

Computer Science E-1 Spring 2010 Scribe Notes Lecture 9: April 19 ...
Apr 19, 2010 - Once we write these lines of code in a text editor and save it to a file called ... the command line. By default, this will output an executable file named a.out. If we then execute the command ./a.out, we see that “hello” is print

Computer Science E-1 Spring 2010 Scribe Notes Lecture 9: April 19 ...
Apr 19, 2010 - Actually, x is always going to be greater than. 0 since we're going to increment it. The actual code of the loop prints out the value of x using some cryptic syntax. Ultimately, then, this program counts upwards from 1 indefinitely. 2.

Computer Science E-1 Spring 2010 Scribe Notes Lecture 6: March 29 ...
website is first being encrypted with a generally hard-to-crack algorithm .... easy to implement in the form of a function—think of a function as a machine that ...

Computer Science E-1 Spring 2010 Scribe Notes Lecture 4: March 1 ...
Computer Science E-1. Spring 2010. Scribe Notes. Lecture 4: March 1, 2010. Andrew Sellergren. Contents. 1 Introduction (0:00–3:00). 2. 2 The Internet ...

Computer Science E-1 Spring 2010 Scribe Notes Lecture 6: March 29 ...
Lecture 6: March 29, 2010. Andrew Sellergren. • One of the pieces of information we can see about computers connected to the same router is the MAC address. These MAC addresses are serial numbers that identify network cards in computers. On some ho

Computer Science E-1 Spring 2010 Scribe Notes Lecture 4: March 1 ...
time. 2 The Internet (3:00–100:00). 2.1 DNS (3:00–5:00, 12:00–20:00). • Recall from last week that when you type in a URL into your browser's address bar, one ...

Computer Science E-1 Spring 2010 Scribe Notes Lecture 8: April 12 ...
websites are secure prior to submitting personal information 2. do your homework to ensure ... Symantec. They rank the top 5 riskiest cities online as follows: Seattle, .... will become more clear when we dive into a real programming language in a fe

Computer Science E-1 Spring 2010 Scribe Notes Lecture 8: April 12 ...
cure considering they have your home address, bank account num- ber, routing number, and sometimes even your social security number printed on them. – Why are many public WAPs unencrypted? Logistically, it would be unreasonable to require users to

Computer Science E-1 Spring 2010 Scribe ... - The Open Academy
We'll soon make a tool available via web or e-mail that will allow you ... address bar. http://www.cnn.com:80/ will take us to CNN's homepage as usual. • If you'd ...

Computer Science 50 Fall 2010 Scribe Notes Week 0 Wednesday ...
Sep 1, 2010 - the order of a web search engine), how many steps would it take to find that one page we're looking for? Not as many as you might think: only.

Computer Science 50 Fall 2010 Scribe Notes Week 0 Wednesday ...
Another more intelligent approach would be to flip to the middle of the phonebook to ... oped by MIT's Media Lab to teach programming to children. ... flash drive.

Computer Science 50 Fall 2010 Scribe Notes Week 0 Wednesday ...
Sep 1, 2010 - the order of a web search engine), how many steps would it take to find that one page we're looking for? Not as many as you might think: only.

Computer Science 50 Fall 2010 Scribe Notes Week 1 Friday ...
links in the ncurses.h library, a graphic library for C. In step 3, we actually .... a problem in industries like finance or biology. ... Conditions take the following form in C: ..... Linux command called man that provides a manual page for any func

Computer Science 50 Fall 2010 Scribe Notes Week 3 Monday ...
David recently got an e-mail requesting that he provide his FAS username and password due to a server upgrade. He clicked on the link to do so and, to his ...

Computer Science 50 Fall 2010 Scribe Notes Week 3 Monday ...
Almost 200 of you have so-called normal phones (i.e. non-smartphones). By the way ... is for Android, BlackBerry, and iPhone apps come semester's end when.

Computer Science 75 Fall 2009 Scribe Notes Lecture 2: September 21 ...
Project 1 will task you with implementing an online ordering system for our beloved, but now defunct Three Aces Pizza. One of the challenging aspects of this project will be to develop a logical representation of the menu in XML format. The menu itse

Computer Science 50 Fall 2010 Scribe Notes Week 2 ... - CS50 CDN
wrap around to positive 2 billion as it overflows its storage and the critical bit that designates its sign gets flipped. At that point, the program will stop executing ...

Computer Science 50 Fall 2010 Scribe Notes Week 2 ... - CS50 CDN
Terminal on a Mac or PuTTY on a PC. On a Mac, you'll type ssh [email protected],1 enter your password, and you'll be connected. On a PC, you'll open a ...

Lecture Notes in Computer Science
study aims to examine the effectiveness of alternative indicators based on wavelets, instead of some technical ..... In this paper, the energy, entropy and others of CJ(k), wavelet coefficients at level J, .... Max depth of initial individual program

Lecture Notes in Computer Science
... S and Geetha T V. Department of Computer Science and Engineering, .... concept than A. If the matching degree is unclassified then either concept A or B is.

Lecture Notes in Computer Science
tinct systems that are used within an enterprising organization. .... files and their networks of personal friends or associates, Meetup organizes local ..... ployed, and in a busy community any deleted pages will normally reappear if they are.

Lecture Notes in Computer Science
forecasting by means of Financial Genetic Programming (FGP), a genetic pro- ... Address for correspondence: Jin Li, CERCIA, School of Computer Science, The ...

Lecture Notes in Computer Science
This is about twice the data generated in 1999, given an increasing ... the very same pre-processing tools and data have been used by all of them. We chose.