380 likes | 654 Views
Computer Hardware – Inside the box. Hardware/Software Memory Ram Rom Other memory technologies CPU Instructions Programs Types of CPUs Buses Ports. CPU. RAM. ROM. Bus. Hardware and Software. Hardware: The parts of the computer that can be kicked - Jeff Pesis
E N D
Computer Hardware – Inside the box • Hardware/Software • Memory • Ram • Rom • Other memory technologies • CPU • Instructions • Programs • Types of CPUs • Buses • Ports CPU RAM ROM Bus Craig Schock, 2003, 1
Hardware and Software • Hardware: The parts of the computer that can be kicked • - Jeff Pesis • Hardware are the physical parts of a computer • Software are the programs which can be executed on the computer • Sometimes called “Applications” • Microsoft Word, Excel and Access are programs which can be executed on your computer • Software is stored as information. Craig Schock, 2003, 2
Memory • Memory is one of the most important parts of a computer • Computers store and retrieve information. That information must be stored somewhere • Information is stored in memory. • There are many different kinds of memory • Volatile – The memory will be erased when power is turned off • Non-volatile – The memory will remain even after the power is turned off Craig Schock, 2003, 3
RAM – Random Access Memory • Sequential memory: memory elements must be access in a sequential fashion. • Random Access Memory: memory elements can be accessed in any order (i.e. randomly) • Memory is used to store information • Information is encoded in bits • Therefore, memory holds binary numbers • RAM is volatile! CPU RAM ROM Bus Craig Schock, 2003, 4
RAM – How much can it store? • Memory systems that we use today store information in bytes • Memory is just a series of bytes • In the 1970s, 4 kbytes was a lot of RAM • In the early 1980s, 16 kbytes was a lot of RAM • In the mid 1980s, 1 Mbyte was a lot of RAM • DOS machines were limited to 640K RAM for a period because of limitations in the operating system • Today, 1 Gbyte is a lot of RAM • Most computers today have 256 MB or 512 MB Craig Schock, 2003, 5
RAM – How is memory organized? • Think about it for a minute – How would YOU keep track of • 256 bytes? • 65536 bytes? • 16777384 bytes? • 1073741824bytes? Craig Schock, 2003, 6
RAM – How is memory organized? • In RAM, memory is organized as though it was a series of boxes. • Each box contains 8 bits (i.e. 1 byte) • For 1 gigabyte of RAM, there is 1073741824 boxes • How does one keep track of what goes into which box? 123 117 42 215 … Craig Schock, 2003, 7
RAM – Addressing • In a sequential memory system, one would have to go through the memory in sequence to find the specific piece of information one needs. • In Random Access Memory, each “box” can be accessed directly. • To do this, each box is assigned a number. • This number is called its “address” • When information is stored, it is stored to a specific address. • To retrieve information from RAM, one must know the address where the information is stored. Craig Schock, 2003, 8
RAM – Accessing Information • Because information can be retrieved from or stored in any storage location at any time, it is called RAM • Random Access Memory • There are no limitations on how the information is accessed (other than through the use of its address) 123 117 42 215 … Address: 1 2 3 0 Craig Schock, 2003, 9
RAM – A Computer’s Memory • In the old days, a programmer could write a program which had access to all memory within the computer. • This lead to all kinds of problems: • Most notably: one program might mistakenly or maliciously overwrite the memory of another program • One program may “steal” information from another program (this was a common hacker trick) • Today, programs only have access to a portion of the memory in the computer. How much memory a program gets is decided by the Operating System Craig Schock, 2003, 10
RAM – Good and Bad • RAM is a wonderful memory technology • It is fast! (<50 ns to get information) • It holds a large amount of information • It is easy to use • The problem with RAM is that it is Volatile • Any information which is stored in RAM disappears if the power is lost or the computer crashes. • There is some information that computers require to always be there Craig Schock, 2003, 11
ROM – Read Only Memory • When a computer is turned on, the system is in an unknown state • To start running properly, there are a series of steps that the computer needs to follow • These steps are encoded within a program • The process of starting up is called “booting” • The boot program cannot be stored within RAM because RAM is volatile • When the computer is turned off, RAM is erased • The solution: ROM CPU RAM ROM Bus Craig Schock, 2003, 12
ROM – Read Only Memory • ROM is a memory system which is organized using the same structure of RAM • Individual memory elements (bytes) are accessed through an address • The big difference between RAM and ROM is that once information is stored in ROM, it cannot be erased. • The information is “burned” into the ROM • ROM does not need power to hold information • ROM is non-volatile Craig Schock, 2003, 13
ROM – Booting • ROM is very useful when one requires memory which doesn’t change • Booting is an example. The boot process should be the same every time you boot • Similarly, the boot program must remain even when the power is turned off. Craig Schock, 2003, 14
ROM – The good and the bad • One of the nice things about ROM is that it does not need a continuous power source to retain its information. • The bad thing about ROM is that once it is set, the information cannot be changed. • For things like digital cameras: • RAM is too power consumptive • ROM isn’t changeable • Solution: Flash ROM Craig Schock, 2003, 15
FLASH ROM • Flash ROM has the same advantages of ROM: • It is non-volatile • However, Flash ROM is erasable • Once information has been stored in Flash, it remains without need for power • It can be erased for use again • This is useful for low-power applications which require long-term storage of information • NOTE: Flash ROM can only be erased so many times before it stops working. (100,000 is common) Craig Schock, 2003, 16
Other special kinds of memory • VRAM: special purpose RAM for use in a video adapter • Can be accessed by two separate devices simultaneously • Yields better performance for video operations than normal RAM • More expensive than RAM • FRAM • Very new memory technology • Like Flash, but doesn’t “burn out”. Craig Schock, 2003, 17
The Central Processing Unit – CPU • The CPU is the “brain” of the computer • Also called a microprocessor • It performs all processing functions • Arithmetic • Instructions • It contains very little memory • It relies on RAM to store values • The CPU is constantly reading values from and writing values to RAM CPU RAM ROM Bus Craig Schock, 2003, 18
Microprocessor Composition • A CPU is composed of the following pieces: • ALU (Arithmetic Logic Unit) • Performs all math functions • Registers • Temporary storage for CPU operation • Register space is typically < 1k • Compare that space to RAM 256 MB! • Instruction decode logic • Programs are a series of instructions • Instructions are retrieved from memory and decoded into CPU activity Craig Schock, 2003, 19
CPU – Instructions • Example program for the 6502 CPU LDA variable1 ; load variable1 into register ADC #5 ; add 5 to register STA variable2 ; Store result in variable2 Instruction Variable (stored in RAM) • How the program is stored 173 01 32 105 00 05 141 01 33 Instruction RAM address Craig Schock, 2003, 20
Programs • Each microprocessor has its own set of instructions • The language of a CPU is called its “machine language” • You’ll notice from the previous slide that programs are stored in the same manner as any other information • What are the implications of this? Craig Schock, 2003, 21
More questions • The program shown earlier is for a microprocessor called the 6502. • The 6502 has 2 arithmetic functions: • ADC (add with carry) • SBC (subtract with carry) • The 6502 DOES NOT have: • A multiply instruction • A divide instruction • How would a programmer multiply or divide numbers? Craig Schock, 2003, 22
6502 – An 8 bit CPU • The 6502 is an example of an 8 bit microprocessor • Instructions are 8 bits (max 256 instructions) • Arithmetic functions work with 8 bit values • Computers which contained a 6502 microprocessor • Apple I, Apple II, Apple IIe, Apple IIc, Commodore Pet, Vic-20, Commodore 64, Atari 400/800/1200, TRS-80 • The 6502 was a very popular CPU in the early 80s • It was cheap! • It was easy to use! • It was not very powerful! Craig Schock, 2003, 23
Other 8-bit CPUs • There were other popular 8 bit microprocessors • Motorola 6809 • Intel 8080 • The Intel 8080 was used in the IBM PC. • Because the instruction set of 8 bit microprocessors was so small (256 instructions), the computer industry quickly outgrew them • That paved the way for 16-bit microprocessors Craig Schock, 2003, 24
16 bit Microprocessors • 16 bit CPUs • Instructions are 16 bits (65536 instructions) • Arithmetic functions work on 16 or 32 bit values • With more space available for instructions, more complex instruction sets were created • CISC : Complex Instruction Set Computer • RISC : Reduced Instruction Set Computer • More on RISC/CISC later • It was much easier to do mathematical computation on a 16-bit CPU Craig Schock, 2003, 25
Common 16 bit CPUs • Motorola 68000 • Early Macs, Atari ST, Commodore Amiga, Sun 3 Workstations • Intel 8086 • 16-bit IBM PCs, PC clones • Even with the more complex instruction set and better math functions, the computer industry quickly outgrew the 16 CPUs. • The next step was 32 bit CPUs Craig Schock, 2003, 26
32 Bit Microprocessors • The computer industry has stuck with 32 bit CPUs since the late 80s • There has been little reason to move on to 64 bit CPUs. • These CPUs have 32 bits available for instruction space (approx. 4.1 billion instructions) • They work with 32 bit values for mathematical functions Craig Schock, 2003, 27
Common 32 bit Microprocessors • Motorola 68020, 68030, 68040 • Used in the later Macs, the NeXT computer • Intel 80286, 80386, 80486, Pentium, Pentium II, Pentium II, P4 • Used in PC compatible computers • Power PC chip (IBM, Motorola, Apple) • Latest Macs Craig Schock, 2003, 28
64 Bit Microprocessors • After 14-15 years with 32 bit microprocessors, the computer industry has started introducing 64-bit CPUs • Currently, these processors are limited to high output computing requirements • Intel Itanium Processors • 64-bit PowerPC chips Craig Schock, 2003, 29
RISC versus CISC • One of the many religious arguments in the computer industry • As processors became more complex, they could encode more and more instructions (CISC) • In the late 80s, some felt the instruction sets were becoming too complex, so they simplified them (RISC) • By reducing the instruction set, there was space available on the CPU for other things • The most common thing was to use that space for ultra-fast on board memory Craig Schock, 2003, 30
L2 Cache • Today, CISC CPUs also have ultra-fast access memory • This is called the L2 cache. It is much smaller than RAM • The idea is that the CPU keeps a copy of some of the information which would normally be stored in RAM • Before the CPU requests information from main memory, it consults the cache first. Craig Schock, 2003, 31
CPU Families • As the industry progressed through the 8bit/ 16bit/ 32bit phases, CPU manufacturers have built on previous CPUs. • As a result, there are a series of chips which belong to the same family even thought they are different types of CPUs • Intel: 8080, 8086, 80286, 80384, 80486, Pentium, Itanium • Motorola: 6809, 68000, 68010, 68020, 68030, 68040 • Motorola: 88000, 88010 (RISC Processors) Craig Schock, 2003, 32
The Clock Signal • All of the components within a computer must work together. • Some components operate faster than others • To work together smoothly, everyone must conform to a set timing structure • Each computer has a System Clock which runs at a steady rate. • The various components use the clock to keep themselves synchronized with the rest of the components within the computer Craig Schock, 2003, 33
The Bus • Information is communicated between the components within a computer via the Bus • A computer may have 1 or more buses • Standard PCs are built around a single bus • Called a “PCI” bus CPU RAM ROM Bus Craig Schock, 2003, 34
The Bottleneck • The bus is often the bottleneck within a computer • Every time the CPU needs to obtain its next instruction or data from memory or store information in memory it must use the bus • The PCI bus standard is a slow bus compared to today’s CPUs • No new “standard” has emerged. Many manufacturers add new buses to their motherboards • However, they also have a PCI bus so that they are compatible with PCI devices Craig Schock, 2003, 35
Ports • Most computers allow for expandability through the use of Ports • Ports are a location where external devices (such as cards, peripherals, etc) can be connected • Ports are external connection points to the bus Craig Schock, 2003, 36