380 likes | 486 Views
SYSTEM UNIT OF A COMPUTER SYSTEM – CPU AND RAM. Timothy Lee , Timmy Tsang 4E (12) , (17). IN A COMPUTER WE HAVE…. Mother board Power supply DVD-rom drive Floppy disk drive Display card Hard disk driver. MOTHERBOARD. Provides sockets for: Central Processing unit (CPU) Memory chips
E N D
SYSTEM UNIT OF A COMPUTER SYSTEM – CPU AND RAM Timothy Lee, Timmy Tsang 4E (12), (17)
IN A COMPUTER WE HAVE…. • Mother board • Power supply • DVD-rom drive • Floppy disk drive • Display card • Hard disk driver
MOTHERBOARD • Provides sockets for: • Central Processing unit (CPU) • Memory chips • Expansion slots for additional circuit boards • It also contains circuitry that connects the components together
Hard ware that connected to the system unit are called peripherals • Can be grouped according to their function • Include: • Input peripherals (Scanner) • Output peripherals (speaker , monitor) • Storage peripherals (USB flash drive , digital camera) • Communication peripherals (Microphone)
CENTRAL PROCESSING UNIT(CPU) • Brain of computer • Executes the instruction of a computer program • Processes data to do specific task • Communicates with other devices through bus lines • It determines the overall performance of a computer
Secondary storage device Input device Output device Main memory Control unit CPU Arithmetic and logic unit input processing output
(ALU) ARITHMETIC AND LOGIC UNIT • Performs arithmetic and logical operations • Arithmetic operations: • Addition • Subtraction , etc. • Logical operations: • Compare two pieces of data • And • Or • Not
It returns result either true or false • Use register to hold data during calculations • results are usually stored in a register called an accumulator
(CU) CONTROL UNIT • Keeps track of the sequence of instruction being processed • Fetches instruction from the main memory • Instructs the ALU to perform an operation • Monitors and coordinates all I/O operations and system unit
Main memory 1. Fetch (Get) an instruction Add 2 to accumulator AX Registers 2.Intercept the instruction 6. Store the result 18 back to AX 18 3. Instruct the ALU to perform the addition operation AX 16 5. Perform addition 4. Obtain the value of AX
REGISTERS • Memory units that provides storage spaces for ALU and CU • Small numbers of registers • Fastest way for a CPU to access data • Different registers serve different function and store different data • Types: • General purpose registers • Control registers • Status registers
GENERAL PURPOSE REGISTERS • Instructions of assembly and machine code programs • Examples: • Accumulator • Base register • Counter • Data register
CONTROL REGISTERS • Provides temporary memory • Major control registers: • Instruction register • instructions to be executed by the CPU • Program counter • Contains memory address of the next instruction to be executed • Control unit increase increase the address value in the program counter by 1 • The value in the program counter may be changed as the execution result of the current instruction
MEMORY ADDRESS REGISTER AND MEMORY DATA REGISTER • facilitate the communication of the CPU with main memory • (through bus system) • Work hand in hand • MAR holds address of the memory location which data to be transferred to or from • MDR contains the data to be written into or read from the location specified in MAR
Siginal data Bus line GPR PC MAR SR accumulator CU ALU IR MDR Main memory Address bus Data bus Control bus
STATUS REGISTER (SR) • Contains a number of flag bits indicating the status after execution of the instructions • Used in instruction of conditional testing and program branching O S Z P C 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SYSTEM BUS (BUS LINE) • Physical writing that connects the various components of computer system • Data transmit between CPU and other components with this • Compose:
Size of a bus is called bus width • Determines the number of bits of data the computer can transmit at one time • Example: • 64-bit data bus can transmit at one time • Larger bus width can transfer more data at one time
11.4 Measurement of CPU speed We use clock rate to measure the speed of a CPU The unit of clock rate is Megahertz (MHz) and Gigahertz (GHz) Hz means “number of cycles per second” 1MHz = 1,000,000Hz (1 million) 1GHz = 1,000MHz 1GHz = 1,000,000,000 Hz (1 billion)
Remark • Clock rate is defined as how many clock cycles to be run (usually millions or billions) in one second. • Think of a clock:
Calculation • Clock cycle = Clock rate (In Hz) x time taken • Suppose a CPU operates 1GHz, find the clock cycle required in the following instructions:
Solution • Since 106ms =109ns =1012ps= 1s • Clock Cycle required: • 10-7 x 109 • =100
Word Length • Word length is defined as the number of bits the CPU can handle at one time. • As example, for smaller word length: • Less data can be processed at one time • Cannot run the program with larger word length, for example a CPU with word length of 32 bits cannot run a software with 64 bits
Less instructions can be included • The instructions also cannot be too complicated • So a larger word length is better
Note • The data bus width of the main memory (to be discussed in 11.5) and the word length of CPU should be the SAME
Calculation • Assume a 32-bit computer system have the structure below:
Operation code: • The commands that tells how to work out the calculation. • Operand: • The data goes with the instruction for working
Q1 How many different commands can be presented ? • A1: 214 • Q2 Find y • A2: y =12
Calculation • Q3: If the computer system is downgraded to a 32-bit system, both operands turn into 8 bits, find the bits of operation code. • A3 The operation code= 32-8-8=16 bits • Q4: Find the increase of number of commands • A4: 216-214= 49152
11.5 Main memory • Function: • store data and the instructions that CPU will use later. • 2 types: RAM and ROM • RAM: random access memory • ROM: read-only memory
RAM • used to store temporary data and instructions • is volatile (easily lost) when shut down, the data in RAM disappears • RAM’s access time is hundred times faster than hard disk. • motherboard can usually support up to 4 GB of RAM
RAM • 2 types of RAM • DRAM vs SRAM
ROM • ROM stores permanent (non- volatile) information • ROM also store BIOS (basic input/output system) • The function of BIOS: • transfer data between CPU and Input/output devices • New type of ROM (EPROM, EEPROM)
Flash memory • Flash memory is a kind of EEPROM • Features: • Over 16GB • Read and write in a high speed • costs far less than byte-programmable EEPROM • no power is needed to maintain the information stored in the chip.
Flash memory • withstand intense pressure, extremes of temperature, and immersion in water • Light • when packaged in a "memory card," it is extremely durable • is used in memory cards and USB flash drives • Also digital cameras, digital audio players
Cache Memory • Function • A CPU cache is a cache used by the CPU of a computer to reduce the average time to access memory. • a memory with high speed. • Small in quantities. • cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations