Von Neuman Architecture • Design model for a computer • Named after John von Neuman • Instructions that tell the computer what to do are stored in memory • Stored program Memory CPU Input Output
Memory • The working memory of the computer • Where program and data are stored • RAM • ROM • Cache • Flash Memory • Volatile and non-volatile memory
Memory Organization • You can think of memory as consisting of a number of boxes • Each box can hold a number • Contents • Each box is numbered • Address
Bit • A bit is the basic unit of information in computing • A bit can be in one of two distinct states. In other words it can be used to represent two distinct things • Because one bit can only represent two distinct values, computers typically work with more than one bit at a time. • Much like a single digit can only represent 10 things and we typically use numbers with more than one digit
Combining Bits 2 states (0 or 1 ) 4 states (00, 01, 10 or 11 ) 8 states (the 4 from before – twice) 16 states (the 8 from before – twice) 32 states (2 x 2 x 2 x 2 x 2) 64 states (26)
Central Processing Unit (CPU) • “Brain” of the computer • Can execute a fixed number of instructions • Instructions are numbered • Instructions are very simple
CPU Architecture • A CPU usually has registers • Memory locations in the CPU • Small number of them • Usually very fast • One register is called the program counter (PC) • The PC stores the address of the next instruction to execute PC R1 R2
Your First Program Input number into R1 Move R1 to R2 Input number into R1 Add R1 to R2 Move R2 to R1 Output number in R1 Halt
Fetch Execute Cycle • The processor runs what is known as the fetch-execute cycle • Fetch instruction whose address is in the PC • Add one to the PC • Execute the instruction • Go back to step 1
Running our Program PC: 0 R1: 0 R2: 0 IR: 0
Running our Program PC: 0 R1: 0 R2: 0 IR: 219
Running our Program PC: 1 R1: 0 R2: 0 IR: 219
Running our Program PC: 1 R1: 24 R2: 0 IR: 219
Running our Program PC: 1 R1: 24 R2: 0 IR: 91
Running our Program PC: 2 R1: 24 R2: 0 IR: 91
Running our Program PC: 2 R1: 24 R2: 24 IR: 91
Running our Program PC: 2 R1: 24 R2: 24 IR: 219
Running our Program PC: 3 R1: 24 R2: 24 IR: 219
Running our Program PC: 3 R1: 35 R2: 24 IR: 219
Running our Program PC: 3 R1: 35 R2: 24 IR: 87
Running our Program PC: 4 R1: 35 R2: 24 IR: 87
Running our Program PC: 4 R1: 35 R2: 59 IR: 87
Running our Program PC: 4 R1: 35 R2: 59 IR: 92
Running our Program PC: 5 R1: 35 R2: 59 IR: 92
Running our Program PC: 5 R1: 59 R2: 59 IR: 92
Running our Program PC: 5 R1: 59 R2: 59 IR: 211
Running our Program 59 PC: 6 R1: 59 R2: 59 IR: 211
Running our Program PC: 6 R1: 59 R2: 59 IR: 255
Running our Program HALT!! PC: 7 R1: 59 R2: 59 IR: 255
Programming • What we just did • Define a problem • Prepare sequence of instructions for the computer to execute • What do you think? Want to do this for a living?
Did you Realize? • Be honest, did you realize this was a program? • In memory a program looks just like numbers • Number can be manipulated!! • What happens if I add one to memory location 1 and run the program?
Program as Data • Realizing that a program is data was a huge insight • It is possible to write programs that write programs • Ushered in programming languages
Processors Speeds • The processor speed is the speed in which the CPU can complete a certain amount of cycles per second. • This is otherwise known as a Hertz. • One Hertz means that one cycle can be completed in one second. • A megahertz means that one million cycles can be completed in a second. • A gigahertz means that per second, the process can handle one billion cycles. • The average processor speed today is on the order of 2 gigahertz. • The speed of a processor roughly corresponds to the number of instructions that can be executed in a fixed period of time.
Overclocking • Processors are designed to run at a specific speed, however, they are often designed to handle faster speeds • Overclocking refers to running your processor at a higher speed than it was designed for • System requires more power, generates more heat, and the lifespan of the processor is often shortened
Moore’s Law • Number of transistors on a chip doubles roughly every 2 years • Named after Gordon Moore one of the founders of Intel • Basically means we can expect performance to double every two years
Cores • It is now possible to place multiple CPUs, cores, on a single chip. • For example a quad-core processor has 4 CPUs • Using such a chip allows a processor to do more than one thing at a time. • The software running on a multi-core chip must be written to take advantage of the cores.
Motherboard • A motherboard provides the electrical connections by which the other components of the system communicate. • A typical desktop computer has its microprocessor, main memory, and other essential components connected to the motherboard.
Graphics Cards • A video card, video adapter, graphics accelerator card, display adapter, or graphics card is an expansion card which generates output images to a display • Video hardware is often integrated into the motherboard, however all modern motherboards provide expansion ports to which a video card can be attached. • A dedicated graphics card has its own RAM and Processor specifically for processing video images.
Storage • Memory provides temporary storage for information. Most systems require some form of permanent storage. • Magnetic hard drives are probably the most common form of storage • Most systems also usually have 1 or 2 CD/DVD (optical) drives
Hard Disk Drive (HDD) • A hard disk drive is a non-volatile, random access storage device. • It contains rotating platters on which data is magnetically read and written to. Read write heads float on a film of air above the platters. • Introduced by IBM in 1956, hard disk drives have decreased in cost and physical size over the years while dramatically increasing in capacity.
How Data is Stored • Data is stored on the surface of a platter in sectors and tracks. • Tracks are concentric circles • Sectors are pie-shaped wedges on a track
Performance • A typical desktop machine will have a hard disk with a capacity of between 250 and 500 gigabytes. • There are two ways to measure the performance of a hard disk: • Data rate - The data rate is the number of bytes per second that the drive can deliver to the CPU. Rates between 5 and 40 megabytes per second are common. • Seek time - The seek time is the amount of time between when the CPU requests a file and when the first byte of the file is sent to the CPU. Times between 10 and 20 milliseconds are common.
Input/Output • Most computers provide a variety of connections for external devices • USB, or Universal Serial Bus, is a hardware bus standard that allows users to plug a peripheral device into a USB port and have it automatically configured and ready to use. • FireWire is Apple's name for the IEEE 1394 High Speed Serial Bus. It was initiated by Apple (in 1986) and developed by the IEEE P1394 Working Group.
Network • Virtually every computer has support for connecting to a network. The connection can either be wired or wireless • A wired connection requires access to a router or switch. • A wireless connection requires access to a wireless access point
Wireless Networking • Wireless networks transmit at frequencies of 2.4 GHz or 5 GHz. The higher frequency allows the signal to carry more data. • Wireless networks use 802.11 networking standards, which come in several flavors: • 802.11a transmits at 5 GHz and can move up to 54 megabits of data per second. • 802.11b is the slowest and least expensive standard. It can handle up to 11 megabits of data per second. • 802.11g transmits at 2.4 GHz like 802.11b, but it's a lot faster -- it can handle up to 54 megabits of data per second. • 802.11n is the newest standard that is widely available and can achieve speeds as high as 140 megabits per second.