Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Component of A Digital Computer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

COMPUTER APPLICATIONS MODULE 1

COMPONENTS OF A DIGITAL COMPUTER


A digital computer is made of the following components

1. CPU (Central Processing Unit)


2. Memory
3. Input device and
4. Output device

The memory, input and output devices are also known as peripherals. The figure below shows a schematic
diagram of a digital computer.

Fig 1 shows schematic diagram of a digital computer

CPU
The CPU is the brain of the computer. Its primary function is to execute programs. A part form executing
programs, the CPU also controls the operation of all other components such as memory, input and output devices.
Under its control, programs and data are stored in the memory and displayed on the CRT screen or printed by the
printer.

The CPU of a small computer is the microprocessor. The figure below shows a schematic diagram of a micro-
computer.
Fig. 2 Block diagram of a micro-computer

The CPU of a large computer contains a number of microprocessors and other ICs on one or more circuit boards.
Each microprocessor in a large CPU performs a specific task.

THE MICROPROCESSOR
A microprocessor is made of the following parts

1. Control Unit
2. Arithmetic Logic Unit- ALU
3. Registers and
4. Bus

Fig. 2 Block diagram of a microprocessor.


CONTROL UNIT

The timing and control unit generates timing and control signals required for fetching, decoding and execution of
instructions. It provides status, control and timing signals necessary for the operations of other parts of the CPU,
memory and I/O devices. It controls the entire operation of a computer. It is actually the control section of the
CPU. It acts as the brain of the computer. Therefore, it generates synchronization signals and manages commands
exchanged between the ALU, I/O and the memory.

ALU

The ALU performs arithmetic and logic operations such as additions, multiplication and division, AND, OR,
NOT (Complement) and Exclusive OR and Exclusive NOR operation. It performs increment, decrement, shift
and clear operations. The ALU does the actual computation or processing of data. The control unit controls the
movement of data and instructions into and out of the processor and controls the operation of ALU.

REGISTERS

Microprocessors have internal registers or temporary data holding areas that can be accessed faster by ALU to
enable high speed data manipulation. Microprocessors have the following registers.

1. Accumulator

2. General purpose registers

3. Special purpose registers.

THE ACCUMULATOR

This is a register which holds one of the operands prior to the execution of an instruction and services result of
the most arithmetic and logical operations. It is the most frequently used register. Some CPU contains a single
accumulator while others contain several accumulators.

General Purpose Registers

General purpose registers store data and intermediate result during the execution of a program. They are
accessible to programmers through instructions if they are working in an assembly language.

Special Purpose Registers

They are not accessible to users. They are used by the computer for different purposes during program execution.
Examples of special purpose registers are Program Counter, Stack Pointer, Index Registers, and Instruction
Register.
Fig 4. Computer components Top-level view.

The above figure illustrates the top-level components and suggest the interractions among them.The CPU
exchanges data with memory. For this purpose, it typically makes use of two internal registers; A Memory
Address Register (MAR) which specifies the address in memory for the next read or write, and a Memory Buffer
Register (MBR) which contains the data to be written into memory or receives the data read from memory.
Similarly, an I/O register (I/O AR) spcifies a particular I/O device. An I/O buffer register (I/O BR) is used for
the exchange of data between an I/O module and the CPU.

A memeory module consists of a set of locations defined by sequentialy numbered addresse. Each location
contains a binary number that can be interpreted as either an instruction or data. An I/O module transfers data
from external devices to CPU and memory and vice versa. It contains internal buffers for temporarily holding
these data until they can be sent on.

PROGRAM COUNTER (PC)

The PC contains the address of the next instruction to be fetched from the memory and executed.The processor
always increments the PC after each instruction fetch so that it will fetch the next instruction in sequence (i.e the
instruction located at the next higher memory address). Consider for example a computer in which each
instruction occupies one 16-bit word of memory. Assume the PC is set to memory location 100, where the location
address refers to a 16-bit word. The processor will next fetch the instruction at the location 100. Thereafter it will
fetch instruction from location 101, 102, 103 and so on. The fetched instruction is loaded into the Instruction
Register (IR).

INSTRUCTION REGISTER (IR)


The IR contains the operation code (opcode) instruction being executed. The instruction contains bits that specify
the action the processor is to take. The processor interprets the instruction and perfoms the required action. The
actions that a processor can perfom falls into four categories.

 Processor – memory: Here data is transferred from processor to memory or vice versa.
 Processor- I/O: Data may be transferred to or from a peripheral device by transferring between the
processor and an I/O module.
 Data processing: the processor may perform some arithmetic or logic operations on data.
 Control: An instruction may specify that the sequence of execution be altered. For example, the
processor may fetch an instruction from location 149 which specifies that the next instruction be
from location 200.The processor will therefore set the counter to 200. The next instruction to be
fetched will be from 200 rather than 149. The IR will always hold the last instruction fetched.

THE FETCH-DECODE-EXECUTE CYCLE

The key function of a computer is the execution of programs. A program consists of a set of instructions stored
in the memory. The work of the processor is to execute the instructions specified in the program. Instruction
processing consists of three steps. The processor reads (fetches) instructions from a memory one at a time, decodes
or interprets and then executes each instruction. Program execution consists of repeating the process of instruction
fetch, decode and instruction execution. The processing required for a single instruction is called an instruction-
cycle.

The fetch cycle

The fetch cycle occurs at the beginning of each instruction cycle and causes an instruction to be fetched from
memory.

Fig.5 Elements of a program execution


At the beginning of the fetch cycle, the address of the next instruction to be executed is in the PC.Assume the
address is 11000100. The first step is to move the address to the Memory Address Register (MAR) because it is
the only register connected to the address lines of the system. The second step is to bring in the instruction. The
address in the MAR is then placed on the address bus. The control unit issues a read command on the control bus
and the result appears on the data bus and is copied to the MBR.The PC is incremented by 1 for the next instruction
.The third step moves the content of the MBR to the Instruction Register.

The fetch cycle consists of three steps and four micro-operations. Each micro operation involves the movement
of data into or out of a register.

Fig. 6 Sequence of events, fetch cycle.

 The first time unit: Move content of PC to MAR


 Second time unit: move contents of memory location specified by MAR to MBR. Increment by 1 the
content of the PC.
 Third time unit: Move contents of MBR to IR

THE DECODING PHASE

Once the instruction is in the instruction register, it is decoded by the decoder of the control unit. The decoding
is done to enable the microprocessor determine the kind of operation it is required to perform. Decoding is only
performed on instructions and not data. The instruction and data in a typical command such as "ADD 4 to 7" is
as follows

 ADD = Instruction
 4 and 7 = data
THE EXECUTION PHASE

The control unit issues appropriate sequence of signals depending on the decoded information. Those signals
affect the required execution (e.g. data transfer and or operation). The figure below shows a general model of a
control unit showing all its inputs and outputs. The inputs signals are:

Clock: The clock enables the control unit "keep time". The control unit causes one microoperation to be performed
for each clock pulse. This is sometimes referred to as the processor cycle time or the clock cycle time.

Fig. 7 Block diagram of the Control Unit.


Instruction register: the opcode and addressing mode of the current instruction are used to determine which
microoperation to perform during execution cycle.

Flags: These are needed by the control unit to determine the status of the processor and outcome of previous ALU
operations.

Control signals from control bus: The control bus portion of the system bus provides signals to the control unit.

The outputs are as follows

 Control signals within the processor: These are two types: those that cause data to be moved from one
register to another and those that activate specific ALU functions.
 Control signals to control bus: these are also of two types: control signals to memory and control signals
to the I/O module.

Three types of control signals are used: Those that activate ALU functions; those that activate a data path; and
those that are signals on the external system bus or other external interface. All of these signals are ultimately
applied directly as binary inputs to individual logic gates.

Steps of the Fetch -Decode-Execute cycle

The CPU executes each instruction in a series of small steps.


1. Fetch the next instruction from memory whose address is currently in the program counter register.

2. Put this data into instruction register.

3. Add 1 to the address in the program counter

4. If the instruction uses data in memory determine where they are

5. Fetch the data, if any into internal CPU registers

6. Execute the instructions

7. Store the result in the proper place.

8. Go to step 1 to begin executing the following instruction.

BUSES

The CPU, memory unit and I/O devices must be able to communicate with each other. For example, the CPU
must be able to specify which memory cell is to be selected and if the content of the cell should be read or new
data written into the cell.

Memory and I/O devices are connected to the CPU through a group of lines called a bus. These lines are meant
to carry information. There are three types of buses

1. Address bus
2. Data bus and
3. Control bus

The figure below shows the different buses

Fig.8 I/O or Memory connection to CPU

The Address Bus

The address bus is unidirectional. It carries an address of a memory location or an I/O device that the CPU wants
to access. If the processor wishes to read a word (8, 16, 32 bits) of data from memory it puts the address of the
desired word on the address lines. The width of the address bus determines the maximum possible memory
capacity of the system. The address lines are generally used to address I/O ports. Typically,the higher order bits
are used to select a particular module on the bus and the lower order bits selects the memory location or I/O port
within the module.

The Data Bus

The data and control buses are bidirectional because the data can flow in either direction from CPU to memory
(or I/O device) or from memory or (I/O device) to the CPU.The data bus provides a path for moving data among
system modules. The data bus may consist of 32, 64,128 or even more separate lines. The numbers of lines are
referred to as the width of the data bus. Hence each line can carry only one bit at a time. The number of lines
determines how many bits can be transferred at a time. The width of the data bus is a key factor in determining
overall system performance. For example if the data bus is 32 bits wide and each instruction is 64 bits long, then
the processor must access the memory module twice during each instruction cycle.

The Control Bus

It is used to control access to and the use of data and address lines. Because the data and address lines are shared
by all components, there must be a means of controlling their use. Examples of control signals are

 RD, WR.
 Memory write causes data on the bus to be written into the addressed location
 Memory read cause data from the addressed location to be placed on the bus.
 I/O write causes data on the bus to be output to the addressed I/O port.
 Bus grant indicates that a requesting module has been granted control of the bus.
 Bus request indicates that a module needs to gain control of the bus.

The operation of the bus is as follows. If one module wishes to send data to another it must do two things

1. Obtain the use of the bus and


2. Transfer data via the bus

If one module wishes to request data from another module, it must

1. Obtain the use of the bus and


2. Transfer a request to the other module over the appropriate control and address lines. It must then wait for
that second module to send the data.

Typical Operation Procedure

Suppose a microprocessor is to add I0100001 to 11010111. First for these two numbers to be added they must be
stored in the main memory. The ADD instruction must be stored in main memory as shown below.
Fig.9 illustrating a typical operation procedure
The addition procedure will go through the following sequence
1. The ADD instruction is fetched and placed in the instructions register where it is decoded.
2. The data element 10100001 is fetched and also placed in one of the microprocessor internal registers (e.g.
accumulator)
3. Next the data 11010111is fetched and also placed in one of the internal register (say register B) then the
ALU is used to perform the addition operation.

INPUT DEVICES
The I/O devices and secondary storage units of a computer are called peripherals. An input device enters data and
instructions into a computer. An input device will always convert input data and instructions into a suitable binary
form that can be accepted by the computer. Commonly used input device is a keyboard. Examples of other input
devices are mouse, lightpen, graphic tablet, joystick, track ball, touch screen. Each of these devices permits the
user to select something on CRT screen by pointing something on it.Voice systems have also developed a
microphone as an input device.

Keyboard
Programs and data are entered into a computer through a keyboard which is attached to a microcomputer or a
terminal of a server or super computer. The keyboard contains alphabets, digits, special characters, functions and
some control keys. When a key is pressed an electronic signal is produced which is detected by an electronic
circuit called keyboard encoder. The function of an encoder is to detect which key has been pressed and to send
a binary code. The binary code may be an ASCII (American Standard Code for information interchange),
EBCDIC (Extended Binary Coded Decimal Interchange Code) or HEX code.

Light Pen
This is a pointing device. It is used to select a displayed menu option on the CRT. It is a photosensitive pen like
device. It is capable of sensing a position on the CRT screen when its tip touches the screen. When its tip touches
the screen surface its photo cell sensing element detects the light coming from the screen and the corresponding
signals are sent to the processor. A light pen can also be used for graphic work.
Mouse
A mouse is a device used to move the cursor on the CRT screen (video screen) of the computer at faster rate.
Besides moving the cursor on the screen, certain operations are also performed by pressing buttons provided on
the mouse. Cordless mouse is also available. A mouse may have three or four buttons for operation. Optical mouse
LED (Light Emitting Diodes)

Joysticks
A joystick is also a pointing device; it is also used to move the cursor position on a CRT screen. Its function is
similar to that of a mouse. A joystick is stick which has a spherical ball at its lower end as well as at its upper end
as shown below. The lower spherical ball moves in a socket. The joystick can be moved right or left, forward or
backward.

Fig. 10 Joystick
Eraser or Pointing Stick
It is a pointing device used in laptops where there is no space for conventional mouse. It looks like a pencil eraser
.It is embedded among G, H, and B keys on a keyboard. When a finger applies pressure to the eraser it responds
by sending information about cursor movement on the screen.

Track pads
It is one of the latest pointing devices.

Track Balls
This is a pointing device and contains a ball which can rotate in any direction. The user spins the balls in different
direction to move the cursor on the CRT screen.

Scanners
Scanners are input devices that convert printed text, graphics, and pictures etc to digital form. They are capable
of entering information directly into the computer. The main advantage of direct entry of information is that users
do not have to key the information. This provides faster and more accurate data entry. Important types of scanners
are optical scanners and magnetic-ink character readers.

Optical Scanners
Flatbed scanner: In this type, the page to be scanned is placed over a glass plate. A light source is kept below the
glass plate which moves from left to right horizontally. Each page is treated as a matrix of dots. Each dot is sensed
whether it reflects light or absorbs light. The light source focuses light on a very thin line called a scan line. The
dots laying on a scan lines are sensed. The entire page is divided into a number of scan lines. The scanner senses
each scan line one by one. The dot (spot) which reflects light are taken as 1 and the dots which do not reflect light
(i.e. absorb light) are taken to present 0. Reflected light by dots are sensed by CCD (Change Coupled Devices).
After scanning one scan line, the scanner scans the next scan line. In this way, it scans the entire page. The entire
page is presented by matrix of bits. The scanned page is stored in the Computer’s memory in bit mapped form.

Optical Bar-Code reader


This method uses a number of bars or (lines) of varying thickness and spacing between them to indicate the
desired information. Barcode are used in most supermarkets. An optical bar reader can read such bars and convert
them into electrical pulses to be processed by a computer. The most commonly used bar code is the Universal
Product Code (UPC). The UPC code uses a series of vertical bars of varying width.These bars are detected as ten
digits. The first five digits identify the supplier or manufacturer of the item.The second five digits identify
individual products.The code also contains a check digit to ensure that the information read is correct or not.
A point of sale terminal often contains an optical bar reader. It is an only terminal connected to a computer for
processing.The optical bar reader reads the bar-code of an item.The bar-code is decoded and data are sent to the
computer. The computer prints the name of the item; its price and other necessary information on the receipt. The
stock at hand and sale record are also updated.

Touch Screen
Some computers have touch screen which is sensitive to users touch. One can use finger to point the command
displayed on the screen. It is popular on laptops.

OUT PUT DEVICES


Output devices receive information from the computer and provide them to users. The computer sends information
to the output devices in binary coded forms. The output device converts them into a form which can be used by
users such as printed form or display on a screen. The common used output devices with general purpose
computers are CRT screen and pointers. There are certain devices which act as both input as well as output
devices. Examples are teleprinter terminal, visual display terminals. A visual display terminal contains a keyboard
for input and a visual display unit for output. Other types of display units are also available such as LED (Light
Emitting Decodes) display, LCD (Liquid crystalline display) display and plasma screens.

Non-CRT Displays
These include LED, LCD and plasma displays. LED displays are used in microprocessor based industrial control
instruments where only small amounts of data are to be displayed. CRT screen display is used where a large
amount of data are to be displayed. In portable battery powered instruments usually LCD displays are used
because they consume less power.

PRINTERS
Printers are commonly used output devices. They provide information in a permanent readable form. They
produce printed output of results, programs and data. Printers which are used with computers are classified as
follows.
i) Character printers.
ii) Line printers
iii) Page printers
A character printer prints one character of the text at a time. A line printer prints one line of the text at a time. A
page printer prints one page of text at a time. Printers can also be classified as
i) Impact Printers-They use electromechanical mechanism that causes hammers or pins to strike against a
ribbon and paper to print the text.
ii) Non-impact printers-They do not use electromechanical printing head to strike against ribbon and paper.
They use thermal, chemical, electrostatic laser beam or inkjet technology for printing the text. Usually a
non-impact printer is faster than an impact type printer. The disadvantage of non-impact printers is that
they produce single copy of the text whereas impact printers produce multiple copies of the text.

Character Printers
They print one character at a time. They are low speed printers. Their printing speed lies in the range of 30-600
characters per second depending upon the type of the printer. They are used with personal computers for low
volume printing work. Characters to be printed are sent serial to the printer. Examples of these printers are Dot-
matrix impact type character printers, ink jet printers and color ink jet printers.

Laser Printers
Laser printers are page printers. An entire page is processed at a time. They use laser beams to produce an image

Plotters
Plotters are output devices. They are used to produce precise and good quality graphics and drawings under
computers control. They use ink-pen or ink- jet to draw graphics or drawings. Pen plotters are slow devices. Pen
plotters can be classified as follows
1) Drum plotters-uses a long cylinder and a pen carriage. The paper is placed over the drum; the drum rotates
back and forth to give up and down movement.
2) Microgrip plotters-They don’t use drums and have high performance at low cost.
3) Flat-bed plotters-They use horizontal surface on which paper, vellum, Mylar or any other medium can be
fixed.
4) Inkjet Plotter-Some plotters employ ink-jet in place of pens. They use a drum and the paper is placed over
the drum with ink-jet having different colors. Such plotter produce multi-color large diagram.

INPUT AND OUTPUT PORT


Fig. 11 Interfacing of I/O device through I/O port
Input and output devices cannot be interfaced to a microprocessor directly because they are not provided with the
necessary logic circuitry needed for direct interfacing to the processor buses. The I/O module contains logic for
performing communication function between the peripheral and the bus. An input device is connected to the
processor through an input port. The port is the place for loading or unloading data. The input device unloads data
into an input port. The microprocessor reads data from the input port. Similarly an output device is connected to
the processor through an output port. The microprocessor unloads data into an output port. Then the output device
receives data from the output port.
An I/O port may be programmable or non-programmable. A non-programmable port is permanently connected
to the processor to behave either as input port or output port. If connected as an input port, it will always act as
an input port and vice versa. A programmable port can also be permanently connected to the processor but it can
be made to act either as input port or output port by software techniques.
Peripherals cannot be connected directly to the system bus because of the following reasons.
I. There are wide varieties of peripherals with various methods of operation. It would be impractical to
incorporate the necessary logic within the processor to control a range of devices.
II. The data transfer rate of peripherals is often slower than that of the memory or processor. Thus, it is
impractical to use the high-speed system bus to communicate directly with a peripheral
III. On the other hand, the data transfer rate of some peripherals is faster than that of the memory or processor.
IV. Peripherals often use different data formats and word lengths than the computer to which they are attached.
The I/O port has two major functions

 It interfaces the processor and memory via the system bus or central switch.
 It interfaces to one or more peripherals devices by tailored data links.

MEMORY

You might also like