Component of A Digital Computer
Component of A Digital Computer
Component of A Digital Computer
The memory, input and output devices are also known as peripherals. The figure below shows a 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
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
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 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.
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.
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).
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 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 occurs at the beginning of each instruction cycle and causes an instruction to be fetched from
memory.
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.
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.
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.
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.
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 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 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.
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
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.
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.
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.
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