Вы находитесь на странице: 1из 18

ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD (Department of Computer Science)

Course: Computer Architecture (3416) Level: BS (CS) Semester: Spring, 2011 Total Marks: 100

ASSIGNMENT No. 1
All questions carry equal marks. Q.1 a) Explain block diagram of computer state your answer with the help of a neat diagram?

Input Unit: Computers need to receive data and instruction in order to solve any problem. Therefore we need to input the data and instructions into the computers. The input unit consists of one or more input devices. Keyboard is the one of the most commonly used input device. Other commonly used input devices are the mouse, floppy disk drive, magnetic tape, etc. All the input devices perform the following functions. Accept the data and instructions from the outside world. Convert it to a form that the computer can understand. Supply the converted data to the computer system for further processing. Storage Unit: The storage unit of the computer holds data and instructions that are entered through the input unit, before they are processed. It preserves the intermediate and final results before these are sent to the output devices. It also saves the data for the later use. The various storage devices of a computer system are divided into two categories. 1. Primary Storage: Stores and provides very fast. This memory is generally used to hold the program being currently executed in the computer, the data being received from the input unit, the intermediate and final results of the program. The primary memory is temporary in nature. The data is lost, when the computer is switched off. In order to store the data permanently, the data has to be transferred to the secondary memory. The cost of the primary storage is more compared to the secondary storage. Therefore most computers have limited primary storage capacity. 2. Secondary Storage: Secondary storage is used like an archive. It stores several programs, documents, data bases etc. The programs that you run on the computer are first transferred to the primary memory before it is actually run. Whenever the results are saved, again they get stored in the secondary memory. The secondary memory is slower and cheaper than the primary memory. Some of the commonly used secondary memory devices are Hard disk, CD, etc., Memory Size: All digital computers use the binary system, i.e. 0s and 1s. Each character or a number is represented by an 8 bit code. The set of 8 bits is called a byte. A character occupies 1 byte space. A numeric occupies 2 byte space. Byte is the space occupied in the memory.

The size of the primary storage is specified in KB (Kilobytes) or MB (Megabyte). One KB is equal to 1024 bytes and one MB is equal to 1000KB. The size of the primary storage in a typical PC usually starts at 16MB. PCs having 32 MB, 48MB, 128 MB, 256MB memory are quite common. Output Unit: The output unit of a computer provides the information and results of a computation to outside world. Printers, Visual Display Unit (VDU) are the commonly used output devices. Other commonly used output devices are floppy disk drive, hard disk drive, and magnetic tape drive. Arithmetic Logical Unit: All calculations are performed in the Arithmetic Logic Unit (ALU) of the computer. It also does comparison and takes decision. The ALU can perform basic operations such as addition, subtraction, multiplication, division, etc and does logic operations viz, >, <, =, etc. Whenever calculations are required, the control unit transfers the data from storage unit to ALU once the computations are done, the results are transferred to the storage unit by the control unit and then it is send to the output unit for displaying results. Control Unit: It controls all other units in the computer. The control unit instructs the input unit, where to store the data after receiving it from the user. It controls the flow of data and instructions from the storage unit to ALU. It also controls the flow of results from the ALU to the storage unit. The control unit is generally referred as the central nervous system of the computer that control and synchronizes its working. Central Processing Unit: The control unit and ALU of the computer are together known as the Central Processing Unit (CPU). The CPU is like brain performs the following functions: It performs all calculations. It takes all decisions. It controls all units of the computer. A PC may have CPU-IC such as Intel 8088, 80286, 80386, 80486, Celeron, Pentium, Pentium Pro, Pentium II, Pentium III, Pentium IV, Dual Core, and AMD etc.

b)

Explain different generations of computers by identifying the main improvement in each generation? First Generation (1940-1956) Vacuum Tubes The first computers used vacuum tubes for circuitry and magnetic drums for memory, and were often enormous, taking up entire rooms. They were very expensive to operate and in addition to using a great deal of electricity, generated a lot of heat, which was often the cause of malfunctions. First generation computers relied on machine language, the lowest-level programming language understood by computers, to perform operations, and they could only solve one problem at a time. Input was based on punched cards and paper tape, and output was displayed on printouts. The UNIVAC and ENIAC computers are examples of first-generation computing devices. The UNIVAC was the first commercial computer delivered to a business client, the U.S. Census Bureau in 1951. Second Generation (1956-1963) Transistors Transistors replaced vacuum tubes and ushered in the second generation of computers. The transistor was invented in 1947 but did not see widespread use in computers until the late 1950s. The transistor was far superior to the vacuum tube, allowing computers to become smaller, faster, cheaper, more energyefficient and more reliable than their first-generation predecessors. Though the transistor still generated a great deal of heat that subjected the computer to damage, it was a vast improvement over the vacuum tube. Second-generation computers still relied on punched cards for input and printouts for output. Second-generation computers moved from cryptic binary machine language to symbolic, or assembly, languages, which allowed programmers to specify instructions in words. High-level programming languages were also being developed at this time, such as early versions of COBOL and FORTRAN. These were also the first computers that stored their instructions in their memory, which moved from a magnetic drum to magnetic core technology. The first computers of this generation were developed for the atomic energy industry. Third Generation (1964-1971) Integrated Circuits The development of the integrated circuit was the hallmark of the third generation of computers. Transistors were miniaturized and placed on silicon chips, called semiconductors, which drastically increased the speed and efficiency of computers. Instead of punched cards and printouts, users interacted with third generation computers through keyboards and monitors and interfaced with an operating system, which allowed the device to run many different applications at one time with a central program that monitored the memory. Computers for the first time became accessible to a mass audience because they were smaller and cheaper than their predecessors. Fourth Generation (1971-Present) Microprocessors The microprocessor brought the fourth generation of computers, as thousands of integrated circuits were built onto a single silicon chip. What in the first generation filled an entire room could now fit in the palm of the hand. The Intel 4004 chip, developed in 1971, located all the components of the computerfrom the central processing unit and memory to input/output controlson a single chip. In 1981 IBM introduced its first computer for the home user, and in 1984 Apple introduced the Macintosh. Microprocessors also moved out of the

realm of desktop computers and into many areas of life as more and more everyday products began to use microprocessors. As these small computers became more powerful, they could be linked together to form networks, which eventually led to the development of the Internet. Fourth generation computers also saw the development of GUIs, the mouse and handheld devices. Fifth Generation (Present and Beyond) Artificial Intelligence Fifth generation computing devices, based on artificial intelligence, are still in development, though there are some applications, such as voice recognition, that are being used today. The use of parallel processing and superconductors is helping to make artificial intelligence a reality. Quantum computation and molecular and nanotechnology will radically change the face of computers in years to come. The goal of fifth-generation computing is to develop devices that respond to natural language input and are capable of learning and selforganization.

Q.2 a)

What are different component of computer? Also explain functions associated with each component.

System unit
The system unit is the core of a computer system. Usually it's a rectangular box placed on or underneath your desk. Inside this box are many electronic components that process information. The most important of these components is the central processing unit (CPU), or microprocessor, which acts as the "brain" of your computer. Another component israndom access memory (RAM), which temporarily stores information that the CPU uses while the computer is on. The information stored in RAM is erased when the computer is turned off. Almost every other part of your computer connects to the system unit using cables. The cables plug into specific ports (openings), typically on the back of the system unit. Hardware that is not part of the system unit is sometimes called a peripheral device ordevice.

Storage
Your computer has one or more disk drivesdevices that store information on a metal or plastic disk. The disk preserves the information even when your computer is turned off.

Hard disk drive


Your computer's hard disk drive stores information on a hard disk, a rigid platter or stack of platters with a magnetic surface. Because hard disks can hold massive amounts of information, they usually serve as your computer's primary means of storage, holding almost all of your programs and files. The hard disk drive is normally located inside the system unit.

CD and DVD drives


Nearly all computers today come equipped with a CD or DVD drive, usually located on the front of the system unit. CD drives use lasers to read (retrieve) data from a CD, and many CD drives can also write (record) data onto CDs. If you have a recordable disk drive, you can store copies of your files on blank CDs. You can also use a CD drive to play music CDs on your computer.

Mouse
A mouse is a small device used to point to and select items on your computer screen. Although mice come in many shapes, the typical mouse does look a bit like an actual mouse. It's small, oblong, and connected to the system unit by a long wire that resembles a tail. Some newer mice are wireless.

Applies to all editions of Windows Vista.

Compare editions

In this topic
System unit Storage Mouse Keyboard Monitor Printer Speakers Modem

See also
Introduction to computers Using your mouse Using your keyboard Windows Basics: all topics

Parts of a computer
If you use a desktop computer, you might already know that there isn't any single part called the "computer." A computer is really a system of many parts working together. The physical parts, which you can see and touch, are collectively called hardware. (Software, on the other hand, refers to the instructions, or programs, that tell the hardware what to do.) The illustration below shows the most common hardware in a desktop computer system. Your system may look a little different, but it probably has most of these parts. A laptop computer has similar parts but combines them into a single notebook-sized package.

Desktop computer system

Let's take a look at each of these parts.

System unit
The system unit is the core of a computer system. Usually it's a rectangular box placed on or underneath your desk. Inside this box are many electronic components that process information. The most important of these components is the central processing unit (CPU), or microprocessor, which acts as the "brain" of your computer. Another component is random access memory (RAM), which temporarily stores information that the CPU uses while the computer is on. The information stored in RAM is erased when the computer is turned off. Almost every other part of your computer connects to the system unit using cables. The cables plug into specific ports (openings), typically on the back of the system unit. Hardware that is not part of the system unit is sometimes called a peripheral device ordevice.

Storage
Your computer has one or more disk drivesdevices that store information on a metal or plastic disk. The disk preserves the information even when your computer is turned off.

Hard disk drive


Your computer's hard disk drive stores information on a hard disk, a rigid platter or stack of platters with a magnetic surface. Because hard disks can hold massive amounts of information, they usually serve as your computer's primary means of storage, holding almost all of your programs and files. The hard disk drive is normally located inside the system unit.

CD and DVD drives


Nearly all computers today come equipped with a CD or DVD drive, usually located on the front of the system unit. CD drives use lasers to read (retrieve)

data from a CD, and many CD drives can also write (record) data onto CDs. If you have a recordable disk drive, you can store copies of your files on blank CDs. You can also use a CD drive to play music CDs on your computer. DVD drives can do everything that CD drives can, plus read DVDs. If you have a DVD drive, you can watch movies on your computer. Many DVD drives can record data onto blank DVDs.

Floppy disk drive


Floppy disk drives store information on floppy disks, also called floppies or diskettes. Compared to CDs and DVDs, floppy disks can store only a small amount of data. They also retrieve information more slowly and are more prone to damage. For these reasons, floppy disk drives are less popular than they used to be, although some computers still include them. Why are floppy disks "floppy"? Even though the outside is made of hard plastic, that's just the sleeve. The disk inside is made of a thin, flexible vinyl material. T

Mouse
A mouse is a small device used to point to and select items on your computer screen. Although mice come in many shapes, the typical mouse does look a bit like an actual mouse. It's small, oblong, and connected to the system unit by a long wire that resembles a tail. Some newer mice are wireless. A mouse usually has two buttons: a primary button (usually the left button) and a secondary button. Many mice also have a wheel between the two buttons, which allows you to scroll smoothly through screens of information. When you move the mouse with your hand, a pointer on your screen moves in the same direction. (The pointer's appearance might change depending on where it's positioned on your screen.) When you want to select an item, you point to the item and then click (press and release) the primary button. Pointing and clicking with your mouse is the main way to interact with your computer. For more information, see Using your mouse.

Keyboard
A keyboard is used mainly for typing text into your computer. Like the keyboard on a typewriter, it has keys for letters and numbers, but it also has special keys: The function keys, found on the top row, perform different functions depending on where they are used. The numeric keypad, located on the right side of most keyboards, allows you to enter numbers quickly. The navigation keys, such as the arrow keys, allow you to move your position within a document or webpage.

Monitor
A monitor displays information in visual form, using text and graphics. The portion of the monitor that displays the information is called the screen. Like a television screen, a computer screen can show still or moving pictures. There are two basic types of monitors: CRT (cathode ray tube) monitors and LCD (liquid crystal display) monitors. Both types produce sharp images, but LCD monitors have the advantage of being much thinner and lighter. CRT monitors, however, are generally more affordable.

Ram
Random access memory,
a type of computer memory that can be accessed randomly; that is, any byte of memory can be accessed without touching the preceding bytes. RAM is the most common type of memory found in computers and other devices, such as printers.

b)

What is meant by a bus? Explain different types of buses used in computer.

BUS: A bus is a group of conducting lines that carriers data, address, & control signals. A bus is two or many wire communication method. A bus which communicates between two active devices, it may transfer address, data, etc. Buses are the set of wires that carry special information to or from the cpu. There are three types of buses They are: Control Bus: The control bus is used by the CPU to direct and monitor the actions of the other functional areas of the computer. It is used to transmit a variety of individual signals (read, write, interrupt, acknowledge, and so forth) necessary to control and coordinate the operations of the computer. The individual signals transmitted over the control bus and their functions are covered in the appropriate functional area description. Address Bus: The address bus consists of all the signals necessary to define any of the possible memory address locations within the computer, or for modular memories any of the possible memory address locations within a module. An address is defined as a label, symbol, or other set of characters used to designate a location or register where information is stored. Before data or instructions can be written into or read from memory by the CPU or I/O sections, an address must be transmitted to memory over the address bus. Data Bus: The bidirectional data bus, sometimes called the memory bus, handles the transfer of all data and instructions between functional areas of the computer. The bidirectional data bus can only transmit in one direction at a time. The data bus is used to transfer instructions from memory to the CPU for execution. It carries data (operands) to and from the CPU and memory as required by instruction translation. The data bus is also used to transfer data between memory and the I/O section during input/output operations. The information on the data bus is either written into memory at the address defined by the address bus or consists of data read from the memory address specified by the address bus.

Q.3

a)

Explain the use of DMA controller in a computer system with a neat diagram.

Direct Memory Access (DMA): - Whether or not a system has memorymapped I/O, its CPU needs to address the device controllers to exchange data with them. The CPU can request data from an I/O controller one byte at a time but doing so for a device like a disk that produces a large block of data wastes the CPUs time, so a different scheme, called DMA (Direct Memory Access) is often used. The operating system can only use DMA if the hardware has a DMA controller, which most systems do. Sometimes this controller is integrated into disk controllers and other controllers, but such a design requires a separate DMA controller for each device. More commonly, a single DMA controller is available (e.g., on the parent board) for regulating transfers to multiple devices, often concurrently. No matter where it is physically located, the DMA controller has access to the system bus independent of the CPU, as shown in Fig. It contains several registers that can be written and read by the CPU. These include a memory address register, a byte count register, and one or more control registers. The control registers specify the I/O port to use, the direction of the transfer (reading from the I/O device or writing to the I/O device), the transfer unit (byte at a time or word at a time), and the number of bytes to transfer in one burst. First the controller reads the block (one or more sectors) from the drive serially, bit by bit, until the entire block is in the controllers internal buffer. Next, it computes the checksum to verify that no read errors have occurred. Then the controller causes an interrupt. When the operating system starts running, it can read the disk block from the controllers buffer a byte or a word at a time by executing a loop, with each iteration reading one byte or word from a controller device register, storing it in main memory, incrementing the memory address, and decrementing the count of items to be read until it reaches zero. When DMA is used, the procedure is different. First the CPU programs the DMA controller by setting its registers so it knows what to transfer where. (Step 1 in fig.) It also issues a command to the disk controller telling it to read data from the disk into its internal buffer and verify the checksum. When valid data are in the disk controllers buffer, DMA can begin. The DMA controller initiates the transfer by issuing a read request over the bus to the disk controller (Step 2) This read request looks like any other read request, and the disk controller does not know or care whether it came from the CPU or from a DMA controller. Typically, the memory address to write to is on the address lines of the bus so when the disk controller fetches the next word from its internal buffer, it knows where to write it. The write to memory is another standard bus cycle. (Step 3) When the write is complete, the disk controller sends an acknowledgement signal to the disk controller, also over the bus

(Step 4) The DMA controller then increments the memory address to use and decrements the byte count. If the byte count is still greater than 0, steps 2 through 4 are repeated until the count reaches 0. At this point the controller causes an interrupt. When the operating system starts up, it does not have to copy the block to memory; it is already there.

b)

Describe the working principles of USB?

The USB (for Universal Serial Bus) is a low cost serial bus which initially provided up to 12 Mb/S. That's about 100 times faster than the RS-232 style serial interfaces used in earlier generations of computers. In June 2002, Intel and others started to demonstrate USB 2.0, which increases the speed of the peripheral to PC connection from 12 megabits per second (Mbps) on USB 1.1 to up to 480 Mbps on USB 2.0, or 40 times faster than with the older technology. USB pen drives are typically portable USB flash memory devices as it is the incorporation of technology of flash memory that allows you to rewrite or erase the data stored in these devices. And also flash memory is responsible for the high durability of the compact removable disk. Like any other electronic gadget, USB flash memory devices contain a collection of cells or chips and can be either NOR or NAND type flash depending upon the way it is connected. Both of them use floating gate transistors to which electrons are tunneled for erasing the data. In the NOR type the initial values will be 00, and a current of opposite polarity is induced for erasing the data whereas in the NAND type, the initial values are maintained at FF. The NAND flash has found its applications in digital cameras, memory sticks, cards, USB pen drive and so on. The major success of the USB flash memory device lies in its increased capacity to store high amount of information together with its shock proof and dust proof nature which were the major limitation witnessed in the floppies of the earlier years. Thus these tiny devices have definitely created a revolution in the field of information technology.

Q.4 a) Describe the functional characteristics that are common to build main and secondary computer memory?
Primary Memory: The primary memory or the main memory is part of the main computer system. The processor or the CPU directly stores and retrieves information from it. This memory is accessed by CPU, in random fashion. That means any location of this memory can be accessed by the CPU to either read information from it, or to store information in it. o The primary memory itself is implemented by two types of memory technologies. The first is called Random Access Memory (RAM) and the other is read only memory (ROM). A more appropriate name for RAM is RWM (Read Write Memory), the CPU can write and read information from any primary memory location implemented using RAM. The other part of primary memory is implemented using ROM which stands for Read Only Memory. Primary memory is much faster and also it is more cost effective. But the secondary memory is much slower and also less costly. It stores the data permanently unless it is erased.

Secondary Memory Characteristics: Secondary memory is not directly accessible to the CPU. Input/output channels are used to access this nonvolatile memory. This memory does not lose the data when the system is powered off. The most familiar form of secondary memory that is widely used is Hard Disk. Some examples of secondary memory are USB sticks, floppy drives and Zip drives. Optical Disc Storage Optical Disc Drives use electromagnetic waves or laser light to read and write information to optical discs. There are drives that only read while on the other hand some drives are also there that performs both reading and writing. These devices include CD, DVD and Blue-ray Disc. Magnetic Tape Storage The device that performs reading and writing of data on magnetic tapes is a tape drive. Tapes can be cost effective while storing large amounts of data. Today they are largely used for backups and archives. Hard Disks A Hard Disks Drive (HDD) is a nonvolatile secondary storage device which stores digitally encoded data on the magnetic surface of it.

b)

Give a brief description of computer memory organization?

Volatile memories Volatile memories are memories that lose their contents when the power is turned off. A semiconductor memory is an example. Nonvolatile memories Nonvolatile memories are memories that do not lose their contents when power is removed. Core memory is an example. MEMORY ORGANIZATION Memory organization is two-fold. First we discuss the hardware (physical) organization, then the internal architecture. The type of computer and its size do not reflect the type of memories that the computer uses. Some computers have a mixture of memory types. For example, they may use some type of magnetic memory (core or film) and also a semiconductor memory (static or dynamic). They also have a readonly memory which is usually a part of the CPU. Memory in a computer can vary from one or more modules to one or more pcbs, depending on the computer type. The larger mainframe computers use the modular arrangement, multiple modules (four or more), to make up their memories. Whereas, minicomputers and microcomputers use chassis or assemblies, cages or racks, and motherboard or backplane arrangements. Minis and micros use multiple components on one pcb or groups of pcbs to form the memory. Magnetic I/O Main tapes memory processor Magnetic disks CPU Cache memory

Register Cache

Main Memory

Magnetic Disk

Magnetic Tape

Q.5 a)

Explain how the processor is interfaced with memory with a neat block diagram and explain how they communicate?

In a memory read operation the CPU loads the address onto the address bus. Most cases these lines are fed to a decoder which selects the proper memory location. The CPU then sends a read control signal. The data is stored in that location is transferred to the processor via the data lines. In the memory write operation after the address is loaded the CPU sends the write control signal followed by the data to the requested memory location. The memory can be classified in various ways i.e. based on the location, power consumption, way of data storage etc

The memory at the basic level can be classified as 1. Processor Memory (Register Array) 2. Internal on-chip Memory 3. Primary Memory 4. Cache Memory 5. Secondary Memory Processor Memory (Register Array) Most processors have some registers associated with the arithmetic logic units. They store the operands and the result of an instruction. The data transfer rates are much faster without needing any additional clock cycles. The number of registers varies from processor to processor. The more is the number the faster is the instruction execution. But the complexity of the architecture puts a limit on the amount of the processor memory. Internal on-chip Memory In some processors there may be a block of memory location. They are treated as the same way as the external memory. However it is very fast. Primary Memory This is the one which sits just out side the CPU. It can also stay in the same chip as of CPU. These memories can be static or dynamic. Cache Memory This is situated in between the processor and the primary memory. This serves as a buffer to the immediate instructions or data which the processor anticipates. There can be more than one levels of cache memory.

Secondary Memory These are generally treated as Input/Output devices. They are much cheaper mass storage and slower devices connected through some input/output interface circuits. They are generally magnetic or optical memories such as Hard Disk and CDROM devices. The memory can also be divided into Volatile and Non-volatile memory. * Volatile Memory The contents are erased when the power is switched off. Semiconductor Random Access Memories fall into this category. * Non-volatile Memory The contents are intact even of the power is switched off. Magnetic Memories (Hard Disks), Optical Disks (CDROMs), Read Only Memories (ROM) fall under this category.

b)

Write a note on static memories?

The Static Random Access Memory (Static RAM) is a high speed memory. Static RAM is a type of RAM that gets its data without an external refresh. For as long as power is supplied to the circuit. SRAM has many differences to Dynamic RAM (DRAM). The first of all is duty to refresh memory many times per second to hold its data contents. The second one is that SRAMs are also used for specific applications within the PC, where their strengths outweigh their weaknesses compared to DRAM Static memory allocation refers to the process of allocating memory at compiletime before the associated program is executed, unlike dynamic memory allocation or allocation where memory is allocated as required at run-time. The only connection with static electricity that I can think of, is that static electricity is a real threat to extra RAM that you can plug into your PC or, for that matter, many parts of your PC if you open it up for any reason. Other than that, static means staying in one place, staying the same, whereas dynamic is obviously something that changes all the time. Once you put a file somewhere on your hard disc, it stays in the same place and does not change (unless of course you defragment your hard drive). The contents of the RAM etc. changes all the time.