COE 205 3 Computer Organization Assembly Language Introduction
COE 205 - 3 Computer Organization & Assembly Language Introduction Basic Components of Computer system
What are Computers? Ø Computers are large digital systems used to process digitized information based on a user defined sequence of commands (i. e. the program) COE 205 Term 042 Dr. Talal Al. Kharobi 2
Example To begin to understand the components of a computer, consider the following example: We want to have an automated (no or minimum human interaction) method to find the average height of students in classes. How can we devise a digital system to do this? So let us come up with the basic building blocks for this digital system. COE 205 Term 042 Dr. Talal Al. Kharobi 3
Example Solution Ø We need a way to enter (input) our data to the computer. Ø After we calculate the average height, we will need to get the result and present it (output) to the user in a convenient form. Ø Before we can do our calculation, we need to store the data we have entered into the computer or it will be lost, so we need some device that can remember the data, hence we have to have a memory device. Ø Now we have to have a digital circuit that can perform the required arithmetic and logical operations to do our calculations, that is Arithmetic and Logic Unit or simply the ALU COE 205 Term 042 Dr. Talal Al. Kharobi 4
Example Solution Ø Now we need to define the set of necessary steps and their proper sequence that are required to obtain the average height from the set of input data. These steps are Ø Read the students heights one by one Ø Add them one by one Ø Divide the final sum by the number of students to get the average Ø These steps would make what is called an algorithm. We need to write a more detailed description of the solutions steps, this would be the program. COE 205 Term 042 Dr. Talal Al. Kharobi 5
Example Solution: The Program --- First, the declaration section --- 1. Define the required variables to hold the different values involved in our program: Ø A variable n to hold the number of students, Ø Another variable I to be used as a counter, Ø An array of n variables h(n) to hold the heights of students Ø A variable Average to hold the average --- Second, the calculation section --- 2. Read (through an input device) the number of students n and store it (in the memory) 3. Set Average to 0 4. Set I to 1 5. Read from the input device h(I) 6. Add h(I) to Average and store the new value of Average 7. increment I (i. e. set I = I+1) 8. If n and I are not equal go to step 5 otherwise continue to step 9 9. Divide average by n and store the value in average. 10. Output average (the final answer) COE 205 Term 042 Dr. Talal Al. Kharobi 6
Input Devices Ø Devices that can enter data to computers are called input devices Ø Examples of input devices include Ø keyboards Ø Mouse Ø Touch pads Ø Light pens Ø Joysticks Ø Scanner COE 205 Term 042 Dr. Talal Al. Kharobi 7
Output Devices Ø An output device is used to output the data. Ø Examples of output devices are Ø Monitors Ø Printers Ø Speakers COE 205 Term 042 Dr. Talal Al. Kharobi 8
Peripheral devices Ø A peripheral is a computer device, such as a CD-ROM drive or printer, that is not part of the essential computer, i. e. , the memory and microprocessor. Ø Peripheral devices are of two types: Ø External: such as mouse, keyboard, printer, monitor, external Zip drive or scanner, or Ø Internal, such as CD-ROM drive, CD-R drive or internal modem. COE 205 Term 042 Dr. Talal Al. Kharobi 9
Memory Devices Ø Memory device performs two major operations: (1) Store (write) data (2) Get (read) stored data Ø Information is accessed by an address that specifies the exact location of the information in the memory. COE 205 Term 042 Dr. Talal Al. Kharobi 10
Different memory types COE 205 Term 042 Dr. Talal Al. Kharobi 11
Random-Access Memory (RAM) Ø Computer main memory is of this type (RAM) Ø The name random access memory RAM given to this type because Information can be stored or accessed in any order at equal time periods Ø Main memory is volatile: when powered off, the stored information are gone Ø Information is accessed by an address that specifies the exact location of the information in the memory. Ø It can be read and written to COE 205 Term 042 Dr. Talal Al. Kharobi 12
Read-Only-Memory (ROM) Ø Usually used to store the information required by the computer to start-up Ø Non-volatile memory: keeps the stored information even when powered off Ø Has random access of stored information (can be accessed in any order at equal time periods) Ø Recent types of ROMs that are used in PCs (personal Computers) are also called FLASH or CMOS. COE 205 Term 042 Dr. Talal Al. Kharobi 13
Cache memory Ø A very fast RAM that is used to store most frequently or recently used information Ø Recent computers have 2 -levels of cache Ø First level cache: faster but smaller in size (usually it is internal cache) Ø Second level cache: slower but larger in size (external cache) COE 205 Term 042 Dr. Talal Al. Kharobi 14
Registers Ø Fastest storage elements Ø Similar to Cache, are used to store temporary or most frequently used information Ø Information is stored in named locations (not addressed locations) Ø Information is accessed by specifying the name of the register where they exist Ø There are two main types of registers in computer systems: Ø Ø General Purpose Registers that are accessible to the programmers of the computer Ø Special Purpose Registers that are only used by the computer itself and can not be accessed by the programmer directly. State-of-the-art computers contain large number of registers that are usually organized into one dimensional arrays called register files (A group of registers that are organized into a onedimensional array) COE 205 Term 042 Dr. Talal Al. Kharobi 15
Arithmetic and Logic Unit (ALU) Ø A digital circuit in the CPU that performs arithmetic and logical operations Ø Modern computers have multiple ALUs to be able to do multiple calculations at the same time (to increase speed). Ø The figure shows the symbolic view of the ALU and its operation. An ALU has two inputs as well as selection lines. The selection lines specify the operation to be performed on the inputs. COE 205 Term 042 Dr. Talal Al. Kharobi 16
The Algorithm & the program Ø The Algorithm is an abstract description of a solution to a problem represented by a sequence of steps Ø The Algorithm is an abstract description of the solution, i. e. it does not show details on how the computer can actually perform the steps. We need a more detailed description of the solutions steps, this would be the program. Ø The program is a set of instructions when executed by the computer achieve a specific function/outcome Ø The program is stored in the memory so that it can be used repeatedly, manipulated, moved, deleted or have more instructions appended to it Ø This is the concept of the stored program and it is the basis for all modern computers. COE 205 Term 042 Dr. Talal Al. Kharobi 17
Control unit Ø We need a digital circuit to control everything in the computer. The control unit should perform the following: Ø Coordinate the operation of the other units in the computer Ø Translate the program instructions into micro-operations to be performed by the different units. This is called decoding Ø Provide the control signals for other units to perform the different micro-operations required to execute each instruction. Ø The ALU and registers make up the computer's data path. Ø The data path and control unit form the Central Processing Unit (CPU) COE 205 Term 042 Dr. Talal Al. Kharobi 18
Symbolic diagram of the basic components of a computer. COE 205 Term 042 Dr. Talal Al. Kharobi 19
- Slides: 19